ODataSchemaDispatcher

Overview

The ODATA (see OData Publishing) Schema Dispatcher is a class that exposes a Data Abstract service as an OData provider. OData is an open specification with standardized ways of accessing, updating, inserting and deleting data and exposing metadata. It has clients on multiple platforms including javascript, PHP, Java, Ruby and .NET. OData is ideal when you need to expose your Data Abstract service to external clients that are unable to use Data Abstract themselves.

Location


 

constructor

Creates a new instance of this class.

 

constructor

 

ODataSchemaDispatcher()

 

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

Name of the service to use for authentication. This can be unassigned in which case no authentication is required. When it's set, the name used should be the name of a SimpleLoginService descendant with a Login method implementation. The Login method is called and cached someone logs through plain HTTP authentication.

 

property HttpAuthLoginServiceName: String read write;

 

String HttpAuthLoginServiceName { get; set; }

 

Property HttpAuthLoginServiceName() As String

HttpAuthRealm

The realm to use during authentication. This is the string the user sees as the domain to which to login.

 

property HttpAuthRealm: String read write;

 

String HttpAuthRealm { get; set; }

 

Property HttpAuthRealm() As String

MaxRecords

Maximum number of records to send in a package. This can be 0 which means unlimited.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords() As Int32

Namespace

The namespace to use for OData. This could be any url that unique identifies this service.

 

property Namespace: String read write;

 

String Namespace { get; set; }

 

Property Namespace() As String

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

Called when the client requests the schema for a particular data table.

 

event OnGetSchemaDataTable: EventHandler<HttpSchemaDataTableRequestEventArgs>;

 

delegate EventHandler<HttpSchemaDataTableRequestEventArgs> OnGetSchemaDataTable()

 

Event OnGetSchemaDataTable As EventHandler<HttpSchemaDataTableRequestEventArgs>

OnGetServiceSchema

 

event OnGetServiceSchema: EventHandler<HttpServiceSchemaRequestEventArgs>;

 

delegate EventHandler<HttpServiceSchemaRequestEventArgs> OnGetServiceSchema()

 

Event OnGetServiceSchema As EventHandler<HttpServiceSchemaRequestEventArgs>

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

Called when a request that is not supported by the OData provider occurs.

 

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:

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:

RootUrl

Full url to where this service is or will be hosted. OData requires absolute urls to be placed in the xml and json results, so this is a required property.

 

property RootUrl: String read write;

 

String RootUrl { get; set; }

 

Property RootUrl() 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

Data Abstract DataAbstractService descendant to use to access the data. This will be your main Data Abstract service that has the schema and business logic you want to expose through this OData schema dispatcher class.

 

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; writeNotAuthorized: Action; writeGenericError: Action<String>; out sessionId: Guid; out releaseSession: Boolean): Boolean

 

Boolean TryAcquireSesssion(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Action writeNotAuthorized, Action<String> writeGenericError, out Guid sessionId, out Boolean releaseSession)

 

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

Parameters:

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

 

HttpAuthLoginServiceName

Name of the service to use for authentication. This can be unassigned in which case no authentication is required. When it's set, the name used should be the name of a SimpleLoginService descendant with a Login method implementation. The Login method is called and cached someone logs through plain HTTP authentication.

 

property HttpAuthLoginServiceName: String read write;

 

String HttpAuthLoginServiceName { get; set; }

 

Property HttpAuthLoginServiceName() As String

HttpAuthRealm

The realm to use during authentication. This is the string the user sees as the domain to which to login.

 

property HttpAuthRealm: String read write;

 

String HttpAuthRealm { get; set; }

 

Property HttpAuthRealm() As String

MaxRecords

Maximum number of records to send in a package. This can be 0 which means unlimited.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords() As Int32

Namespace

The namespace to use for OData. This could be any url that unique identifies this service.

 

property Namespace: String read write;

 

String Namespace { get; set; }

 

Property Namespace() As String

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

RootUrl

Full url to where this service is or will be hosted. OData requires absolute urls to be placed in the xml and json results, so this is a required property.

 

property RootUrl: String read write;

 

String RootUrl { get; set; }

 

Property RootUrl() 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

Data Abstract DataAbstractService descendant to use to access the data. This will be your main Data Abstract service that has the schema and business logic you want to expose through this OData schema dispatcher class.

 

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

 

ODataSchemaDispatcher()

 

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:

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; writeNotAuthorized: Action; writeGenericError: Action<String>; out sessionId: Guid; out releaseSession: Boolean): Boolean

 

Boolean TryAcquireSesssion(IHttpRequest request, IHttpResponse response, Stream requestData, Stream responseData, Action writeNotAuthorized, Action<String> writeGenericError, out Guid sessionId, out Boolean releaseSession)

 

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

Parameters:

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

 

OnGetSchemaDataTable

Called when the client requests the schema for a particular data table.

 

event OnGetSchemaDataTable: EventHandler<HttpSchemaDataTableRequestEventArgs>;

 

delegate EventHandler<HttpSchemaDataTableRequestEventArgs> OnGetSchemaDataTable()

 

Event OnGetSchemaDataTable As EventHandler<HttpSchemaDataTableRequestEventArgs>

OnGetServiceSchema

 

event OnGetServiceSchema: EventHandler<HttpServiceSchemaRequestEventArgs>;

 

delegate EventHandler<HttpServiceSchemaRequestEventArgs> OnGetServiceSchema()

 

Event OnGetServiceSchema As EventHandler<HttpServiceSchemaRequestEventArgs>

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

Called when a request that is not supported by the OData provider occurs.

 

event OnUnknownRequest: EventHandler<HttpUnknownRequestEventArgs>;

 

delegate EventHandler<HttpUnknownRequestEventArgs> OnUnknownRequest()

 

Event OnUnknownRequest As EventHandler<HttpUnknownRequestEventArgs>

 

  • OData Publishing