Introducing RealityServer

RealityServer Web Services: Optional Processing Modules

The following image shows the optional processing modules, request authorization and state setup, that you can include in the processing of HTTP requests. If you want to include these processing modules, you need to create and register them with RealityServer Web Services.

Image showing a custom processing flow for RealityServer Web Services.

Request Authorization

Authorization is the first process applied to an incoming HTTP request. A user-registered module is called with the request and it must either allow or deny it. If denied, the module can do one of the following:

  • Supply a response directly for example, an HTTP authentication challenge
  • Pass an error code and message to the protocol processor where the error code and message are protocol-encoded and returned.

State Setup

State setup is responsible for initializing the state of the RealityServer Web Services execution environment. The major tasks that this user-supplied module must support are:

  • Supplying a scope name in which to execute the service commands
  • Mapping the incoming URL path to the NWS content directory

If no state setup module is supplied, or it does not set these items then command execution occurs in the global scope and URL paths are mapped directly to the content directory.

The mechanism by which the state module works out the execution scope is entirely up to you. The module is supplied with the incoming HTTP request and would typically derive the execution scope from the request. For example, the name could be directly supplied in a cookie or it could be derived from the incoming URL as is done with RealityServer sessions. To accommodate the latter, the module is able to access a named user state scope in which to persist information between requests. This state scope is supplied to all service commands and event handlers so they can access and modify the state information. Additionally, the state scope will be used by RealityServer Web Services itself for any management purposes that require a transaction. If the state needs to persist information that is changed by commands for example, if a command changes the scope, then it should register event handlers that persist these changes.