TROOlympiaEventRepository

Overview

The TROOlympiaEventRepository class implements an event repository that stores event data in the Olympia server. The Active property has to be set to true to activate the TROOlympiaEventRepository.

Location

Implements

 

constructor Create  override

Creates a new instance.

constructor Create(AOwner: TComponent)

Parameters:

  • AOwner: Owner.

Active

Activates the SessionManager and EventReceiver with the 'OlympiaEvents' event handler.

property Active: Boolean read write

AddActiveListener  override    (declared in TROInMemoryEventRepository)

Registers aSessionID as an event sink with an aActiveEventServer instance of the IROActiveEventServer as an event dispatcher.

function AddActiveListener(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer): boolean

Parameters:

  • aSessionID: Unique session GUID
  • aActiveEventServer: Custom event dispatcher

AddSession (TGUID)  overload    (declared in TROEventRepository)

Performs registration of a given session.

procedure AddSession(aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

AddSession (TGUID, IROActiveEventServer)  overload    (declared in TROEventRepository)

Performs registration of a given session and event dispatcher.

procedure AddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer)

Parameters:

  • aSessionID: Unique session GUID
  • aActiveEventServer: Custom event dispatcher

AddSession (TGUID, IROActiveEventServer, string)  overload    (declared in TROEventRepository)

Performs registration of a given session and event dispatcher.

procedure AddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aActiveEventServer: Custom event dispatcher
  • aEventSinkId: Event sink

AddSession (TGUID, string)  overload    (declared in TROEventRepository)

Performs registration of a given session.

