RestSchemaDispatcher

Overview

Main class to enable REST support in an Remoting SDK capable Http server class.

Set the base class' Server property to the http implementation to use, and the Path to a valid path (like '/rest').

When /rest is used. /rest/tablename will return all records in that table. ?filter= can be used to filter based on a filter query, e.g. filter=Login%3d3 (the comparison operators must be escaped). ?Session or ?sessionid can be used to pass a session id, if needed.

To access the tables via REST in Relativity Server, the URL should be of the form:

http://localhost:7099/rest/SampleDomain/SampleSchema

Location

 

constructor

Creates a new instance of this class .

 

constructor

 

RestSchemaDispatcher()

 

Sub New()

Activate    (declared in ExtendedHttpDispatcher)

 

method Activate

 

void Activate()

 

Sub Activate()

CanHandlePath    (declared in ExtendedHttpDispatcher)

Checks if the provided relative HTTP request path can be processed by this dispatcher.

 

method CanHandlePath(path: String): Boolean

 

Boolean CanHandlePath(String path)

 

Function CanHandlePath(path As String) As Boolean

Parameters:

  • path:

Deactivate    (declared in ExtendedHttpDispatcher)

 

method Deactivate

 

void Deactivate()

 

Sub Deactivate()

Dispose  protected    (declared in ExtendedHttpDispatcher)

If the disposing parameter is set to true, this method unregisters this dispatcher instance from the server.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing: If set to true, the current dispatcher instance will be unregistered from the server.

HttpAuthLoginServiceName

Service name to use for http authentication. This service should be a SimpleLoginService and implement the Login method. The REST processor will call the Login method with the provided username and password before trying to fetch data. If the Service in ServiceName does not require a session this is ignored.

 

property HttpAuthLoginServiceName: String read write;

 

String HttpAuthLoginServiceName { get; set; }

 

Property HttpAuthLoginServiceName() As String

HttpAuthRealm

Realm to use when requesting authentication.

 

property HttpAuthRealm: String read write;

 

String HttpAuthRealm { get; set; }

 

Property HttpAuthRealm() As String

MaxRecords

Maximum number of records to return in a single result set. Defaults to 100.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords() As Int32

NotifyDispose    (declared in ExtendedHttpDispatcher)

This method is called when the ExtendedDispatcherList instance where the current instance is registered is disposed.

 

method NotifyDispose

 

void NotifyDispose()

 

Sub NotifyDispose()

OnGetSchemaDataTable

 

event OnGetSchemaDataTable: EventHandler<HttpSchemaDataTableRequestEventArgs>;

 

delegate EventHandler<HttpSchemaDataTableRequestEventArgs> OnGetSchemaDataTable()

 

Event OnGetSchemaDataTable As EventHandler<HttpSchemaDataTableRequestEventArgs>

OnLoginNeeded

 

event OnLoginNeeded: EventHandler<HttpLoginEventArgs>;

 

delegate EventHandler<HttpLoginEventArgs> OnLoginNeeded()

 

Event OnLoginNeeded As EventHandler<HttpLoginEventArgs>

OnProcessTargetUrl

 

event OnProcessTargetUrl: EventHandler<HttpProcessTargetUrlEventArgs>;

 

delegate EventHandler<HttpProcessTargetUrlEventArgs> OnProcessTargetUrl()

 

Event OnProcessTargetUrl As EventHandler<HttpProcessTargetUrlEventArgs>

OnUnknownRequest

Event for when a request cannot be processed by the engine.

 

event OnUnknownRequest: EventHandler<HttpUnknownRequestEventArgs>;

 

delegate EventHandler<HttpUnknownRequestEventArgs> OnUnknownRequest()

 

Event OnUnknownRequest As EventHandler<HttpUnknownRequestEventArgs>

Path    (declared in ExtendedHttpDispatcher)

Gets or sets the relative HTTP path requests that will be processed by the current HttpDispatcher instance.

