# \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\core\ToplevelAgent

Der Toplevelagent

#### Type

\nre\core\ToplevelAgent

#

Inherited from
  \nre\core\Api

## Tags

None found

## Methods

### __construct()

    __construct()

Construct a new WebApi.

#

## Tags

None found

### run()

    run() : \nre\core\Exception

Run application.

This method runs the application and handles all errors.

#### Returns

\nre\core\Exception —

Last occurred exception of an subagent

#

## Tags

None found

### render()

    render()

Render output.

#

## Tags

None found

### log()

    log(\nre\core\Exception  $exception, integer  $logMode)

Log an exception

#### Parameters

\nre\core\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\core\ServiceUnavailableException
\nre\core\AgentNotValidException
\nre\core\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(\nre\apis\Exception  $exception, integer  $httpStatusCode)

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

#### Parameters

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

#

## Tags

None found

### errorService()

    errorService(  $exception)

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

$param Exception $exception Occurred exception

#### Parameters

| $exception |

#

## Tags

None found

### WebApi.inc