procedure AddSession(aSessionID: TGUID; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

CheckProperties  override

Validates the event repository properties.

procedure CheckProperties

Critical  protected    (declared in TROInMemoryEventRepository)

Critical section

property Critical: TCriticalSection read write

DoAddSession (TGUID, IROActiveEventServer, string)  protected override

Performs registration of a given session and event dispatcher.

procedure DoAddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aActiveEventServer: Custom event dispatcher
  • aEventSinkId: Event sink

DoAddSession (TGUID, string)  protected overload virtual    (declared in TROEventRepository)

Performs registration of a given session.

procedure DoAddSession(aSessionID: TGUID; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

DoGetEventData  protected override

Retrieves data of an event for a given session.

function DoGetEventData(SessionID: TGUID; var TargetStream: TROBinaryMemoryStream): Integer

Parameters:

  • SessionID: Unique session GUID
  • TargetStream: Event data container

DoRemoveSession  protected override

Removes a given session from the list of registered sessions.

procedure DoRemoveSession(aSessionID: TGUID; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

DoStoreEventData  protected override

Stores event data from a given session.

procedure DoStoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string; const EventSinkId: string)

Parameters:

  • SourceSessionID: Unique session GUID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs
  • EventSinkId: Event sink

EventSucceeded  protected

Removes the given event message from the IOlympia singleton.

procedure EventSucceeded(aClientID: TGUID; aId: TGUID)

Parameters:

  • aClientID: Client ID
  • aId: Event message GUID

FindSession  protected    (declared in TROInMemoryEventRepository)

Finds session

function FindSession(aSessionID: TGUID): TROSessionReference

Parameters:

  • aSessionID: Session ID

GetEventData    (declared in TROEventRepository)

Implements IROEventRepository to retrieve data of an event for a given session via DoGetEventData.

function GetEventData(SessionID: TGUID; var TargetStream: TROBinaryMemoryStream): integer

Parameters:

  • SessionID: Session ID
  • TargetStream: Target stream

GetEventWriter    (declared in TROEventRepository)

Retrieves an event proxy registered by the generated RODL Files.

function GetEventWriter(const IID: TGUID): IROEventWriter

Parameters:

  • IID: GUID of the required interface

HaveMessage  protected

Creates a TRONamedEventData instance with the given EventID from Data and dispatches it for each active session in Targets.

procedure HaveMessage(const Targets: GuidArray; const EventID: string; const Data: TROBinaryMemoryStream)

Parameters:

  • Targets: Session list
  • EventID: Event message GUID
  • Data: Specified data that is related with the current event message

IsSessionPresentinSessionManager  protected    (declared in TROEventRepository)

Checks given session id in SessionManager

function IsSessionPresentinSessionManager(const aSessionID: TGUID): Boolean

Parameters:

  • aSessionID: Session ID.

Login  protected

If the Username is not empty, login to the IOlympia singleton is possible with the given Username and Password. If the Username is empty, the server channel is activated without username and password check.

procedure Login

Logout  protected

Delegates a call to the IOlympia singleton.

procedure Logout

Message    (declared in TROEventRepository)

The message format used to encode event data. This must match the message format used on the client-side TROEventReceiver.

property Message: TROMessage read write

OnAfterAddSession    (declared in TROEventRepository)

Fired by AddSession after addition.

property OnAfterAddSession: TROSessionEvent read write
delegate: procedure OnAfterAddSession(Sender: TROEventRepository; const SessionID: TGUID)

OnAfterRemoveSession    (declared in TROEventRepository)

Fired by RemoveSession after removing.

property OnAfterRemoveSession: TROSessionEvent read write
delegate: procedure OnAfterRemoveSession(Sender: TROEventRepository; const SessionID: TGUID)

OnBeforeAddSession    (declared in TROEventRepository)

Fired by AddSession before addition.

property OnBeforeAddSession: TROSessionEvent read write
delegate: procedure OnBeforeAddSession(Sender: TROEventRepository; const SessionID: TGUID)

OnBeforeRemoveSession    (declared in TROEventRepository)

Fired by RemoveSession before removing.

property OnBeforeRemoveSession: TROSessionEvent read write
delegate: procedure OnBeforeRemoveSession(Sender: TROEventRepository; const SessionID: TGUID)

Password

Used when Username is not empty. Username with Password is used to login to the IOlympia singleton. Valid Username/Password pairs are defined in the Olympia settings. See Olympia for more details.

property Password: string read write

RemoveSession (TGUID)  overload    (declared in TROEventRepository)

Removes a given session from the list of registered sessions.

procedure RemoveSession(aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

RemoveSession (TGUID, string)  overload    (declared in TROEventRepository)

Removes a given session from the list of registered sessions.

procedure RemoveSession(aSessionID: TGUID; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

RemoveSessionActiveListener  protected virtual    (declared in TROInMemoryEventRepository)

Removes session active listener.

procedure RemoveSessionActiveListener(Sender: TObject; aSessionID: TGUID)

Parameters:

  • Sender: Sender
  • aSessionID: Session ID

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

SessionIDs  protected    (declared in TROInMemoryEventRepository)

List of Session ID

property SessionIDs: TStringList read write

SessionManager

The session manager that maintains the server's user sessions. Remoting SDK events are tied to user sessions. Fired events are stored in the session until delivered to clients, while undelivered events expire and are discarded when the session expires. Therefore, to function, every Event Repository must have a session manager assigned.

property SessionManager: TROOlympiaSessionManager read write

SessionReferenceCount    (declared in TROInMemoryEventRepository)

Count of session references

property SessionReferenceCount: integer read write

SessionReferences    (declared in TROInMemoryEventRepository)

Returns session reference

property SessionReferences[Index: integer]: TROSessionReference read write

SessionsChangedNotification  protected    (declared in TROInMemoryEventRepository)

A callback that informs about events (TROSessionsActions) related to the aSessionID.

procedure SessionsChangedNotification(const aSessionID: TGUID; aSessionAction: TROSessionsActions; Sender: TObject)

Parameters:


StoreEventData (TGUID, TROBinaryMemoryStream, Boolean, Boolean, string)  overload    (declared in TROEventRepository)

Stores the provided event data in the repository.

procedure StoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string)

Parameters:

  • SourceSessionID: Session ID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs

StoreEventData (TGUID, TROBinaryMemoryStream, Boolean, Boolean, string, string)  overload    (declared in TROEventRepository)

Stores the provided event data in the repository.

procedure StoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string; const EventSinkId: string)

Parameters:

  • SourceSessionID: Session ID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs
  • EventSinkId: Event sink

Username

The Username with its Password is used to login to the IOlympia singleton.

property Username: string read write

 

Active

Activates the SessionManager and EventReceiver with the 'OlympiaEvents' event handler.

property Active: Boolean read write

Critical  protected    (declared in TROInMemoryEventRepository)

Critical section

property Critical: TCriticalSection read write

Message    (declared in TROEventRepository)

The message format used to encode event data. This must match the message format used on the client-side TROEventReceiver.

property Message: TROMessage read write

Password

Used when Username is not empty. Username with Password is used to login to the IOlympia singleton. Valid Username/Password pairs are defined in the Olympia settings. See Olympia for more details.

property Password: string read write

SessionIDs  protected    (declared in TROInMemoryEventRepository)

List of Session ID

property SessionIDs: TStringList read write

SessionManager

The session manager that maintains the server's user sessions. Remoting SDK events are tied to user sessions. Fired events are stored in the session until delivered to clients, while undelivered events expire and are discarded when the session expires. Therefore, to function, every Event Repository must have a session manager assigned.

property SessionManager: TROOlympiaSessionManager read write

SessionReferenceCount    (declared in TROInMemoryEventRepository)

Count of session references

property SessionReferenceCount: integer read write

SessionReferences    (declared in TROInMemoryEventRepository)

Returns session reference

property SessionReferences[Index: integer]: TROSessionReference read write

Username

The Username with its Password is used to login to the IOlympia singleton.

property Username: string read write

 

constructor Create  override

Creates a new instance.

constructor Create(AOwner: TComponent)

Parameters:

  • AOwner: Owner.

AddActiveListener  override    (declared in TROInMemoryEventRepository)

Registers aSessionID as an event sink with an aActiveEventServer instance of the IROActiveEventServer as an event dispatcher.

function AddActiveListener(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer): boolean

Parameters:

  • aSessionID: Unique session GUID
  • aActiveEventServer: Custom event dispatcher

AddSession (TGUID)  overload    (declared in TROEventRepository)

Performs registration of a given session.

procedure AddSession(aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

AddSession (TGUID, IROActiveEventServer)  overload    (declared in TROEventRepository)

Performs registration of a given session and event dispatcher.

procedure AddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer)

Parameters:

  • aSessionID: Unique session GUID
  • aActiveEventServer: Custom event dispatcher

AddSession (TGUID, IROActiveEventServer, string)  overload    (declared in TROEventRepository)

Performs registration of a given session and event dispatcher.

procedure AddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aActiveEventServer: Custom event dispatcher
  • aEventSinkId: Event sink

AddSession (TGUID, string)  overload    (declared in TROEventRepository)

Performs registration of a given session.

procedure AddSession(aSessionID: TGUID; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

Assign  override

Copies the contents of another, similar object.

procedure Assign(Source: TPersistent)

Parameters:

  • Source: Instance whose properties will be copied

CheckProperties  override

Validates the event repository properties.

procedure CheckProperties

DoAddSession (TGUID, IROActiveEventServer, string)  protected override

Performs registration of a given session and event dispatcher.

procedure DoAddSession(aSessionID: TGUID; aActiveEventServer: IROActiveEventServer; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aActiveEventServer: Custom event dispatcher
  • aEventSinkId: Event sink

DoAddSession (TGUID, string)  protected overload virtual    (declared in TROEventRepository)

Performs registration of a given session.

procedure DoAddSession(aSessionID: TGUID; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

DoGetEventData  protected override

Retrieves data of an event for a given session.

function DoGetEventData(SessionID: TGUID; var TargetStream: TROBinaryMemoryStream): Integer

Parameters:

  • SessionID: Unique session GUID
  • TargetStream: Event data container

DoRemoveSession  protected override

Removes a given session from the list of registered sessions.

procedure DoRemoveSession(aSessionID: TGUID; const aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

DoStoreEventData  protected override

Stores event data from a given session.

procedure DoStoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string; const EventSinkId: string)

Parameters:

  • SourceSessionID: Unique session GUID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs
  • EventSinkId: Event sink

EventSucceeded  protected

Removes the given event message from the IOlympia singleton.

procedure EventSucceeded(aClientID: TGUID; aId: TGUID)

Parameters:

  • aClientID: Client ID
  • aId: Event message GUID

FindSession  protected    (declared in TROInMemoryEventRepository)

Finds session

function FindSession(aSessionID: TGUID): TROSessionReference

Parameters:

  • aSessionID: Session ID

GetEventData    (declared in TROEventRepository)

Implements IROEventRepository to retrieve data of an event for a given session via DoGetEventData.

function GetEventData(SessionID: TGUID; var TargetStream: TROBinaryMemoryStream): integer

Parameters:

  • SessionID: Session ID
  • TargetStream: Target stream

GetEventWriter    (declared in TROEventRepository)

Retrieves an event proxy registered by the generated RODL Files.

function GetEventWriter(const IID: TGUID): IROEventWriter

Parameters:

  • IID: GUID of the required interface

HaveMessage  protected

Creates a TRONamedEventData instance with the given EventID from Data and dispatches it for each active session in Targets.

procedure HaveMessage(const Targets: GuidArray; const EventID: string; const Data: TROBinaryMemoryStream)

Parameters:

  • Targets: Session list
  • EventID: Event message GUID
  • Data: Specified data that is related with the current event message

IsSessionPresentinSessionManager  protected    (declared in TROEventRepository)

Checks given session id in SessionManager

function IsSessionPresentinSessionManager(const aSessionID: TGUID): Boolean

Parameters:

  • aSessionID: Session ID.

Login  protected

If the Username is not empty, login to the IOlympia singleton is possible with the given Username and Password. If the Username is empty, the server channel is activated without username and password check.

procedure Login

Logout  protected

Delegates a call to the IOlympia singleton.

procedure Logout

RemoveSession (TGUID)  overload    (declared in TROEventRepository)

Removes a given session from the list of registered sessions.

procedure RemoveSession(aSessionID: TGUID)

Parameters:

  • aSessionID: Session ID

RemoveSession (TGUID, string)  overload    (declared in TROEventRepository)

Removes a given session from the list of registered sessions.

procedure RemoveSession(aSessionID: TGUID; aEventSinkId: string)

Parameters:

  • aSessionID: Session ID
  • aEventSinkId: Event sink

RemoveSessionActiveListener  protected virtual    (declared in TROInMemoryEventRepository)

Removes session active listener.

procedure RemoveSessionActiveListener(Sender: TObject; aSessionID: TGUID)

Parameters:

  • Sender: Sender
  • aSessionID: Session ID

ROFreeNotification    (declared in TROComponent)

Forwards notification messages to all owned RO components.

procedure ROFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

RORemoveFreeNotification    (declared in TROComponent)

Disables destruction notification for specified RO component.

procedure RORemoveFreeNotification(AComponent: TComponent)

Parameters:

  • AComponent: component

SessionsChangedNotification  protected    (declared in TROInMemoryEventRepository)

A callback that informs about events (TROSessionsActions) related to the aSessionID.

procedure SessionsChangedNotification(const aSessionID: TGUID; aSessionAction: TROSessionsActions; Sender: TObject)

Parameters:


StoreEventData (TGUID, TROBinaryMemoryStream, Boolean, Boolean, string)  overload    (declared in TROEventRepository)

Stores the provided event data in the repository.

procedure StoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string)

Parameters:

  • SourceSessionID: Session ID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs

StoreEventData (TGUID, TROBinaryMemoryStream, Boolean, Boolean, string, string)  overload    (declared in TROEventRepository)

Stores the provided event data in the repository.

procedure StoreEventData(SourceSessionID: TGUID; Data: TROBinaryMemoryStream; const ExcludeSender: Boolean; const ExcludeSessionList: Boolean; const SessionList: string; const EventSinkId: string)

Parameters:

  • SourceSessionID: Session ID
  • Data: Event data container
  • ExcludeSender: If true, the SourceSessionID will be excluded from the destination list.
  • ExcludeSessionList: If true, the SessionList will be used as an exclusion list, otherwise as an inclusion list.
  • SessionList: Comma delimited list of session GUIDs
  • EventSinkId: Event sink

 

OnAfterAddSession    (declared in TROEventRepository)

Fired by AddSession after addition.

property OnAfterAddSession: TROSessionEvent read write
delegate: procedure OnAfterAddSession(Sender: TROEventRepository; const SessionID: TGUID)

OnAfterRemoveSession    (declared in TROEventRepository)

Fired by RemoveSession after removing.

property OnAfterRemoveSession: TROSessionEvent read write
delegate: procedure OnAfterRemoveSession(Sender: TROEventRepository; const SessionID: TGUID)

OnBeforeAddSession    (declared in TROEventRepository)

Fired by AddSession before addition.

property OnBeforeAddSession: TROSessionEvent read write
delegate: procedure OnBeforeAddSession(Sender: TROEventRepository; const SessionID: TGUID)

OnBeforeRemoveSession    (declared in TROEventRepository)

Fired by RemoveSession before removing.

property OnBeforeRemoveSession: TROSessionEvent read write
delegate: procedure OnBeforeRemoveSession(Sender: TROEventRepository; const SessionID: TGUID)

See Also