BaseLoginService

Overview

Provides the base for the SimpleLoginService and MultiDbLoginService service classes used by the Login templates.

You will not use this class directly, but rather generate your own descendant by defining a login service in your RODL file.

Location


 

constructor

Creates a new instance of the BaseLoginService class.

 

constructor

 

BaseLoginService()

 

Sub New()

constructor (ISessionManager)

Creates a new instance of the BaseLoginService class and sets the provided ISessionManager instance as session provider.

This constructor should be used when the service instance should use session manager other than one globally registered in the server application.

 

constructor(sessionManager: ISessionManager)

 

BaseLoginService(ISessionManager sessionManager)

 

Sub New(sessionManager As ISessionManager)

Parameters:

  • sessionManager: Custom Session Manager instance

Creates a new instance of the BaseLoginService class and sets the provided session provider and event sink manager.

This constructor should be used when the service instance should use session manager or event sink manager other than ones globally registered in the server application.

 

constructor(sessionManager: ISessionManager; eventManager: IEventSinkManager)

 

BaseLoginService(ISessionManager sessionManager, IEventSinkManager eventManager)

 

Sub New(sessionManager As ISessionManager, eventManager As IEventSinkManager)

Parameters:

  • sessionManager: Custom Session Manager instance
  • eventManager: Custom Event manager instance

Activate    (declared in Service)

 

method Activate(clientId: Guid; enforceSessionCheck: Boolean; roles: nullable array of String)

 

void Activate(Guid clientId, Boolean enforceSessionCheck, String[]? roles)

 

Sub Activate(clientId As Guid, enforceSessionCheck As Boolean, roles As String()?)

Parameters:

  • clientId:
  • enforceSessionCheck:
  • roles:

AfterActivate    (declared in Service)

This event is raised after the service instance has been activated. This event can be used to perform additional service initialization tasks.

 

event AfterActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterActivate()

 

Event AfterActivate As EventHandler<ServiceActivationEventArgs>

AfterDeactivate    (declared in Service)

This event is raised after the service instance has been deactivated. This event can be used to perform additional cleanup tasks.

 

event AfterDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterDeactivate()

 

Event AfterDeactivate As EventHandler<ServiceActivationEventArgs>

BeforeActivate    (declared in Service)

This event is raised before the service instance will be activated. This event can be used to check additional service activation conditions.

 

event BeforeActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeActivate()

 

Event BeforeActivate As EventHandler<ServiceActivationEventArgs>

BeforeDeactivate    (declared in Service)

This event is raised before the service instance will be deactivated. This event can be used to perform additional cleanup tasks.

 

event BeforeDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeDeactivate()

 

Event BeforeDeactivate As EventHandler<ServiceActivationEventArgs>

CanBeDisposed    (declared in Service)

Get a flag indicating whether the current service instance can be disposed after servicing the request.

 

property CanBeDisposed: Boolean read;

 

Boolean CanBeDisposed { get; }

 

ReadOnly Property CanBeDisposed() As Boolean

Deactivate    (declared in Service)

Deactivates the service instance.

This method raises the Service and Service events and releases the service session.

 

method Deactivate(clientId: Guid)

 

void Deactivate(Guid clientId)

 

Sub Deactivate(clientId As Guid)

Parameters:

  • clientId: Session Id

DestroySession  protected    (declared in Service)

Destroys and disposes the current session.

This method is widely used in the login services to destroy the user session after logout or in case the login attempt was not successful.

 

method DestroySession

 

void DestroySession()

 

Sub DestroySession()

EventSinkManager  protected    (declared in Service)

Provides access to the event sink manager that should be used by the service methods.

 

property EventSinkManager: IEventSinkManager read;

 

IEventSinkManager EventSinkManager { get; }

 

ReadOnly Property EventSinkManager() As IEventSinkManager

GetEventSink (Type): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface.

 

method GetEventSink(eventSink: Type): IROEventSink

 

IROEventSink GetEventSink(Type eventSink)

 

Function GetEventSink(eventSink As Type) As IROEventSink

Parameters:

  • eventSink: Event sink type

GetEventSink (Type, IEventTargets): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface. This method allows to manage the event recipients.

 

method GetEventSink(eventSink: Type; eventTargets: IEventTargets): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, IEventTargets eventTargets)

 

Function GetEventSink(eventSink As Type, eventTargets As IEventTargets) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • eventTargets: Event recepients

GetEventSink (Type, array of Guid): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface. This method allows to set the event recipients.

 

