# \nre\apisWebApi

WebApi-implementation.

This class runs and renders an web-applictaion.

## Summary

Methods
Properties
Constants
__construct()
run()
render()
No public properties found
No constants found
log()
$request
$response
$log
N/A
loadToplevelAgent()
addRoutes()
error()
errorService()
$toplevelAgent
N/A

File
  apis/WebApi.inc
Package
  Default
Class hierarchy
  \nre\core\Api
  \nre\apis\WebApi

## Tags

author | coderkun olli@coderkun.de

## Properties

### $request

    $request : \nre\core\Request

Die aktuelle Anfrage

#### Type

\nre\core\Request

#

Inherited from
  \nre\core\Api

## Tags

None found

### $response

    $response : \nre\core\Response

Die aktuelle Antwort

#### Type

\nre\core\Response

#

Inherited from
  \nre\core\Api

## Tags

None found

### $log

    $log : \nre\core\Logger

Log-System

#### Type

\nre\core\Logger

#

Inherited from
  \nre\core\Api

## Tags

None found

### $toplevelAgent

    $toplevelAgent : \nre\agents\ToplevelAgent

Der Toplevelagent

#### Type

\nre\agents\ToplevelAgent

#

Inherited from
  \nre\core\Api

## Tags

None found

## Methods

### __construct()

    __construct()

Construct a new WebApi.

#

## Tags

None found

### run()

    run() : \Exception

Run application.

This method runs the application and handles all errors.

#### Returns

\Exception —

Last occurred exception of an subagent

#

## Tags

None found

### render()

    render()

Render output.

#

## Tags

None found

### log()

    log(\Exception  $exception, integer  $logMode)

Log an exception

#### Parameters

\Exception | $exception | Occurred exception
integer | $logMode | Log-mode

#

Inherited from
  \nre\core\Api

## Tags

None found

### loadToplevelAgent()

    loadToplevelAgent()

Load the ToplevelAgent specified by the request.

#### Throws

\nre\exceptions\ServiceUnavailableException
\nre\exceptions\AgentNotValidException
\nre\exceptions\AgentNotFoundException

#

Inherited from
  \nre\core\Api

## Tags

None found

### addRoutes()

    addRoutes()

Add routes (normal and reverse) defined in the AppConfig.

#

## Tags

None found

### error()

    error(\Exception  $exception, integer  $httpStatusCode)

Handle an error that orrcurred during the loading/constructing/running of the ToplevelAgent.

#### Parameters

\Exception | $exception | Occurred exception
integer | $httpStatusCode | HTTP-statuscode

#

## Tags

None found

### errorService()

    errorService(\Exception  $exception)

Handle a error which cannot be handles by the system (and HTTP 503).

#### Parameters

\Exception | $exception | Occurred exception

#

## Tags

None found

### WebApi.inc