Path should begin with "/".

 

property Path: String read write;

 

String Path { get; set; }

 

Property Path() As String

Process

 

method Process(context: IServerChannelInfo; request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream)

 

void Process(IServerChannelInfo context, IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData)

 

Sub Process(context As IServerChannelInfo, request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream)

Parameters:

  • context:
  • request:
  • response:
  • requestData:
  • responseData:

ProcessDataRequest  protected

 

method ProcessDataRequest(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; sessionId: Guid)

 

void ProcessDataRequest(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Guid sessionId)

 

Sub ProcessDataRequest(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, sessionId As Guid)

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:

ReleaseSession  protected

 

method ReleaseSession(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; sessionId: Guid; releaseSession: Boolean)

 

void ReleaseSession(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Guid sessionId, Boolean releaseSession)

 

Sub ReleaseSession(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, sessionId As Guid, releaseSession As Boolean)

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:
  • releaseSession:

Server    (declared in ExtendedHttpDispatcher)

The IHttpServer instance this dispatcher is registered in.

The ExtendedHttpDispatcher instance is automatically registered in the provided IHttpServer instance's extended dispatchers list when this property is set.

 

property Server: IHttpServer read write;

 

IHttpServer Server { get; set; }

 

Property Server() As IHttpServer

ServiceName

Service name of an ISimpleDataAbstractService implementation that will actually process the request.

 

property ServiceName: String read write;

 

String ServiceName { get; set; }

 

Property ServiceName() As String

SessionManager

 

property SessionManager: ISessionManager read write;

 

ISessionManager SessionManager { get; set; }

 

Property SessionManager() As ISessionManager

TryAcquireSesssion  protected

 

method TryAcquireSesssion(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; out sessionId: Guid; out releaseSession: Boolean): Boolean

 

Boolean TryAcquireSesssion(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, out Guid sessionId, out Boolean releaseSession)

 

Function TryAcquireSesssion(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, <OutAttribute> ByRef sessionId As Guid, <OutAttribute> ByRef releaseSession As Boolean) As Boolean

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:
  • releaseSession:

WriteDataTableNotFound  protected

Send a "not found" error to the client.

 

method WriteDataTableNotFound(table: String; response: IHttpResponse; responseData: Stream)

 

void WriteDataTableNotFound(String table, IHttpResponse response, Stream responseData)

 

