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

add_OnGetSchemaDataTable

 

method add_OnGetSchemaDataTable(value: RestOnGetSchemaDataTableHandler)

 

void add_OnGetSchemaDataTable(RestOnGetSchemaDataTableHandler value)

 

Sub add_OnGetSchemaDataTable(value As RestOnGetSchemaDataTableHandler)

Parameters:

  • value:

add_OnLoginNeeded

 

method add_OnLoginNeeded(value: RestOnLoginNeededHandler)

 

void add_OnLoginNeeded(RestOnLoginNeededHandler value)

 

Sub add_OnLoginNeeded(value As RestOnLoginNeededHandler)

Parameters:

  • value:

add_OnProcessTargetUrl

 

method add_OnProcessTargetUrl(value: RestOnProcessTargetUrlHandler)

 

void add_OnProcessTargetUrl(RestOnProcessTargetUrlHandler value)

 

Sub add_OnProcessTargetUrl(value As RestOnProcessTargetUrlHandler)

Parameters:

  • value:

add_OnUnknownRequest

 

method add_OnUnknownRequest(value: RestOnUnknownRequestHandler)

 

void add_OnUnknownRequest(RestOnUnknownRequestHandler value)

 

Sub add_OnUnknownRequest(value As RestOnUnknownRequestHandler)

Parameters:

  • value:

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

Message

Rest message to use.

 

property Message: RestMessage read write;

 

RestMessage Message { get; set; }

 

Property Message As RestMessage

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: RestOnGetSchemaDataTableHandler;
delegate: method OnGetSchemaDataTable(sender: Object; e: RestOnGetSchemaDataTableArgs)

 

delegate RestOnGetSchemaDataTableHandler OnGetSchemaDataTable()
delegate: void OnGetSchemaDataTable(Object sender, RestOnGetSchemaDataTableArgs e)

 

Event OnGetSchemaDataTable As RestOnGetSchemaDataTableHandler
delegate: Sub OnGetSchemaDataTable(sender As Object, e As RestOnGetSchemaDataTableArgs)

OnLoginNeeded

 

event OnLoginNeeded: RestOnLoginNeededHandler;
delegate: method OnLoginNeeded(sender: Object; e: RestOnLoginNeededArgs)

 

delegate RestOnLoginNeededHandler OnLoginNeeded()
delegate: void OnLoginNeeded(Object sender, RestOnLoginNeededArgs e)

 

Event OnLoginNeeded As RestOnLoginNeededHandler
delegate: Sub OnLoginNeeded(sender As Object, e As RestOnLoginNeededArgs)

OnProcessTargetUrl

 

event OnProcessTargetUrl: RestOnProcessTargetUrlHandler;
delegate: method OnProcessTargetUrl(sender: Object; e: RestOnProcessTargetUrlArgs)

 

delegate RestOnProcessTargetUrlHandler OnProcessTargetUrl()
delegate: void OnProcessTargetUrl(Object sender, RestOnProcessTargetUrlArgs e)

 

Event OnProcessTargetUrl As RestOnProcessTargetUrlHandler
delegate: Sub OnProcessTargetUrl(sender As Object, e As RestOnProcessTargetUrlArgs)

OnUnknownRequest

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

 

event OnUnknownRequest: RestOnUnknownRequestHandler;
delegate: method OnUnknownRequest(sender: Object; e: RestOnUnknownRequestArgs)

 

delegate RestOnUnknownRequestHandler OnUnknownRequest()
delegate: void OnUnknownRequest(Object sender, RestOnUnknownRequestArgs e)

 

Event OnUnknownRequest As RestOnUnknownRequestHandler
delegate: Sub OnUnknownRequest(sender As Object, e As RestOnUnknownRequestArgs)

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 (IHttpRequest, IHttpResponse, Stream, Stream)    (declared in ExtendedHttpDispatcher)

 

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

 

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

 

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

Parameters:

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

Process (IHttpRequest, IHttpResponse, Stream, Stream)

Process an http request. Called by the base class when the http server has a rest specific request to process.

 

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

 

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

 

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

Parameters:

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

remove_OnGetSchemaDataTable

 

method remove_OnGetSchemaDataTable(value: RestOnGetSchemaDataTableHandler)

 

void remove_OnGetSchemaDataTable(RestOnGetSchemaDataTableHandler value)

 

Sub remove_OnGetSchemaDataTable(value As RestOnGetSchemaDataTableHandler)

Parameters:

  • value:

remove_OnLoginNeeded

 

method remove_OnLoginNeeded(value: RestOnLoginNeededHandler)

 

void remove_OnLoginNeeded(RestOnLoginNeededHandler value)

 

Sub remove_OnLoginNeeded(value As RestOnLoginNeededHandler)

Parameters:

  • value:

remove_OnProcessTargetUrl

 

method remove_OnProcessTargetUrl(value: RestOnProcessTargetUrlHandler)

 

void remove_OnProcessTargetUrl(RestOnProcessTargetUrlHandler value)

 

Sub remove_OnProcessTargetUrl(value As RestOnProcessTargetUrlHandler)

Parameters:

  • value:

remove_OnUnknownRequest

 

method remove_OnUnknownRequest(value: RestOnUnknownRequestHandler)

 

void remove_OnUnknownRequest(RestOnUnknownRequestHandler value)

 

Sub remove_OnUnknownRequest(value As RestOnUnknownRequestHandler)

Parameters:

  • value:

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

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:

 

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

Message

Rest message to use.

 

