TMultiDbLoginService

Overview

Implements the base service for user authentication with the IMultiDbLoginService interface, which allows the user to specify a database connection name as part of the login.

A service of this type will be automatically created for you when you select the MultiDb Login template when starting a new project.

Location


 

constructor Create  override    (declared in TBaseLoginService)

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

AcquireConnection    (declared in TBaseDataAbstractService)

property AcquireConnection: Boolean read write

AfterAcquireConnection    (declared in TBaseDataAbstractService)

property AfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure AfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

AfterReleaseConnection    (declared in TBaseDataAbstractService)

property AfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure AfterReleaseConnection(aSender: TObject; const aConnectionName: string)

AllowCustomSqlMacros  protected    (declared in TBaseDataAbstractService)

property AllowCustomSqlMacros: Boolean read write

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: Boolean

Assign  override

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

BeforeAcquireConnection    (declared in TBaseDataAbstractService)

property BeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure BeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

BeforeReleaseConnection    (declared in TBaseDataAbstractService)

property BeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure BeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

CheckForConnectionManager    (declared in TBaseDataAbstractService)

procedure CheckForConnectionManager

CheckProperties

Validates the service properties.

procedure CheckProperties

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TBaseDataAbstractService)

property Connection: IDAConnection read write

ConnectionManager

Sets the TDAConnectionManager component that defines the connection or connections.

property ConnectionManager: TDAConnectionManager read write

ConnectionName    (declared in TBaseDataAbstractService)

property ConnectionName: string read write

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): Boolean

Parameters:

  • aMessage: Message

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoOnDeactivate  protected override    (declared in TBaseDataAbstractService)

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID:

DoOnUnknownIdentifier  protected virtual    (declared in TBaseDataAbstractService)

function DoOnUnknownIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

Parameters:

  • Sender:
  • Name:
  • OrgName:
  • Value:

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

GetConnectionNames  protected virtual

Gets the names of the connections defined in the default ConnectionManager instance.

function GetConnectionNames: StringArray

GetDefaultConnectionName  protected virtual

Gets the default connection name.

function GetDefaultConnectionName: ROUTF8string

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): Integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetServiceSchema  protected virtual    (declared in TBaseDataAbstractService)

function GetServiceSchema: TDASchema

HETConnection  protected    (declared in TBaseDataAbstractService)

property HETConnection: IDAHETConnection read write

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): Boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: Boolean read write

Login  protected virtual

This method performs user authentication based on the provided credentials. It returns true if the user was successully authenticated and false otherwise.

function Login(const aUserID: ROUTF8String; const aPassword: ROUTF8String; const aConnectionName: ROUTF8String; out aUserInfo: UserInfo): Boolean

Parameters:

  • aUserID: User name
  • aPassword: User password
  • aConnectionName: Default connection name.
  • aUserInfo: Variable of UserInfo type that will contain additional information about the logged in user.

LoginEx  protected override

Provides the actual login procedure.

function LoginEx(const aLoginString: ROUTF8String): Boolean

Parameters:

  • aLoginString: String that contains the connection name, user name and password

Logout  protected    (declared in TBaseLoginService)

This method performs the log out.

procedure Logout

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: Boolean read write

Notification  protected override    (declared in TBaseDataAbstractService)

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent:
  • Operation:

OnAcquireConnectionFailure    (declared in TBaseDataAbstractService)

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TBaseDataAbstractService)

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterReleaseConnection    (declared in TBaseDataAbstractService)

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TBaseDataAbstractService)

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TBaseDataAbstractService)

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnLogin

Implement this event handler to provide the actual login procedure. Ideally this method should:

  • Validate the passed login credentials
  • Create a new session if login is considered successful
  • Validate the passed connection name and store it in the session
  • Fill the outgoing UserInfo class with any information that should be sent back to the client Skeleton code for of event handler automatically created for you when you select the MultiDb Login template when starting a new project.
property OnLogin: TMultiDbLoginEvent read write
delegate: procedure OnLogin(Sender: TObject; const aUserID: ROUTF8String; const aPassword: ROUTF8String; const aConnectionName: ROUTF8String; out aUserInfo: UserInfo; var aLoginSuccessful: boolean)

OnLogout    (declared in TBaseLoginService)

Implement this event handler to provide the actual logout procedure.

property OnLogout: TNotifyEvent read write

OnUnknownMacroVariable    (declared in TBaseDataAbstractService)