method GetEventSink(eventSink: Type; recipients: array of Guid): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, Guid[] recipients)

 

Function GetEventSink(eventSink As Type, recipients As Guid()) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • recipients: Event recipients

GetEventSink<T>    (declared in Service)

 

method GetEventSink<T>: T

 

T GetEventSink<T>()

 

Function GetEventSink<T>() As T

GetEventSink<T> (IEventTargets): T    (declared in Service)

 

method GetEventSink<T>(eventTargets: IEventTargets): T

 

T GetEventSink<T>(IEventTargets eventTargets)

 

Function GetEventSink<T>(eventTargets As IEventTargets) As T

Parameters:

  • eventTargets:

GetEventSink<T> (array of Guid): T    (declared in Service)

 

method GetEventSink<T>(recipients: array of Guid): T

 

T GetEventSink<T>(Guid[] recipients)

 

Function GetEventSink<T>(recipients As Guid()) As T

Parameters:

  • recipients:

GetSession  protected    (declared in Service)

Gets the service session. Unlike the Service property this method returns null instead of throwing an exception in case the Service is not set.

 

method GetSession: ISession

 

ISession GetSession()

 

Function GetSession() As ISession

HasSession    (declared in Service)

Gets a flag indicating whether a session is accessible (ie Service is set and the session itself exists for the current remote client)

 

property HasSession: Boolean read;

 

Boolean HasSession { get; }

 

ReadOnly Property HasSession() As Boolean

IsActive    (declared in Service)

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

ReadOnly Property IsActive() As Boolean

LoginEx

 

method LoginEx(loginString: String): Boolean

 

Boolean LoginEx(String loginString)

 

Function LoginEx(loginString As String) As Boolean

Parameters:

  • loginString:

Logout

 

method Logout

 

void Logout()

 

Sub Logout()

RequireSession    (declared in Service)

Gets or sets a flag ingicating wheter accessing this service methods remotely requres an existing session.

 

property RequireSession: Boolean read write;

 

Boolean RequireSession { get; set; }

 

Property RequireSession() As Boolean

Roles    (declared in Service)

 

property Roles: array of String read write;

 

String[] Roles { get; set; }

 

Property Roles() As String()

ServerChannel    (declared in Service)

Gets a IServerChannelInfo instance providing information about the server channel used to call the service method remotely.

 

property ServerChannel: IServerChannelInfo read;

 

IServerChannelInfo ServerChannel { get; }

 

ReadOnly Property ServerChannel() As IServerChannelInfo

ServiceActivationException    (declared in Service)

 

event ServiceActivationException: EventHandler<ServiceActivationExceptionEventArgs>;

 

delegate EventHandler<ServiceActivationExceptionEventArgs> ServiceActivationException()

 

Event ServiceActivationException As EventHandler<ServiceActivationExceptionEventArgs>

ServiceMethodException    (declared in Service)

 

event ServiceMethodException: EventHandler<ServiceMethodExceptionEventArgs>;

 

delegate EventHandler<ServiceMethodExceptionEventArgs> ServiceMethodException()

 

Event ServiceMethodException As EventHandler<ServiceMethodExceptionEventArgs>

ServiceValidateRoles    (declared in Service)

Validates the service roles. This method is used by the service invoker methods to validate the server access roles.

See the IRolesAwareService interface description for more details.

 

method ServiceValidateRoles(requiredRoles: array of String)

 

void ServiceValidateRoles(String[] requiredRoles)

 

Sub ServiceValidateRoles(requiredRoles As String())

Parameters:

  • requiredRoles: Required service roles

Session    (declared in Service)

Provides access to the Session for the current remote client. In case when session doesn't exist for the current client yet, a new session will be created when the Session property is accessed (but not before).

 

property Session: ISession read write;

 

ISession Session { get; set; }

 

Property Session() As ISession

SessionID    (declared in Service)

Gets the Session ID (aka remote client Id) for the request that is currently being executed.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

ReadOnly Property SessionID() As Guid

SessionManager  protected    (declared in Service)

Provides access to the session manager that is used by the service.

 

property SessionManager: ISessionManager read;

 

ISessionManager SessionManager { get; }

 

ReadOnly Property SessionManager() As ISessionManager

SubscribeClientEventSink    (declared in Service)

This method registers the current client as receiver of the provided events type.

 

method SubscribeClientEventSink(eventSink: Type)

 

void SubscribeClientEventSink(Type eventSink)

 

Sub SubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

TriggerAfterActivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerAfterActivate(sessionId: Guid)

 