property Message: RestMessage read write;

 

RestMessage Message { get; set; }

 

Property Message As RestMessage

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

add_OnGetSchemaDataTable

 

method add_OnGetSchemaDataTable(value: RestOnGetSchemaDataTableHandler)

 

void add_OnGetSchemaDataTable(RestOnGetSchemaDataTableHandler value)

 

Sub add_OnGetSchemaDataTable(value As RestOnGetSchemaDataTableHandler)

Parameters:

  • value:

add_OnLoginNeeded

 

method add_OnLoginNeeded(value: RestOnLoginNeededHandler)

 

void add_OnLoginNeeded(RestOnLoginNeededHandler value)

 

Sub add_OnLoginNeeded(value As RestOnLoginNeededHandler)

Parameters:

  • value:

add_OnProcessTargetUrl

 

method add_OnProcessTargetUrl(value: RestOnProcessTargetUrlHandler)

 

void add_OnProcessTargetUrl(RestOnProcessTargetUrlHandler value)

 

Sub add_OnProcessTargetUrl(value As RestOnProcessTargetUrlHandler)

Parameters:

  • value:

add_OnUnknownRequest

 

method add_OnUnknownRequest(value: RestOnUnknownRequestHandler)

 

void add_OnUnknownRequest(RestOnUnknownRequestHandler value)

 

Sub add_OnUnknownRequest(value As RestOnUnknownRequestHandler)

Parameters:

  • value:

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 (IHttpRequest, IHttpResponse, Stream, Stream)    (declared in ExtendedHttpDispatcher)

 

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

 

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

 

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

Parameters:

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

Process (IHttpRequest, IHttpResponse, Stream, Stream)

Process an http request. Called by the base class when the http server has a rest specific request to process.

 

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

 

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

 

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

Parameters:

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

remove_OnGetSchemaDataTable

 

method remove_OnGetSchemaDataTable(value: RestOnGetSchemaDataTableHandler)

 

void remove_OnGetSchemaDataTable(RestOnGetSchemaDataTableHandler value)

 

Sub remove_OnGetSchemaDataTable(value As RestOnGetSchemaDataTableHandler)

Parameters:

  • value:

remove_OnLoginNeeded

 

method remove_OnLoginNeeded(value: RestOnLoginNeededHandler)

 

void remove_OnLoginNeeded(RestOnLoginNeededHandler value)

 

Sub remove_OnLoginNeeded(value As RestOnLoginNeededHandler)

Parameters:

  • value:

remove_OnProcessTargetUrl

 

method remove_OnProcessTargetUrl(value: RestOnProcessTargetUrlHandler)

 

void remove_OnProcessTargetUrl(RestOnProcessTargetUrlHandler value)

 

Sub remove_OnProcessTargetUrl(value As RestOnProcessTargetUrlHandler)

Parameters:

  • value:

remove_OnUnknownRequest

 

method remove_OnUnknownRequest(value: RestOnUnknownRequestHandler)

 

void remove_OnUnknownRequest(RestOnUnknownRequestHandler value)

 

Sub remove_OnUnknownRequest(value As RestOnUnknownRequestHandler)

Parameters:

  • value:

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:

 

OnGetSchemaDataTable

 

event OnGetSchemaDataTable: RestOnGetSchemaDataTableHandler;
delegate: method OnGetSchemaDataTable(sender: Object; e: RestOnGetSchemaDataTableArgs)

 

delegate RestOnGetSchemaDataTableHandler OnGetSchemaDataTable()
delegate: void OnGetSchemaDataTable(Object sender, RestOnGetSchemaDataTableArgs e)

 

Event OnGetSchemaDataTable As RestOnGetSchemaDataTableHandler
delegate: Sub OnGetSchemaDataTable(sender As Object, e As RestOnGetSchemaDataTableArgs)

OnLoginNeeded

 

event OnLoginNeeded: RestOnLoginNeededHandler;
delegate: method OnLoginNeeded(sender: Object; e: RestOnLoginNeededArgs)

 

delegate RestOnLoginNeededHandler OnLoginNeeded()
delegate: void OnLoginNeeded(Object sender, RestOnLoginNeededArgs e)

 

Event OnLoginNeeded As RestOnLoginNeededHandler
delegate: Sub OnLoginNeeded(sender As Object, e As RestOnLoginNeededArgs)

OnProcessTargetUrl

 

event OnProcessTargetUrl: RestOnProcessTargetUrlHandler;
delegate: method OnProcessTargetUrl(sender: Object; e: RestOnProcessTargetUrlArgs)

 

delegate RestOnProcessTargetUrlHandler OnProcessTargetUrl()
delegate: void OnProcessTargetUrl(Object sender, RestOnProcessTargetUrlArgs e)

 

Event OnProcessTargetUrl As RestOnProcessTargetUrlHandler
delegate: Sub OnProcessTargetUrl(sender As Object, e As RestOnProcessTargetUrlArgs)

OnUnknownRequest

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

 

event OnUnknownRequest: RestOnUnknownRequestHandler;
delegate: method OnUnknownRequest(sender: Object; e: RestOnUnknownRequestArgs)

 

delegate RestOnUnknownRequestHandler OnUnknownRequest()
delegate: void OnUnknownRequest(Object sender, RestOnUnknownRequestArgs e)

 

Event OnUnknownRequest As RestOnUnknownRequestHandler
delegate: Sub OnUnknownRequest(sender As Object, e As RestOnUnknownRequestArgs)