Class SessionManagerBase
Abstract base class for SessionManager, to facilitate testing.
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public abstract class SessionManagerBase : Object
  Constructors
SessionManagerBase()
Declaration
protected SessionManagerBase()
  Methods
Append(ConnectionInformationBase, SessionKey, String, DateTime, String)
Opens an existing session in a state allowing more data to be added to the session. If the specified session does not yet exist, then a new session is created.
Declaration
public abstract IClientSession Append(ConnectionInformationBase connectionInformation, SessionKey key, string identifier, DateTime dateRecorded, string sessionType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | identifier | The identifier.  | 
      
| System.DateTime | dateRecorded | The date recorded.  | 
      
| System.String | sessionType | Type of the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session to append.  | 
      
Append(ConnectionInformationBase, SessionKey, String, DateTime, String, UInt32)
Opens an existing session in a state allowing more data to be added to the session. If the specified session does not yet exist, then a new session is created.
Declaration
public abstract IClientSession Append(ConnectionInformationBase connectionInformation, SessionKey key, string identifier, DateTime dateRecorded, string sessionType, uint teamId)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | identifier | The identifier.  | 
      
| System.DateTime | dateRecorded | The date recorded.  | 
      
| System.String | sessionType | Type of the session.  | 
      
| System.UInt32 | teamId | The team id.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session to append.  | 
      
CleanupZombieLiveSessions()
Cleanups the zombie live sessions.
Declaration
public abstract int CleanupZombieLiveSessions()
  Returns
| Type | Description | 
|---|---|
| System.Int32 | 
ClearAuditEntries(String)
Clears all audit entries in the specified database.
Declaration
public abstract void ClearAuditEntries(string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
Close(IClientSession)
Closes the specified client session.
Declaration
public abstract void Close(IClientSession clientSession)
  Parameters
| Type | Name | Description | 
|---|---|---|
| IClientSession | clientSession | The client session.  | 
      
CreateCompositeSession(String)
Create a new instance of a CompositeSession
Declaration
public abstract ICompositeSession CreateCompositeSession(string compositesessionidentifier)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | compositesessionidentifier | 
Returns
| Type | Description | 
|---|---|
| ICompositeSession | 
CreateSession(ConnectionInformationBase, SessionKey, String, DateTime, String)
Creates the session.
Declaration
public abstract IClientSession CreateSession(ConnectionInformationBase connectionInformation, SessionKey key, string identifier, DateTime dateRecorded, string sessionType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | identifier | The description.  | 
      
| System.DateTime | dateRecorded | The date recorded.  | 
      
| System.String | sessionType | Type of the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was created.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session creation or there is an issue with the licence (expired, not configured etc).  | 
      
CreateSession(String, SessionKey, String, DateTime, String)
Creates the session.
Declaration
public abstract IClientSession CreateSession(string connectionString, SessionKey key, string identifier, DateTime dateRecorded, string sessionType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | identifier | The description.  | 
      
| System.DateTime | dateRecorded | The date recorded.  | 
      
| System.String | sessionType | Type of the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was created.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session creation or there is an issue with the licence (expired, not configured etc).  | 
      
CreateSessionWithTeamId(ConnectionInformationBase, SessionKey, String, DateTime, UInt32, String)
Create a session with a teamId.
Declaration
public abstract IClientSession CreateSessionWithTeamId(ConnectionInformationBase connectionInformation, SessionKey key, string identifier, DateTime dateRecorded, uint teamId, string sessionType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| MAT.OCS.Core.SessionKey | key | GUID key that uniquely identifies a session.  | 
      
| System.String | identifier | Identifier of the session.  | 
      
| System.DateTime | dateRecorded | Date and time the session was recorded.  | 
      
| System.UInt32 | teamId | TeamID that this session will be associated with.  | 
      
| System.String | sessionType | Type of the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was created.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session creation or there is an issue with the licence (expired, not configured etc).  | 
      
CreateSessionWithTeamId(String, SessionKey, String, DateTime, UInt32, String)
Someone should take this overloaded method with the 'teamId' argument and save it in the session.
Declaration
public abstract IClientSession CreateSessionWithTeamId(string connectionString, SessionKey key, string identifier, DateTime dateRecorded, uint teamId, string sessionType)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | Connection string the SQL Race database.  | 
      
| MAT.OCS.Core.SessionKey | key | GUID key that uniquely identifies a session.  | 
      
| System.String | identifier | Identifier of the session.  | 
      
| System.DateTime | dateRecorded | Date and time the session was recorded.  | 
      
| System.UInt32 | teamId | TeamID that this session will be associated with.  | 
      
| System.String | sessionType | The session type.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was created.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session creation or there is an issue with the licence (expired, not configured etc).  | 
      
Delete(SessionKey, ConnectionInformationBase)
Logically deletes an existing session from the system (i.e. the session will remain in the database until it is removed).
Declaration
public abstract void Delete(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | Connection string to the SQL Race database.  | 
      
Delete(SessionKey, String)
Deletes an existing session from the system.
Declaration
public abstract void Delete(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
ExportSession(String, SessionKey, String)
Exports the session to the specified file.
Declaration
public abstract void ExportSession(string connectionString, SessionKey sessionKey, string filePath)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string for the database with the session.  | 
      
| MAT.OCS.Core.SessionKey | sessionKey | The session key.  | 
      
| System.String | filePath | The file path to export to.  | 
      
ExportSession(String, SessionKey, String, IReadOnlyList<String>, IReadOnlyList<Int32>, Boolean, Boolean, Boolean, Boolean, Boolean, String)
Exports a session with a list of specific parameter identifiers
Declaration
public abstract FragmentedMemoryStream ExportSession(string connectionString, SessionKey sessionKey, string filePath, IReadOnlyList<string> parametersToExport, IReadOnlyList<int> lapsToExport, bool exportEvents, bool exportErrors, bool exportMarkers, bool exportSessionConstants, bool useActiveTeam, string sessionIdentifier)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string for the database with the session.  | 
      
| MAT.OCS.Core.SessionKey | sessionKey | The session key.  | 
      
| System.String | filePath | The file path to export to.  | 
      
| System.Collections.Generic.IReadOnlyList<System.String> | parametersToExport | List of parameter identifiers to export.  | 
      
| System.Collections.Generic.IReadOnlyList<System.Int32> | lapsToExport | List of parameter identifiers to export.  | 
      
| System.Boolean | exportEvents | Export Events.  | 
      
| System.Boolean | exportErrors | Export Errors.  | 
      
| System.Boolean | exportMarkers | Export Markers.  | 
      
| System.Boolean | exportSessionConstants | Export Session Constants.  | 
      
| System.Boolean | useActiveTeam | Use active team to export the session.  | 
      
| System.String | sessionIdentifier | The identifier for the session  | 
      
Returns
| Type | Description | 
|---|---|
| MESL.SqlRace.Common.FragmentedMemoryStream | 
ExportSessionWithCustomTime(String, SessionKey, String, IReadOnlyList<String>, IReadOnlyList<Int32>, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean, Boolean, Boolean, Boolean, String)
Exports a session with a list of specific parameter identifiers
Declaration
public abstract FragmentedMemoryStream ExportSessionWithCustomTime(string connectionString, SessionKey sessionKey, string filePath, IReadOnlyList<string> parametersToExport, IReadOnlyList<int> lapsToExport, Nullable<long> customStartTime, Nullable<long> customEndTime, bool exportEvents, bool exportErrors, bool exportMarkers, bool exportSessionConstants, bool useActiveTeam, string sessionIdentifier)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string for the database with the session.  | 
      
| MAT.OCS.Core.SessionKey | sessionKey | The session key.  | 
      
| System.String | filePath | The file path to export to.  | 
      
| System.Collections.Generic.IReadOnlyList<System.String> | parametersToExport | List of parameter identifiers to export.  | 
      
| System.Collections.Generic.IReadOnlyList<System.Int32> | lapsToExport | List of parameter identifiers to export.  | 
      
| System.Nullable<System.Int64> | customStartTime | List of laps to export.  | 
      
| System.Nullable<System.Int64> | customEndTime | List of laps to export.  | 
      
| System.Boolean | exportEvents | Export Events.  | 
      
| System.Boolean | exportErrors | Export Errors.  | 
      
| System.Boolean | exportMarkers | Export Markers.  | 
      
| System.Boolean | exportSessionConstants | Export Session Constants.  | 
      
| System.Boolean | useActiveTeam | Use active team to export the session.  | 
      
| System.String | sessionIdentifier | The identifier for the session  | 
      
Returns
| Type | Description | 
|---|---|
| MESL.SqlRace.Common.FragmentedMemoryStream | 
ExportSessionWithNullTeamId(String, SessionKey, String)
Exports the session to the specified file using UnknownTeamId.
Declaration
public abstract void ExportSessionWithNullTeamId(string connectionString, SessionKey sessionKey, string filePath)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string for the database with the session.  | 
      
| MAT.OCS.Core.SessionKey | sessionKey | The session key.  | 
      
| System.String | filePath | The file path to export to.  | 
      
Find(String, Nullable<Int32>, IList<SessionState>, Nullable<Boolean>)
Finds sessions within SQL Race with a maximum number returned.
Declaration
public abstract IList<SessionSummary> Find(string connectionString, Nullable<int> maxCount, IList<SessionState> sessionStates, Nullable<bool> sessionsWithNoChannelData)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| System.Nullable<System.Int32> | maxCount | The maximum number of sessions to return.  | 
      
| System.Collections.Generic.IList<SessionState> | sessionStates | The session states being retrieved.  | 
      
| System.Nullable<System.Boolean> | sessionsWithNoChannelData | If set to   | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | A list of SessionSummary items.  | 
      
Remarks
Sessions that are live and not in SQL Race Server are excluded if sessionStatesis not passed.
Sessions that have no data are excluded by default, set sessionsWithNoChannelData to true to return these sessions.
FindBySessionItems(IList<SessionDataItem>, ConnectionInformationBase)
Finds the by session items.
Declaration
public abstract IList<SessionSummary> FindBySessionItems(IList<SessionDataItem> sessionItems, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<SessionDataItem> | sessionItems | The session items.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | Returns list of sessions.  | 
      
FindBySessionItems(IList<SessionDataItem>, String)
Returns a list of sessions that match the search criteria.
Declaration
public abstract IList<SessionSummary> FindBySessionItems(IList<SessionDataItem> sessionItems, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Collections.Generic.IList<SessionDataItem> | sessionItems | The session items.  | 
      
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | A List of SessionSummary objects.  | 
      
Remarks
If no sessionItems are passed, then all sessions in the system are returned.
FindBySessionState(SessionState, ConnectionInformationBase)
Finds the sessions by their state.
Declaration
public abstract IList<SessionSummary> FindBySessionState(SessionState sessionState, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SessionState | sessionState | The required session state.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | A list of SessionSummary items matching the session state.  | 
      
FindBySessionState(SessionState, String)
Finds the sessions by their state.
Declaration
public abstract IList<SessionSummary> FindBySessionState(SessionState sessionState, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| SessionState | sessionState | The required session state.  | 
      
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | A list of SessionSummary items matching the session state.  | 
      
FindDeletedSessions(ConnectionInformationBase)
Finds the logically deleted sessions in the database.
Declaration
public abstract IList<SessionSummary> FindDeletedSessions(ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | Returns all logically deleted sessions.  | 
      
FindDeletedSessions(String)
Finds the logically deleted sessions in the database.
Declaration
public abstract IList<SessionSummary> FindDeletedSessions(string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | Returns all logically deleted sessions.  | 
      
GetActiveSessions(Predicate<Session>)
Get a list of sessions matching the criteria passed
Declaration
public abstract IDictionary<SessionKey, Session> GetActiveSessions(Predicate<Session> matching)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Predicate<Session> | matching | eg (x => x.Key == SomeGuid)  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IDictionary<MAT.OCS.Core.SessionKey, Session> | A list of sessions  | 
      
GetAuditEntries(String)
Gets the audit entries for the specified session key.
Declaration
public abstract IList<AuditEntry> GetAuditEntries(string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<AuditEntry> | List of audit entries.  | 
      
GetAuditEntries(String, SessionKey)
Gets the audit entries for the specified session key.
Declaration
public abstract IList<AuditEntry> GetAuditEntries(string connectionString, SessionKey sessionKey)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| MAT.OCS.Core.SessionKey | sessionKey | The session key.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<AuditEntry> | List of audit entries.  | 
      
GetServerEndPoint(ConnectionContextBase)
Gets the server end point.
Declaration
public abstract IPEndPoint GetServerEndPoint(ConnectionContextBase connectionContext)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionContextBase | connectionContext | The connection context.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Net.IPEndPoint | The IP end point, or null if not available  | 
      
GetSessionDataItemNames(ConnectionInformationBase)
Returns a list of all session data item names.
Declaration
public abstract IList<string> GetSessionDataItemNames(ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<System.String> | A list of string values for session data item names.  | 
      
GetSessionDataItemNames(String)
Returns a list of all session data item names.
Declaration
public abstract IList<string> GetSessionDataItemNames(string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<System.String> | A list of string values for session data item names.  | 
      
ImportSession(String, String)
Imports a session to the database defined by the passed connection string from the specified file.
Declaration
public abstract SessionKey ImportSession(string connectionString, string filePath)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| System.String | filePath | The file path for the session file.  | 
      
Returns
| Type | Description | 
|---|---|
| MAT.OCS.Core.SessionKey | GUID of imported session.  | 
      
Remarks
This method creates a session with the key that of original session. Use method ImportSession(string connectionString, string filePath, GUID key) to create session with new key.
ImportSession(String, String, SessionKey)
Imports a session with the specified key to the database defined by the passed connection string from the specified file.
Declaration
public abstract void ImportSession(string connectionString, string filePath, SessionKey key)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| System.String | filePath | The file path for the session file.  | 
      
| MAT.OCS.Core.SessionKey | key | The new session key for the imported session.  | 
      
Remarks
This method creates a session with the key that of original session. Use.
IsAvailable(ConnectionInformationBase)
Checks if the connection information supplied refers to an active connection.
Declaration
public abstract bool IsAvailable(ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| ConnectionInformationBase | connectionInformation | Connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if active. False otherwise.  | 
      
IsAvailable(String)
Checks if the connection information supplied refers to an available connection.
Declaration
public abstract bool IsAvailable(string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Boolean | True if available. False otherwise.  | 
      
Load(SessionKey, ConnectionInformationBase)
Loads an existing session from the system.
Declaration
public abstract IClientSession Load(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | A Session object with all the details of an existing session.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, ConnectionInformationBase, IEnumerable<String>)
OBSOLETE: Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession Load(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<string> parameterIdentifiers)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, ConnectionInformationBase, IEnumerable<String>, SessionChildItemsToLoad)
Loads an existing session from the system, but only loads the session's child items requested.
Declaration
public abstract IClientSession Load(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<string> parameterIdentifiers, SessionChildItemsToLoad childItemsToLoad)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
| SessionChildItemsToLoad | childItemsToLoad | The child items to load into the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, String)
Loads an existing session from the system.
Declaration
public abstract IClientSession Load(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | A Session object with all the details of an existing session.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, String, IEnumerable<String>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession Load(SessionKey key, string connectionString, IEnumerable<string> parameterIdentifiers)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, String, IEnumerable<String>, SessionChildItemsToLoad)
Loads an existing session from the system, but only loads the session's child items requested.
Declaration
public abstract IClientSession Load(SessionKey key, string connectionString, IEnumerable<string> parameterIdentifiers, SessionChildItemsToLoad childItemsToLoad)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
| SessionChildItemsToLoad | childItemsToLoad | The child items to load into the session.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Load(SessionKey, String, IReadOnlyDictionary<SessionKey, String>)
Loads an existing session from the system.
Declaration
public abstract IClientSession Load(SessionKey key, string connectionString, IReadOnlyDictionary<SessionKey, string> associateSessions)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IReadOnlyDictionary<MAT.OCS.Core.SessionKey, System.String> | associateSessions | 
Returns
| Type | Description | 
|---|---|
| IClientSession | A Session object with all the details of an existing session.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadAssociatesForSession(SessionKey, ConnectionInformationBase)
Loads the associate sessions for a session.
Declaration
public abstract IList<SessionSummary> LoadAssociatesForSession(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | Returns collection of summaries for associated sessions.  | 
      
LoadAssociatesForSession(SessionKey, String)
Loads the associate sessions for a session.
Declaration
public abstract IList<SessionSummary> LoadAssociatesForSession(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | The session key.  | 
      
| System.String | connectionString | The connection string.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IList<SessionSummary> | Returns collection of summaries for associated sessions.  | 
      
LoadLightweight(SessionKey, ConnectionInformationBase)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<SessionKey>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<SessionKey> additionalSessionKeys)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> | additionalSessionKeys | Associated sessions to load  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<String>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<string> parameterIdentifiers)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<String>, IEnumerable<SessionKey>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<string> parameterIdentifiers, IEnumerable<SessionKey> additionalSessionKeys)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
| System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> | additionalSessionKeys | Associated sessions to load  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, String)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, String, IEnumerable<SessionKey>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, string connectionString, IEnumerable<SessionKey> additionalSessionKeys)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> | additionalSessionKeys | Associated sessions to load  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, String, IEnumerable<String>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, string connectionString, IEnumerable<string> parameterIdentifiers)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
LoadLightweight(SessionKey, String, IEnumerable<String>, IEnumerable<SessionKey>)
Loads an existing session from the system, but without loading any of the session's child items.
Declaration
public abstract IClientSession LoadLightweight(SessionKey key, string connectionString, IEnumerable<string> parameterIdentifiers, IEnumerable<SessionKey> additionalSessionKeys)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Collections.Generic.IEnumerable<System.String> | parameterIdentifiers | The parameter identifiers for parameters to load.  | 
      
| System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> | additionalSessionKeys | Associated sessions to load  | 
      
Returns
| Type | Description | 
|---|---|
| IClientSession | Session that was loaded.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| System.Security.Authentication.AuthenticationException | Thrown if the SQL Race licence does not allow session loading or there is an issue with the licence (expired, not configured etc).  | 
      
Poll(String, IList<SessionState>, Nullable<Boolean>, CancellationToken)
Polls SQL Race for sessions, sessions are returned in an Enumerable which can be used to stream new sessions. When you ask for the next element in the returned Enumerable, it will block while it waits for the next session. This can be already in the database or put in the databse at a future point. It will then give you the new session. This will continue until you cancel using the cancellation token
Declaration
public abstract IEnumerable<SessionSummary> Poll(string connectionString, IList<SessionState> sessionStates, Nullable<bool> sessionsWithNoChannelData, CancellationToken token)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | connectionString | The connection string.  | 
      
| System.Collections.Generic.IList<SessionState> | sessionStates | The session states being retrieved.  | 
      
| System.Nullable<System.Boolean> | sessionsWithNoChannelData | If set to   | 
      
| System.Threading.CancellationToken | token | Used to cancel the polling  | 
      
Returns
| Type | Description | 
|---|---|
| System.Collections.Generic.IEnumerable<SessionSummary> | A list of SessionSummary items.  | 
      
Remarks
Sessions that are live and not in SQL Race Server are excluded if sessionStatesis not passed.
Sessions that have no data are excluded by default, set sessionsWithNoChannelData to true to return these sessions.
ReindexFolder(String, String, CancellationToken)
Deletes the cached record of files in the given path and re-indexes the folder.
Declaration
public abstract Task ReindexFolder(string path, string connectionString, CancellationToken token)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | path | The path to re-index.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
| System.Threading.CancellationToken | token | The token to cancel the operation.  | 
      
Returns
| Type | Description | 
|---|---|
| System.Threading.Tasks.Task | The task performning the re-index operation.  | 
      
Remove(SessionKey, ConnectionInformationBase)
Removes an existing session from the system.
Declaration
public abstract void Remove(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | Connection string to the SQL Race database.  | 
      
Remove(SessionKey, String)
Removes an existing session from the system.
Declaration
public abstract void Remove(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
Undelete(SessionKey, ConnectionInformationBase)
Undeletes an existing session from the system.
Declaration
public abstract void Undelete(SessionKey key, ConnectionInformationBase connectionInformation)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| ConnectionInformationBase | connectionInformation | The connection information.  | 
      
Undelete(SessionKey, String)
Undeletes an existing session from the system.
Declaration
public abstract void Undelete(SessionKey key, string connectionString)
  Parameters
| Type | Name | Description | 
|---|---|---|
| MAT.OCS.Core.SessionKey | key | Session key.  | 
      
| System.String | connectionString | Connection string to the SQL Race database.  | 
      
Events
AsyncErrorOccurred
Event fired when an error has been detected on a background process.
Declaration
public abstract event EventHandler<AsyncEventArgs> AsyncErrorOccurred
  Event Type
| Type | Description | 
|---|---|
| System.EventHandler<AsyncEventArgs> | 
LoggerEventOccurred
Occurs when [logger event occurred].
Declaration
public abstract event EventHandler<LoggerEventArgs> LoggerEventOccurred
  Event Type
| Type | Description | 
|---|---|
| System.EventHandler<MESL.SqlRace.Common.LoggerEventArgs> | 
MessagingErrorOccurred
Event fired when an error has been detected on a remote connection.
Declaration
public abstract event EventHandler<MessagingErrorEventArgs> MessagingErrorOccurred
  Event Type
| Type | Description | 
|---|---|
| System.EventHandler<MESL.SqlRace.Messaging.Interface.MessagingErrorEventArgs> | 
SessionEventOccurred
Event fired for various event on a session.
Declaration
public abstract event EventHandler<SessionEventArgs> SessionEventOccurred
  Event Type
| Type | Description | 
|---|---|
| System.EventHandler<SessionEventArgs> |