Sub WriteDataTableNotFound(table As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • table:
  • response:
  • responseData:

WriteEmptyOk  protected

Send an OK to the server with no data (succesful updates)

 

method WriteEmptyOk(response: IHttpResponse; responseData: Stream)

 

void WriteEmptyOk(IHttpResponse response, Stream responseData)

 

Sub WriteEmptyOk(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

WriteError  protected

Send an error to the client.

 

method WriteError(error: String; response: IHttpResponse; responseData: Stream)

 

void WriteError(String error, IHttpResponse response, Stream responseData)

 

Sub WriteError(error As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • error:
  • response:
  • responseData:

WriteNotAuthorized  protected

Send a not-authenticated to the client.

 

method WriteNotAuthorized(response: IHttpResponse; responseData: Stream)

 

void WriteNotAuthorized(IHttpResponse response, Stream responseData)

 

Sub WriteNotAuthorized(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

WriteRecordNotFound  protected

When filtering, sends a not-found error.

 

method WriteRecordNotFound(path: String; response: IHttpResponse; responseData: Stream)

 

void WriteRecordNotFound(String path, IHttpResponse response, Stream responseData)

 

Sub WriteRecordNotFound(path As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • path:
  • response:
  • responseData:

WriteSessionNotFound  protected

 

method WriteSessionNotFound(response: IHttpResponse; responseData: Stream)

 

void WriteSessionNotFound(IHttpResponse response, Stream responseData)

 

Sub WriteSessionNotFound(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

 

HttpAuthLoginServiceName

Service name to use for http authentication. This service should be a SimpleLoginService and implement the Login method. The REST processor will call the Login method with the provided username and password before trying to fetch data. If the Service in ServiceName does not require a session this is ignored.

 

property HttpAuthLoginServiceName: String read write;

 

String HttpAuthLoginServiceName { get; set; }

 

Property HttpAuthLoginServiceName() As String

HttpAuthRealm

Realm to use when requesting authentication.

 

property HttpAuthRealm: String read write;

 

String HttpAuthRealm { get; set; }

 

Property HttpAuthRealm() As String

MaxRecords

Maximum number of records to return in a single result set. Defaults to 100.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords() As Int32

Path    (declared in ExtendedHttpDispatcher)

Gets or sets the relative HTTP path requests that will be processed by the current HttpDispatcher instance.

Path should begin with "/".

 

property Path: String read write;

 

String Path { get; set; }

 

Property Path() As String

Server    (declared in ExtendedHttpDispatcher)

The IHttpServer instance this dispatcher is registered in.

The ExtendedHttpDispatcher instance is automatically registered in the provided IHttpServer instance's extended dispatchers list when this property is set.

 

property Server: IHttpServer read write;

 

IHttpServer Server { get; set; }

 

Property Server() As IHttpServer

ServiceName

Service name of an ISimpleDataAbstractService implementation that will actually process the request.

 

property ServiceName: String read write;

 

String ServiceName { get; set; }

 

Property ServiceName() As String

SessionManager

 

property SessionManager: ISessionManager read write;

 

ISessionManager SessionManager { get; set; }

 

Property SessionManager() As ISessionManager

 

constructor

Creates a new instance of this class .

 

constructor

 

RestSchemaDispatcher()

 

Sub New()

Activate    (declared in ExtendedHttpDispatcher)

 

method Activate

 

void Activate()

 

Sub Activate()

CanHandlePath    (declared in ExtendedHttpDispatcher)

Checks if the provided relative HTTP request path can be processed by this dispatcher.

 

method CanHandlePath(path: String): Boolean

 

Boolean CanHandlePath(String path)

 

Function CanHandlePath(path As String) As Boolean

Parameters:

  • path:

Deactivate    (declared in ExtendedHttpDispatcher)

 

method Deactivate

 

void Deactivate()

 

Sub Deactivate()

Dispose  protected    (declared in ExtendedHttpDispatcher)

If the disposing parameter is set to true, this method unregisters this dispatcher instance from the server.

 

method Dispose(disposing: Boolean)

 

void Dispose(Boolean disposing)

 

Sub Dispose(disposing As Boolean)

Parameters:

  • disposing: If set to true, the current dispatcher instance will be unregistered from the server.

NotifyDispose    (declared in ExtendedHttpDispatcher)

This method is called when the ExtendedDispatcherList instance where the current instance is registered is disposed.

 

method NotifyDispose

 

void NotifyDispose()

 

Sub NotifyDispose()

Process

 

method Process(context: IServerChannelInfo; request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream)

 

void Process(IServerChannelInfo context, IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData)

 

Sub Process(context As IServerChannelInfo, request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream)

Parameters:

  • context:
  • request:
  • response:
  • requestData:
  • responseData:

ProcessDataRequest  protected

 

method ProcessDataRequest(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; sessionId: Guid)

 

void ProcessDataRequest(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Guid sessionId)

 

Sub ProcessDataRequest(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, sessionId As Guid)

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:

ReleaseSession  protected

 

method ReleaseSession(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; sessionId: Guid; releaseSession: Boolean)

 

void ReleaseSession(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Guid sessionId, Boolean releaseSession)

 

Sub ReleaseSession(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, sessionId As Guid, releaseSession As Boolean)

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:
  • releaseSession:

TryAcquireSesssion  protected

 

method TryAcquireSesssion(request: IHttpRequest; response: IHttpResponse; requestData: Stream; responseData: Stream; out sessionId: Guid; out releaseSession: Boolean): Boolean

 

Boolean TryAcquireSesssion(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, out Guid sessionId, out Boolean releaseSession)

 

Function TryAcquireSesssion(request As IHttpRequest, response As IHttpResponse, requestData As Stream, responseData As Stream, <OutAttribute> ByRef sessionId As Guid, <OutAttribute> ByRef releaseSession As Boolean) As Boolean

Parameters:

  • request:
  • response:
  • requestData:
  • responseData:
  • sessionId:
  • releaseSession:

WriteDataTableNotFound  protected

Send a "not found" error to the client.

 

method WriteDataTableNotFound(table: String; response: IHttpResponse; responseData: Stream)

 

void WriteDataTableNotFound(String table, IHttpResponse response, Stream responseData)

 

Sub WriteDataTableNotFound(table As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • table:
  • response:
  • responseData:

WriteEmptyOk  protected

Send an OK to the server with no data (succesful updates)

 

method WriteEmptyOk(response: IHttpResponse; responseData: Stream)

 

void WriteEmptyOk(IHttpResponse response, Stream responseData)

 

Sub WriteEmptyOk(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

WriteError  protected

Send an error to the client.

 

method WriteError(error: String; response: IHttpResponse; responseData: Stream)

 

void WriteError(String error, IHttpResponse response, Stream responseData)

 

Sub WriteError(error As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • error:
  • response:
  • responseData:

WriteNotAuthorized  protected

Send a not-authenticated to the client.

 

method WriteNotAuthorized(response: IHttpResponse; responseData: Stream)

 

void WriteNotAuthorized(IHttpResponse response, Stream responseData)

 

Sub WriteNotAuthorized(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

WriteRecordNotFound  protected

When filtering, sends a not-found error.

 

method WriteRecordNotFound(path: String; response: IHttpResponse; responseData: Stream)

 

void WriteRecordNotFound(String path, IHttpResponse response, Stream responseData)

 

Sub WriteRecordNotFound(path As String, response As IHttpResponse, responseData As Stream)

Parameters:

  • path:
  • response:
  • responseData:

WriteSessionNotFound  protected

 

method WriteSessionNotFound(response: IHttpResponse; responseData: Stream)

 

void WriteSessionNotFound(IHttpResponse response, Stream responseData)

 

Sub WriteSessionNotFound(response As IHttpResponse, responseData As Stream)

Parameters:

  • response:
  • responseData:

 

OnGetSchemaDataTable

 

event OnGetSchemaDataTable: EventHandler<HttpSchemaDataTableRequestEventArgs>;

 

delegate EventHandler<HttpSchemaDataTableRequestEventArgs> OnGetSchemaDataTable()

 

Event OnGetSchemaDataTable As EventHandler<HttpSchemaDataTableRequestEventArgs>

OnLoginNeeded

 

event OnLoginNeeded: EventHandler<HttpLoginEventArgs>;

 

delegate EventHandler<HttpLoginEventArgs> OnLoginNeeded()

 

Event OnLoginNeeded As EventHandler<HttpLoginEventArgs>

OnProcessTargetUrl

 

event OnProcessTargetUrl: EventHandler<HttpProcessTargetUrlEventArgs>;

 

delegate EventHandler<HttpProcessTargetUrlEventArgs> OnProcessTargetUrl()

 

Event OnProcessTargetUrl As EventHandler<HttpProcessTargetUrlEventArgs>

OnUnknownRequest

Event for when a request cannot be processed by the engine.

 

event OnUnknownRequest: EventHandler<HttpUnknownRequestEventArgs>;

 

delegate EventHandler<HttpUnknownRequestEventArgs> OnUnknownRequest()

 

Event OnUnknownRequest As EventHandler<HttpUnknownRequestEventArgs>