void TriggerAfterActivate(Guid sessionId)

 

Sub TriggerAfterActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerAfterDeactivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerAfterDeactivate(sessionId: Guid)

 

void TriggerAfterDeactivate(Guid sessionId)

 

Sub TriggerAfterDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeActivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerBeforeActivate(sessionId: Guid)

 

void TriggerBeforeActivate(Guid sessionId)

 

Sub TriggerBeforeActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeDeactivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerBeforeDeactivate(sessionId: Guid)

 

void TriggerBeforeDeactivate(Guid sessionId)

 

Sub TriggerBeforeDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerValidateRoles  protected    (declared in Service)

Raises the Service event and returns the roles check result.

 

method TriggerValidateRoles(roles: array of String; allowByDefault: Boolean): Boolean

 

Boolean TriggerValidateRoles(String[] roles, Boolean allowByDefault)

 

Function TriggerValidateRoles(roles As String(), allowByDefault As Boolean) As Boolean

Parameters:

  • roles: Required servcie roles
  • allowByDefault: Default result returned when there are no event handlers for the Service event

UnsubscribeClientEventSink    (declared in Service)

This method unregisters the current client as receiver of the any events.

 

method UnsubscribeClientEventSink

 

void UnsubscribeClientEventSink()

 

Sub UnsubscribeClientEventSink()

UnsubscribeClientEventSink (Type)    (declared in Service)

This method unregisters the current client as receiver of the provided events type.

 

method UnsubscribeClientEventSink(eventSink: Type)

 

void UnsubscribeClientEventSink(Type eventSink)

 

Sub UnsubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

ValidateRoles    (declared in Service)

This event is triggered for methods that have roles set and can be used to override the default roles check procedure.

 

event ValidateRoles: EventHandler<ValidateRolesEventArgs>;

 

delegate EventHandler<ValidateRolesEventArgs> ValidateRoles()

 

Event ValidateRoles As EventHandler<ValidateRolesEventArgs>

 

CanBeDisposed    (declared in Service)

Get a flag indicating whether the current service instance can be disposed after servicing the request.

 

property CanBeDisposed: Boolean read;

 

Boolean CanBeDisposed { get; }

 

ReadOnly Property CanBeDisposed() As Boolean

EventSinkManager  protected    (declared in Service)

Provides access to the event sink manager that should be used by the service methods.

 

property EventSinkManager: IEventSinkManager read;

 

IEventSinkManager EventSinkManager { get; }

 

ReadOnly Property EventSinkManager() As IEventSinkManager

HasSession    (declared in Service)

Gets a flag indicating whether a session is accessible (ie Service is set and the session itself exists for the current remote client)

 

property HasSession: Boolean read;

 

Boolean HasSession { get; }

 

ReadOnly Property HasSession() As Boolean

IsActive    (declared in Service)

 

property IsActive: Boolean read;

 

Boolean IsActive { get; }

 

ReadOnly Property IsActive() As Boolean

RequireSession    (declared in Service)

Gets or sets a flag ingicating wheter accessing this service methods remotely requres an existing session.

 

property RequireSession: Boolean read write;

 

Boolean RequireSession { get; set; }

 

Property RequireSession() As Boolean

Roles    (declared in Service)

 

property Roles: array of String read write;

 

String[] Roles { get; set; }

 

Property Roles() As String()

ServerChannel    (declared in Service)

Gets a IServerChannelInfo instance providing information about the server channel used to call the service method remotely.

 

property ServerChannel: IServerChannelInfo read;

 

IServerChannelInfo ServerChannel { get; }

 

ReadOnly Property ServerChannel() As IServerChannelInfo

Session    (declared in Service)

Provides access to the Session for the current remote client. In case when session doesn't exist for the current client yet, a new session will be created when the Session property is accessed (but not before).

 

property Session: ISession read write;

 

ISession Session { get; set; }

 

Property Session() As ISession

SessionID    (declared in Service)

Gets the Session ID (aka remote client Id) for the request that is currently being executed.

 

property SessionID: Guid read;

 

Guid SessionID { get; }

 

ReadOnly Property SessionID() As Guid

SessionManager  protected    (declared in Service)

Provides access to the session manager that is used by the service.

 

property SessionManager: ISessionManager read;

 

ISessionManager SessionManager { get; }

 

ReadOnly Property SessionManager() As ISessionManager

 

constructor

Creates a new instance of the BaseLoginService class.

 

constructor

 

BaseLoginService()

 

Sub New()