property OnUnknownMacroVariable: TOnUnknownIdentifier read write
delegate: function OnUnknownMacroVariable(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUnknownSqlMacroIdentifier    (declared in TBaseDataAbstractService)

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: Integer read write

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

ReleaseConnection    (declared in TBaseDataAbstractService)

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: Boolean read write

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ServiceSchema    (declared in TBaseDataAbstractService)

property ServiceSchema: TDASchema read write

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read write

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

SetConnection  deprecated    (declared in TBaseDataAbstractService)

procedure SetConnection(aConnection: IDAConnection)

Parameters:

  • aConnection:

Synchronize  protected    (declared in TRORemoteDataModule)

procedure Synchronize(aMethod: TThreadMethod)

Parameters:

  • aMethod:

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read write

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

 

AcquireConnection    (declared in TBaseDataAbstractService)

property AcquireConnection: Boolean read write

AllowCustomSqlMacros  protected    (declared in TBaseDataAbstractService)

property AllowCustomSqlMacros: Boolean read write

ClientID    (declared in TRORemoteDataModule)

The unique identifier for the client connected to the service. It is equal to the session ID if the session already exists. When the service method is called, this property is already initialized with a proper value. Do not change it unless you know what you are doing!

property ClientID: TGUID read write

Connection    (declared in TBaseDataAbstractService)

property Connection: IDAConnection read write

ConnectionManager

Sets the TDAConnectionManager component that defines the connection or connections.

property ConnectionManager: TDAConnectionManager read write

ConnectionName    (declared in TBaseDataAbstractService)

property ConnectionName: string read write

EventRepository    (declared in TRORemoteDataModule)

Points to the event repository (TROEventRepository instance) for the service. The value must be set to use the events feature.

property EventRepository: TROEventRepository read write

HETConnection  protected    (declared in TBaseDataAbstractService)

property HETConnection: IDAHETConnection read write

LegacyEvents    (declared in TRORemoteDataModule)

Enables or disables the legacy events mode for the service. The default value is true. The legacy mode is less secure and it is recommended to set this property to false for new projects. Note that refusing to use the legacy mode will break compatibility with legacy Delphi clients.

property LegacyEvents: Boolean read write

NewSession    (declared in TRORemoteDataModule)

Indicates that the client's session was just created, i.e. this indicates the first connection of a so far unknown client.

property NewSession: Boolean read write

RefCount    (declared in TRORemoteDataModule)

Reference counter - this class is the interfaced object.

property RefCount: Integer read write

RequiresSession    (declared in TRORemoteDataModule)

This property should be set to true (perhaps with the designer) to make the service protected and to disallow unauthenticated clients to call its methods. Read more.

property RequiresSession: Boolean read write

ServiceSchema    (declared in TBaseDataAbstractService)

property ServiceSchema: TDASchema read write

Session    (declared in TRORemoteDataModule)

Provides access to the session object of the current connection. If the session does not exist, it is created at the moment of property access.

property Session: TROSession read write

SessionManager    (declared in TRORemoteDataModule)

Points to the session manager to use. It is necessary to assign the session manager if the protected service is being developed and/or it is necessary to use the events feature.

property SessionManager: TROCustomSessionManager read write

Transport    (declared in TRORemoteDataModule)

Provides access to the transport object that processes the current network (or other) connection to the server. Various information, such as client IP address, can be available via the transport objects.

property Transport: IROTransport read write

 

constructor Create  override    (declared in TBaseLoginService)

constructor Create(aOwner: TComponent)

Parameters:

  • aOwner:

AllowRemoteEventsRegistration  protected    (declared in TRORemoteDataModule)

Obsolete, replaced by the LegacyEvents property.

function AllowRemoteEventsRegistration: Boolean

Assign  override

procedure Assign(Source: TPersistent)

Parameters:

  • Source:

CheckForConnectionManager    (declared in TBaseDataAbstractService)

procedure CheckForConnectionManager

CheckProperties

Validates the service properties.

procedure CheckProperties

CreateSession    (declared in TRORemoteDataModule)

Creates a new session object and makes it available via the Session property. As a rule, there is no need to call this method because the session is created automatically when required.

procedure CreateSession

CustomRequireSession  protected virtual    (declared in TRORemoteDataModule)

Internal use only, don't override.

function CustomRequireSession(const aMessage: IROMessage): Boolean

Parameters:

  • aMessage: Message

DestroySession    (declared in TRORemoteDataModule)

Destroys the current session object. This method is primarily used to destroy the session in case of unsuccessful client authentication.

procedure DestroySession

DoOnDeactivate  protected override    (declared in TBaseDataAbstractService)

procedure DoOnDeactivate(aClientID: TGUID)

Parameters:

  • aClientID:

DoOnUnknownIdentifier  protected virtual    (declared in TBaseDataAbstractService)

function DoOnUnknownIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

Parameters:

  • Sender:
  • Name:
  • OrgName:
  • Value:

GetConnectionNames  protected virtual

Gets the names of the connections defined in the default ConnectionManager instance.

function GetConnectionNames: StringArray

GetDefaultConnectionName  protected virtual

Gets the default connection name.

function GetDefaultConnectionName: ROUTF8string

GetDispatchInfo  protected virtual    (declared in TRORemoteDataModule)

Allows to grab the input parameters to get all information about the upcoming call including the remote method parameters and the calling client transport object.

procedure GetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

Parameters:

  • aTransport: Points to the transport object containing connection-specific information
  • aMessage: Message that needs to be processed

GetEventsData  protected    (declared in TRORemoteDataModule)

Collects events data to the memory stream. For internal use only, don't call or override.

function GetEventsData(const ClientID: string; out EventsData: Binary): Integer

Parameters:

  • ClientID: Client ID
  • EventsData: Binary stream that holds the event data

GetServiceSchema  protected virtual    (declared in TBaseDataAbstractService)

function GetServiceSchema: TDASchema

IsRetained  protected    (declared in TRORemoteDataModule)

Returns true if anObject is retained by Self.

function IsRetained(const anObject: TObject): Boolean

Parameters:

  • anObject: Object to check

IsSessionPresent    (declared in TRORemoteDataModule)

Checks if session is present

function IsSessionPresent: Boolean

Login  protected virtual

This method performs user authentication based on the provided credentials. It returns true if the user was successully authenticated and false otherwise.

function Login(const aUserID: ROUTF8String; const aPassword: ROUTF8String; const aConnectionName: ROUTF8String; out aUserInfo: UserInfo): Boolean

Parameters:

  • aUserID: User name
  • aPassword: User password
  • aConnectionName: Default connection name.
  • aUserInfo: Variable of UserInfo type that will contain additional information about the logged in user.

LoginEx  protected override

Provides the actual login procedure.

function LoginEx(const aLoginString: ROUTF8String): Boolean

Parameters:

  • aLoginString: String that contains the connection name, user name and password

Logout  protected    (declared in TBaseLoginService)

This method performs the log out.

procedure Logout

Notification  protected override    (declared in TBaseDataAbstractService)

procedure Notification(AComponent: TComponent; Operation: TOperation)

Parameters:

  • AComponent:
  • Operation:

RegisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession: Client session
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

RegisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

Registers the client to receive server callback events of the specified type.

procedure RegisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to subscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to subscribe the client to.

ReleaseConnection    (declared in TBaseDataAbstractService)

procedure ReleaseConnection

ReleaseObject  protected    (declared in TRORemoteDataModule)

Takes away the hold of anObject set by RetainObject.

procedure ReleaseObject(const anObject: TObject)

Parameters:

  • anObject: Object to release

RetainObject  protected    (declared in TRORemoteDataModule)

Sets the hold of anObject.

procedure RetainObject(const anObject: TObject)

Parameters:

  • anObject: Object to hold

ServiceValidateRoles  protected    (declared in TRORemoteDataModule)

Validates roles.

procedure ServiceValidateRoles(aRequiredRoles: array of string)

Parameters:

  • aRequiredRoles: Roles

SetConnection  deprecated    (declared in TBaseDataAbstractService)

procedure SetConnection(aConnection: IDAConnection)

Parameters:

  • aConnection:

Synchronize  protected    (declared in TRORemoteDataModule)

procedure Synchronize(aMethod: TThreadMethod)

Parameters:

  • aMethod:

UnregisterEventClient (TROSession, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const aSession: TROSession; const EventTypes: string)

Parameters:

  • aSession:
  • EventTypes:

UnregisterEventClient (string, string)  protected overload    (declared in TRORemoteDataModule)

The action is opposite to RegisterEventClient, it cancels the subscription. Unregistration is not absolutely necessary as the client session dies after some time of inactivity but allows to conserve some system resources.

procedure UnregisterEventClient(const ClientID: string; const EventTypes: string)

Parameters:

  • ClientID: Client identifier to unsubscribe
  • EventTypes: Identifier (GUID) of the event sink containing the events to unsubscribe the client from.

UnregisterEventClient (TGUID, string)  protected overload    (declared in TRORemoteDataModule)

procedure UnregisterEventClient(const ClientID: TGUID; const EventTypes: string)

Parameters:

  • ClientID:
  • EventTypes:

 

AfterAcquireConnection    (declared in TBaseDataAbstractService)

property AfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure AfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

AfterReleaseConnection    (declared in TBaseDataAbstractService)

property AfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure AfterReleaseConnection(aSender: TObject; const aConnectionName: string)

BeforeAcquireConnection    (declared in TBaseDataAbstractService)

property BeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure BeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

BeforeReleaseConnection    (declared in TBaseDataAbstractService)

property BeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure BeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAcquireConnectionFailure    (declared in TBaseDataAbstractService)

property OnAcquireConnectionFailure: TDAAcquireConnectionFailureEvent read write
delegate: procedure OnAcquireConnectionFailure(aSender: TObject; const aConnectionName: string; aError: Exception)

OnActivate    (declared in TRORemoteDataModule)

Called just after the service is created and before any service method is called. Handle this event for everything you need to do when the service instance is created.

property OnActivate: TActivateEvent read write
delegate: procedure OnActivate(const aClientID: TGUID; aSession: TROSession; const aMessage: IROMessage)

OnAfterAcquireConnection    (declared in TBaseDataAbstractService)

property OnAfterAcquireConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnAfterAcquireConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnAfterReleaseConnection    (declared in TBaseDataAbstractService)

property OnAfterReleaseConnection: TDAConnectionReleasedEvent read write
delegate: procedure OnAfterReleaseConnection(aSender: TObject; const aConnectionName: string)

OnBeforeAcquireConnection    (declared in TBaseDataAbstractService)

property OnBeforeAcquireConnection: TDAAcquireConnectionEvent read write
delegate: procedure OnBeforeAcquireConnection(aSender: TObject; var aConnectionName: string)

OnBeforeRegisterEventClient    (declared in TRORemoteDataModule)

Called when the new client is being registered to receive events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeRegisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeRegisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnBeforeReleaseConnection    (declared in TBaseDataAbstractService)

property OnBeforeReleaseConnection: TDAConnectionAcquiredEvent read write
delegate: procedure OnBeforeReleaseConnection(aSender: TObject; const aConnectionName: string; const aAcquiredConnection: IDAConnection)

OnBeforeUnregisterEventClient    (declared in TRORemoteDataModule)

Called when the client is being unsubscribed from events. Deprecated now, since remote event (un-)registration is forbidden (LegacyEvents = false).

property OnBeforeUnregisterEventClient: TRegisterEventClientEvent read write
delegate: procedure OnBeforeUnregisterEventClient(const aClientID: TGUID; const EventTypes: string)

OnDeactivate    (declared in TRORemoteDataModule)

Called after the service method completes and before the service instance is freed. Handle this event to perform actions on service destruction, such as disposing of resources.

property OnDeactivate: TDeactivateEvent read write
delegate: procedure OnDeactivate(const aClientID: TGUID; aSession: TROSession)

OnGetDispatchInfo    (declared in TRORemoteDataModule)

This event is fired before the invoker executes the service method. Handle this event to preview remote methods about to be executed; the input parameters allow to get all information about the upcoming call including the remote method parameters and the calling client transport object.

property OnGetDispatchInfo: TGetDispatchInfoEvent read write
delegate: procedure OnGetDispatchInfo(const aTransport: IROTransport; const aMessage: IROMessage)

OnLogin

Implement this event handler to provide the actual login procedure. Ideally this method should:

  • Validate the passed login credentials
  • Create a new session if login is considered successful
  • Validate the passed connection name and store it in the session
  • Fill the outgoing UserInfo class with any information that should be sent back to the client Skeleton code for of event handler automatically created for you when you select the MultiDb Login template when starting a new project.
property OnLogin: TMultiDbLoginEvent read write
delegate: procedure OnLogin(Sender: TObject; const aUserID: ROUTF8String; const aPassword: ROUTF8String; const aConnectionName: ROUTF8String; out aUserInfo: UserInfo; var aLoginSuccessful: boolean)

OnLogout    (declared in TBaseLoginService)

Implement this event handler to provide the actual logout procedure.

property OnLogout: TNotifyEvent read write

OnUnknownMacroVariable    (declared in TBaseDataAbstractService)

property OnUnknownMacroVariable: TOnUnknownIdentifier read write
delegate: function OnUnknownMacroVariable(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnUnknownSqlMacroIdentifier    (declared in TBaseDataAbstractService)

property OnUnknownSqlMacroIdentifier: TOnUnknownIdentifier read write
delegate: function OnUnknownSqlMacroIdentifier(Sender: TObject; const Name: string; const OrgName: string; var Value: string): Boolean

OnValidateRoles    (declared in TRORemoteDataModule)

Validates roles.

property OnValidateRoles: TValidateRolesEvent read write
delegate: procedure OnValidateRoles(aRoles: array of string; var aAllow: Boolean)