\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

Properties

Methods

__construct()

__construct() 

Construct a new WebApi.

run()

run() : \Exception

Run application.

This method runs the application and handles all errors.

Returns

\Exception —

Last occurred exception of an subagent

render()

render() 

Render output.

log()

log(\Exception  $exception, integer  $logMode) 

Log an exception

Parameters

\Exception $exception

Occurred exception

integer $logMode

Log-mode

loadToplevelAgent()

loadToplevelAgent() 

Load the ToplevelAgent specified by the request.

Throws

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

addRoutes()

addRoutes() 

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

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

errorService()

errorService(\Exception  $exception) 

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

Parameters

\Exception $exception

Occurred exception