constructor (ISessionManager)

Creates a new instance of the BaseLoginService class and sets the provided ISessionManager instance as session provider.

This constructor should be used when the service instance should use session manager other than one globally registered in the server application.

 

constructor(sessionManager: ISessionManager)

 

BaseLoginService(ISessionManager sessionManager)

 

Sub New(sessionManager As ISessionManager)

Parameters:

  • sessionManager: Custom Session Manager instance

Creates a new instance of the BaseLoginService class and sets the provided session provider and event sink manager.

This constructor should be used when the service instance should use session manager or event sink manager other than ones globally registered in the server application.

 

constructor(sessionManager: ISessionManager; eventManager: IEventSinkManager)

 

BaseLoginService(ISessionManager sessionManager, IEventSinkManager eventManager)

 

Sub New(sessionManager As ISessionManager, eventManager As IEventSinkManager)

Parameters:

  • sessionManager: Custom Session Manager instance
  • eventManager: Custom Event manager instance

Activate    (declared in Service)

 

method Activate(clientId: Guid; enforceSessionCheck: Boolean; roles: nullable array of String)

 

void Activate(Guid clientId, Boolean enforceSessionCheck, String[]? roles)

 

Sub Activate(clientId As Guid, enforceSessionCheck As Boolean, roles As String()?)

Parameters:

  • clientId:
  • enforceSessionCheck:
  • roles:

Deactivate    (declared in Service)

Deactivates the service instance.

This method raises the Service and Service events and releases the service session.

 

method Deactivate(clientId: Guid)

 

void Deactivate(Guid clientId)

 

Sub Deactivate(clientId As Guid)

Parameters:

  • clientId: Session Id

DestroySession  protected    (declared in Service)

Destroys and disposes the current session.

This method is widely used in the login services to destroy the user session after logout or in case the login attempt was not successful.

 

method DestroySession

 

void DestroySession()

 

Sub DestroySession()

GetEventSink (Type): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface.

 

method GetEventSink(eventSink: Type): IROEventSink

 

IROEventSink GetEventSink(Type eventSink)

 

Function GetEventSink(eventSink As Type) As IROEventSink

Parameters:

  • eventSink: Event sink type

GetEventSink (Type, IEventTargets): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface. This method allows to manage the event recipients.

 

method GetEventSink(eventSink: Type; eventTargets: IEventTargets): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, IEventTargets eventTargets)

 

Function GetEventSink(eventSink As Type, eventTargets As IEventTargets) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • eventTargets: Event recepients

GetEventSink (Type, array of Guid): IROEventSink    (declared in Service)

Obtains an event sink proxy for the specified interface. This method allows to set the event recipients.

 

method GetEventSink(eventSink: Type; recipients: array of Guid): IROEventSink

 

IROEventSink GetEventSink(Type eventSink, Guid[] recipients)

 

Function GetEventSink(eventSink As Type, recipients As Guid()) As IROEventSink

Parameters:

  • eventSink: Event sink type
  • recipients: Event recipients

GetEventSink<T>    (declared in Service)

 

method GetEventSink<T>: T

 

T GetEventSink<T>()

 

Function GetEventSink<T>() As T

GetEventSink<T> (IEventTargets): T    (declared in Service)

 

method GetEventSink<T>(eventTargets: IEventTargets): T

 

T GetEventSink<T>(IEventTargets eventTargets)

 

Function GetEventSink<T>(eventTargets As IEventTargets) As T

Parameters:

  • eventTargets:

GetEventSink<T> (array of Guid): T    (declared in Service)

 

method GetEventSink<T>(recipients: array of Guid): T

 

T GetEventSink<T>(Guid[] recipients)

 

Function GetEventSink<T>(recipients As Guid()) As T

Parameters:

  • recipients:

GetSession  protected    (declared in Service)

Gets the service session. Unlike the Service property this method returns null instead of throwing an exception in case the Service is not set.

 

method GetSession: ISession

 

ISession GetSession()

 

Function GetSession() As ISession

LoginEx

 

method LoginEx(loginString: String): Boolean

 

Boolean LoginEx(String loginString)

 

Function LoginEx(loginString As String) As Boolean

Parameters:

  • loginString:

Logout

 

method Logout

 

void Logout()

 

Sub Logout()

ServiceValidateRoles    (declared in Service)

Validates the service roles. This method is used by the service invoker methods to validate the server access roles.

See the IRolesAwareService interface description for more details.

 

method ServiceValidateRoles(requiredRoles: array of String)

 

