OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler Class Reference

Inheritance diagram for OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler:

OpenSim::ApplicationPlugins::Rest::RestPlugin OpenSim::ApplicationPlugins::Rest::Inventory::IRestHandler OpenSim::Framework::Servers::IHttpAgentHandler OpenSim::IApplicationPlugin OpenSim::Framework::IPlugin List of all members.

Public Member Functions

override void Initialise (OpenSimBase openSim)
 This method is called by OpenSimMain immediately after loading the plugin and after basic server setup, but before running any server commands.
override void Close ()
 In the interests of efficiency, and because we cannot determine whether or not this instance will actually be harvested, we clobber the only anchoring reference to the working state for this plug-in. What the call to close does is irrelevant to this class beyond knowing that it can nullify the reference when it returns. To make sure everything is copacetic we make sure the primary interface is disabled by deleting the handler from the HTTP server tables.
bool Match (OSHttpRequest request, OSHttpResponse response)
 This method is called by the HTTP server to match an incoming request. It scans all of the strings registered by the underlying handlers and looks for the best match. It returns true if a match is found. The matching process could be made arbitrarily complex. Note: The match is case-insensitive.
bool Handle (OSHttpRequest request, OSHttpResponse response)
 This is called by the HTTP server once the handler has indicated that it is able to handle the request. Preconditions: [1] request != null and is a valid request object [2] response != null and is a valid response object Behavior is undefined if preconditions are not satisfied.
void AddStreamHandler (string httpMethod, string path, RestMethod method)
 Add a stream handler for the designated HTTP method and path prefix. If the handler is not enabled, the request is ignored. If the path does not start with the REST prefix, it is added. If method-qualified path has not already been registered, the method is added to the active handler table.
void AddPathHandler (RestMethodHandler mh, string path, RestMethodAllocator ra)
 A method handler and a request allocator are stored using the designated path as a key. If an entry already exists, it is replaced by the new one.

Properties

override string Name [get]
 Name of the plugin.
override string ConfigName [get]
 Return the config section name.
string MsgId [get]
string RequestId [get]

Detailed Description

The class signature reveals the roles that RestHandler plays.

[1] It is a sub-class of RestPlugin. It inherits and extends the functionality of this class, constraining it to the specific needs of this REST implementation. This relates to the plug-in mechanism supported by OpenSim, the specifics of which are mostly hidden by RestPlugin. [2] IRestHandler describes the interface that this class exports to service implementations. This is the services management interface. [3] IHttpAgentHandler describes the interface that is exported to the BaseHttpServer in support of this particular HTTP processing model. This is the request interface of the handler.


Member Function Documentation

override void OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::Initialise ( OpenSimBase  openSim  )  [inline, virtual]

This method is called by OpenSimMain immediately after loading the plugin and after basic server setup, but before running any server commands.

Note that entries MUST be added to the active configuration files before the plugin can be enabled.

Reimplemented from OpenSim::ApplicationPlugins::Rest::RestPlugin.

override void OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::Close (  )  [inline, virtual]

In the interests of efficiency, and because we cannot determine whether or not this instance will actually be harvested, we clobber the only anchoring reference to the working state for this plug-in. What the call to close does is irrelevant to this class beyond knowing that it can nullify the reference when it returns. To make sure everything is copacetic we make sure the primary interface is disabled by deleting the handler from the HTTP server tables.

Reimplemented from OpenSim::ApplicationPlugins::Rest::RestPlugin.

bool OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::Match ( OSHttpRequest  request,
OSHttpResponse  response 
) [inline]

This method is called by the HTTP server to match an incoming request. It scans all of the strings registered by the underlying handlers and looks for the best match. It returns true if a match is found. The matching process could be made arbitrarily complex. Note: The match is case-insensitive.

Implements OpenSim::Framework::Servers::IHttpAgentHandler.

bool OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::Handle ( OSHttpRequest  request,
OSHttpResponse  response 
) [inline]

This is called by the HTTP server once the handler has indicated that it is able to handle the request. Preconditions: [1] request != null and is a valid request object [2] response != null and is a valid response object Behavior is undefined if preconditions are not satisfied.

Implements OpenSim::Framework::Servers::IHttpAgentHandler.

void OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::AddStreamHandler ( string  httpMethod,
string  path,
RestMethod  method 
) [inline]

Add a stream handler for the designated HTTP method and path prefix. If the handler is not enabled, the request is ignored. If the path does not start with the REST prefix, it is added. If method-qualified path has not already been registered, the method is added to the active handler table.

Implements OpenSim::ApplicationPlugins::Rest::Inventory::IRestHandler.

void OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::AddPathHandler ( RestMethodHandler  mh,
string  path,
RestMethodAllocator  ra 
) [inline]

A method handler and a request allocator are stored using the designated path as a key. If an entry already exists, it is replaced by the new one.

Implements OpenSim::ApplicationPlugins::Rest::Inventory::IRestHandler.


Property Documentation

override string OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::Name [get]

Name of the plugin.

Reimplemented from OpenSim::ApplicationPlugins::Rest::RestPlugin.

override string OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::ConfigName [get]

Return the config section name.

Reimplemented from OpenSim::ApplicationPlugins::Rest::RestPlugin.

string OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::MsgId [get]

Implements OpenSim::ApplicationPlugins::Rest::Inventory::IRestHandler.

string OpenSim::ApplicationPlugins::Rest::Inventory::RestHandler::RequestId [get]

Implements OpenSim::ApplicationPlugins::Rest::Inventory::IRestHandler.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 01:00:46 2009 for OpenSim by  doxygen 1.5.1