void ServiceValidateRoles(String[] requiredRoles)

 

Sub ServiceValidateRoles(requiredRoles As String())

Parameters:

  • requiredRoles: Required service roles

SubscribeClientEventSink    (declared in Service)

This method registers the current client as receiver of the provided events type.

 

method SubscribeClientEventSink(eventSink: Type)

 

void SubscribeClientEventSink(Type eventSink)

 

Sub SubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

TriggerAfterActivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerAfterActivate(sessionId: Guid)

 

void TriggerAfterActivate(Guid sessionId)

 

Sub TriggerAfterActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerAfterDeactivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerAfterDeactivate(sessionId: Guid)

 

void TriggerAfterDeactivate(Guid sessionId)

 

Sub TriggerAfterDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeActivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerBeforeActivate(sessionId: Guid)

 

void TriggerBeforeActivate(Guid sessionId)

 

Sub TriggerBeforeActivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerBeforeDeactivate  protected    (declared in Service)

Raises the Service event.

 

method TriggerBeforeDeactivate(sessionId: Guid)

 

void TriggerBeforeDeactivate(Guid sessionId)

 

Sub TriggerBeforeDeactivate(sessionId As Guid)

Parameters:

  • sessionId: Session Id

TriggerValidateRoles  protected    (declared in Service)

Raises the Service event and returns the roles check result.

 

method TriggerValidateRoles(roles: array of String; allowByDefault: Boolean): Boolean

 

Boolean TriggerValidateRoles(String[] roles, Boolean allowByDefault)

 

Function TriggerValidateRoles(roles As String(), allowByDefault As Boolean) As Boolean

Parameters:

  • roles: Required servcie roles
  • allowByDefault: Default result returned when there are no event handlers for the Service event

UnsubscribeClientEventSink    (declared in Service)

This method unregisters the current client as receiver of the any events.

 

method UnsubscribeClientEventSink

 

void UnsubscribeClientEventSink()

 

Sub UnsubscribeClientEventSink()

UnsubscribeClientEventSink (Type)    (declared in Service)

This method unregisters the current client as receiver of the provided events type.

 

method UnsubscribeClientEventSink(eventSink: Type)

 

void UnsubscribeClientEventSink(Type eventSink)

 

Sub UnsubscribeClientEventSink(eventSink As Type)

Parameters:

  • eventSink: Event sink type

 

AfterActivate    (declared in Service)

This event is raised after the service instance has been activated. This event can be used to perform additional service initialization tasks.

 

event AfterActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterActivate()

 

Event AfterActivate As EventHandler<ServiceActivationEventArgs>

AfterDeactivate    (declared in Service)

This event is raised after the service instance has been deactivated. This event can be used to perform additional cleanup tasks.

 

event AfterDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> AfterDeactivate()

 

Event AfterDeactivate As EventHandler<ServiceActivationEventArgs>

BeforeActivate    (declared in Service)

This event is raised before the service instance will be activated. This event can be used to check additional service activation conditions.

 

event BeforeActivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeActivate()

 

Event BeforeActivate As EventHandler<ServiceActivationEventArgs>

BeforeDeactivate    (declared in Service)

This event is raised before the service instance will be deactivated. This event can be used to perform additional cleanup tasks.

 

event BeforeDeactivate: EventHandler<ServiceActivationEventArgs>;

 

delegate EventHandler<ServiceActivationEventArgs> BeforeDeactivate()

 

Event BeforeDeactivate As EventHandler<ServiceActivationEventArgs>

ServiceActivationException    (declared in Service)

 

event ServiceActivationException: EventHandler<ServiceActivationExceptionEventArgs>;

 

delegate EventHandler<ServiceActivationExceptionEventArgs> ServiceActivationException()

 

Event ServiceActivationException As EventHandler<ServiceActivationExceptionEventArgs>

ServiceMethodException    (declared in Service)

 

event ServiceMethodException: EventHandler<ServiceMethodExceptionEventArgs>;

 

delegate EventHandler<ServiceMethodExceptionEventArgs> ServiceMethodException()

 

Event ServiceMethodException As EventHandler<ServiceMethodExceptionEventArgs>

ValidateRoles    (declared in Service)

This event is triggered for methods that have roles set and can be used to override the default roles check procedure.

 

event ValidateRoles: EventHandler<ValidateRolesEventArgs>;

 

delegate EventHandler<ValidateRolesEventArgs> ValidateRoles()

 

Event ValidateRoles As EventHandler<ValidateRolesEventArgs>