Show / Hide Table of Contents

Class SessionManager

Responsible for creating, loading, deleting and searching for sessions.

Inheritance
System.Object
SessionManagerBase
SessionManager
Implements
IApplicationInformationService
IAuditManager
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public sealed class SessionManager : SessionManagerBase, ISessionManager, IApplicationInformationService, IAuditManager

Properties

ServerListener

Declaration
public IServerListener ServerListener { get; set; }
Property Value
Type Description
IServerListener

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 override 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.

Overrides
SessionManagerBase.Append(ConnectionInformationBase, SessionKey, String, DateTime, String)

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 override 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.

Overrides
SessionManagerBase.Append(ConnectionInformationBase, SessionKey, String, DateTime, String, UInt32)

CleanupZombieLiveSessions()

Cleans up zombie live sessions - sessions that have not been closed gracefully - i.e after a recorder host crash.

Declaration
public override int CleanupZombieLiveSessions()
Returns
Type Description
System.Int32

Number of Sessions affected

Overrides
SessionManagerBase.CleanupZombieLiveSessions()

ClearAuditEntries(String)

Clears all audit entries in the specified database.

Declaration
public override void ClearAuditEntries(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Overrides
SessionManagerBase.ClearAuditEntries(String)

Close(IClientSession)

Closes the specified client session.

Declaration
public override void Close(IClientSession clientSession)
Parameters
Type Name Description
IClientSession clientSession

The client session to close

Overrides
SessionManagerBase.Close(IClientSession)

CreateAndSubscribeClient(Session)

Declaration
public ClientSession CreateAndSubscribeClient(Session session)
Parameters
Type Name Description
Session session
Returns
Type Description
ClientSession

CreateCompositeSession(String)

Create a new instance of a CompositeSession.

Declaration
public override ICompositeSession CreateCompositeSession(string compositesessionidentifier)
Parameters
Type Name Description
System.String compositesessionidentifier

CompositeSession Identifier.

Returns
Type Description
ICompositeSession

A CompositeSession.

Overrides
SessionManagerBase.CreateCompositeSession(String)

CreateSession(ConnectionInformationBase, SessionKey, String, DateTime, String)

Creates the session.

Declaration
public override IClientSession CreateSession(ConnectionInformationBase connectionInformation, SessionKey key, string identifier, DateTime dateRecorded, string sessionType)
Parameters
Type Name Description
ConnectionInformationBase connectionInformation

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.

Overrides
SessionManagerBase.CreateSession(ConnectionInformationBase, SessionKey, String, DateTime, String)
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 override 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.

Overrides
SessionManagerBase.CreateSession(String, SessionKey, String, DateTime, String)
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).

CreateSessionGeneratingTeamId(String, SessionKey, String, DateTime, String, String, String)

Creates a session generating a team id based on licence owner.

Declaration
public IClientSession CreateSessionGeneratingTeamId(string connectionString, SessionKey key, string identifier, DateTime dateRecorded, string sessionType, string timeZoneId, string recorderFriendlyName)
Parameters
Type Name Description
System.String connectionString

The connection string.

MAT.OCS.Core.SessionKey key

The key.

System.String identifier

The identifier.

System.DateTime dateRecorded

The date recorded.

System.String sessionType

Type of the session.

System.String timeZoneId

Index of the time zone.

System.String recorderFriendlyName

Friendly name of the recorder.

Returns
Type Description
IClientSession

The created session.

CreateSessionManager()

Creates the session manager.

Declaration
public static SessionManager CreateSessionManager()
Returns
Type Description
SessionManager

An instance of SessionManager.

CreateSessionWithTeamId(ConnectionInformationBase, SessionKey, String, DateTime, UInt32, String)

Create a session with a teamId.

Declaration
public override 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.

Overrides
SessionManagerBase.CreateSessionWithTeamId(ConnectionInformationBase, SessionKey, String, DateTime, UInt32, String)
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)

Create a session with a teamId.

Declaration
public override 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

Type of the session.

Returns
Type Description
IClientSession

IClientSession that was created.

Overrides
SessionManagerBase.CreateSessionWithTeamId(String, SessionKey, String, DateTime, UInt32, String)
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, String)

Creates the session with team id create session with team id.

Declaration
public IClientSession CreateSessionWithTeamId(string connectionString, SessionKey key, string identifier, DateTime dateRecorded, uint teamId, string sessionType, string timeZoneId)
Parameters
Type Name Description
System.String connectionString

The connection string.

MAT.OCS.Core.SessionKey key

The key.

System.String identifier

The identifier.

System.DateTime dateRecorded

The date recorded.

System.UInt32 teamId

The team id.

System.String sessionType

Type of the session.

System.String timeZoneId

Index of the time zone.

Returns
Type Description
IClientSession

The created session.

CreateSessionWithTeamId(String, SessionKey, String, DateTime, UInt32, String, String, String)

Creates the session with team id create session with team id.

Declaration
public IClientSession CreateSessionWithTeamId(string connectionString, SessionKey key, string identifier, DateTime dateRecorded, uint teamId, string sessionType, string timeZoneId, string recorderFriendlyName)
Parameters
Type Name Description
System.String connectionString

The connection string.

MAT.OCS.Core.SessionKey key

The key.

System.String identifier

The identifier.

System.DateTime dateRecorded

The date recorded.

System.UInt32 teamId

The team id.

System.String sessionType

Type of the session.

System.String timeZoneId

Index of the time zone.

System.String recorderFriendlyName

Friendly name of the recorder.

Returns
Type Description
IClientSession

The created session.

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 override 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.

Overrides
SessionManagerBase.Delete(SessionKey, ConnectionInformationBase)

Delete(SessionKey, String)

Logically deletes an existing session from the system (i.e. the session will remain in the database until it is removed).

Declaration
public override 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.

Overrides
SessionManagerBase.Delete(SessionKey, String)

ExportSession(SessionKey, String)

The export session.

Declaration
public FragmentedMemoryStream ExportSession(SessionKey sessionKey, string connectionString)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey sessionKey

The session key.

System.String connectionString

The connection string.

Returns
Type Description
MESL.SqlRace.Common.FragmentedMemoryStream

The MESL.SqlRace.Common.FragmentedMemoryStream.

ExportSession(String, SessionKey, String)

Exports the session to the specified file.

Declaration
public override 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.

Overrides
SessionManagerBase.ExportSession(String, SessionKey, String)

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 override 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 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
Overrides
SessionManagerBase.ExportSession(String, SessionKey, String, IReadOnlyList<String>, IReadOnlyList<Int32>, Boolean, Boolean, Boolean, Boolean, Boolean, String)

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 override 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 laps 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
Overrides
SessionManagerBase.ExportSessionWithCustomTime(String, SessionKey, String, IReadOnlyList<String>, IReadOnlyList<Int32>, Nullable<Int64>, Nullable<Int64>, Boolean, Boolean, Boolean, Boolean, Boolean, String)

ExportSessionWithNullTeamId(String, SessionKey)

The export session with null team id.

Declaration
public FragmentedMemoryStream ExportSessionWithNullTeamId(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
MESL.SqlRace.Common.FragmentedMemoryStream

The MESL.SqlRace.Common.FragmentedMemoryStream.

ExportSessionWithNullTeamId(String, SessionKey, String)

Exports the session to the specified file using UnknownTeamId.

Declaration
public override 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.

Overrides
SessionManagerBase.ExportSessionWithNullTeamId(String, SessionKey, String)

Find(String, Nullable<Int32>, IList<SessionState>, Nullable<Boolean>)

Finds sessions within SQL Race with a maximum number returned.

Declaration
public override 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 true sessions with no channel data are returned. Default is false.

Returns
Type Description
System.Collections.Generic.IList<SessionSummary>

A list of SessionSummary items.

Overrides
SessionManagerBase.Find(String, Nullable<Int32>, IList<SessionState>, Nullable<Boolean>)
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)

Returns a list of sessions that match the search criteria.

Declaration
public override 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>

A List of SessionSummary objects.

Overrides
SessionManagerBase.FindBySessionItems(IList<SessionDataItem>, ConnectionInformationBase)
Remarks

If no sessionItems are passed, then all sessions in the system are returned.

FindBySessionItems(IList<SessionDataItem>, String)

Returns a list of sessions that match the search criteria.

Declaration
public override 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.

Overrides
SessionManagerBase.FindBySessionItems(IList<SessionDataItem>, String)
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 override 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.

Overrides
SessionManagerBase.FindBySessionState(SessionState, ConnectionInformationBase)

FindBySessionState(SessionState, String)

Finds the sessions by their state.

Declaration
public override 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.

Overrides
SessionManagerBase.FindBySessionState(SessionState, String)

FindDeletedSessions(ConnectionInformationBase)

Finds the logically deleted sessions in the database.

Declaration
public override IList<SessionSummary> FindDeletedSessions(ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
ConnectionInformationBase connectionInformation

The connection string.

Returns
Type Description
System.Collections.Generic.IList<SessionSummary>

Returns all logically deleted sessions.

Overrides
SessionManagerBase.FindDeletedSessions(ConnectionInformationBase)

FindDeletedSessions(String)

Finds the logically deleted sessions in the database.

Declaration
public override 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.

Overrides
SessionManagerBase.FindDeletedSessions(String)

FindSummaryBy(SessionKey, String)

Finds the summary by.

Declaration
public SessionSummary FindSummaryBy(SessionKey key, string connectionString)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

The key.

System.String connectionString

The connection string.

Returns
Type Description
SessionSummary

GetActiveSessions(Predicate<Session>)

Get a list of the active sessions requested

Declaration
public override IDictionary<SessionKey, Session> GetActiveSessions(Predicate<Session> matching)
Parameters
Type Name Description
System.Predicate<Session> matching

The predictate eg (x => x.State == SessionStates.Live)

Returns
Type Description
System.Collections.Generic.IDictionary<MAT.OCS.Core.SessionKey, Session>

A list of sessions

Overrides
SessionManagerBase.GetActiveSessions(Predicate<Session>)

GetApplicationVersion()

Returns the SQL Race application version number.

Declaration
public static string GetApplicationVersion()
Returns
Type Description
System.String

Application version string.

GetAuditEntries(String)

Gets the audit entries for the specified session key.

Declaration
public override 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.

Overrides
SessionManagerBase.GetAuditEntries(String)

GetAuditEntries(String, SessionKey)

Gets the audit entries for the specified session key.

Declaration
public override 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.

Overrides
SessionManagerBase.GetAuditEntries(String, SessionKey)

GetDatabaseVersion(String)

Returns the SQL Race database version number for the connection string.

Declaration
public static string GetDatabaseVersion(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Returns
Type Description
System.String

Database version string.

GetItemNamesAndValues(String)

Returns dictionary of item name with its values.

Declaration
public Dictionary<string, List<string>> GetItemNamesAndValues(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.String>>

The dictionary of item names and their values.

GetServerEndPoint(ConnectionContextBase)

Gets the server end point.

Declaration
public override 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

Overrides
SessionManagerBase.GetServerEndPoint(ConnectionContextBase)

GetSessionDataItemDefinitions(ConnectionInformationBase)

Returns the session data items definitions.

Declaration
public IEnumerable<SessionDataItemDefinition> GetSessionDataItemDefinitions(ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
ConnectionInformationBase connectionInformation

The connection information.

Returns
Type Description
System.Collections.Generic.IEnumerable<SessionDataItemDefinition>

A list of session data item definitions.

GetSessionDataItemDefinitions(String)

Returns the session data items definitions.

Declaration
public IEnumerable<SessionDataItemDefinition> GetSessionDataItemDefinitions(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Returns
Type Description
System.Collections.Generic.IEnumerable<SessionDataItemDefinition>

A list of session data item definitions.

GetSessionDataItemNames(ConnectionInformationBase)

Returns a list of all session data item names.

Declaration
public override 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 item names.

Overrides
SessionManagerBase.GetSessionDataItemNames(ConnectionInformationBase)

GetSessionDataItemNames(String)

Returns a list of all session data item names.

Declaration
public override 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.

Overrides
SessionManagerBase.GetSessionDataItemNames(String)

ImportSession(String, Stream)

The import session.

Declaration
public SessionKey ImportSession(string connectionString, Stream importStream)
Parameters
Type Name Description
System.String connectionString

The connection string.

System.IO.Stream importStream

The memory stream.

Returns
Type Description
MAT.OCS.Core.SessionKey

The System.Guid.

ImportSession(String, Stream, SessionKey)

The import session.

Declaration
public SessionKey ImportSession(string connectionString, Stream importStream, SessionKey key)
Parameters
Type Name Description
System.String connectionString

The connection string.

System.IO.Stream importStream

The import stream.

MAT.OCS.Core.SessionKey key

The key.

Returns
Type Description
MAT.OCS.Core.SessionKey

The System.Guid.

ImportSession(String, String)

Imports a session to the database defined by the passed connection string from the specified file.

Declaration
public override 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.

Overrides
SessionManagerBase.ImportSession(String, String)
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 override 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.

Overrides
SessionManagerBase.ImportSession(String, String, SessionKey)
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 available connection.

Declaration
public override bool IsAvailable(ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
ConnectionInformationBase connectionInformation

Connection information.

Returns
Type Description
System.Boolean

True if available. False otherwise.

Overrides
SessionManagerBase.IsAvailable(ConnectionInformationBase)

IsAvailable(String)

Checks if the connection information supplied refers to an active connection.

Declaration
public override bool IsAvailable(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Returns
Type Description
System.Boolean

True if active. False otherwise.

Overrides
SessionManagerBase.IsAvailable(String)

IsDatabaseLocal(String)

Check if the database is on the local machine.

Declaration
public bool IsDatabaseLocal(string connectionString)
Parameters
Type Name Description
System.String connectionString

DB Connection String.

Returns
Type Description
System.Boolean

True or False.

Load(SessionKey, ConnectionInformationBase)

Loads a primary session and its associated sessions. The associated sessions will be loaded and their contents exposed through the primary session.

Declaration
public override IClientSession Load(SessionKey key, ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

The session key of the primary session.

ConnectionInformationBase connectionInformation

The connection information.

Returns
Type Description
IClientSession

The specified session with its associated sessions.

Overrides
SessionManagerBase.Load(SessionKey, ConnectionInformationBase)
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<SessionKey>)

Loads a primary session and the specified additional sessions and returns the primary session. The additional sessions will be loaded and their contents exposed through the primary session.

Declaration
public IClientSession Load(SessionKey primarySessionKey, ConnectionInformationBase connectionInformation, IEnumerable<SessionKey> additionalSessionKeys)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey primarySessionKey

The session key of the primary session.

ConnectionInformationBase connectionInformation

The connection information.

System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> additionalSessionKeys

The additional session keys.

Returns
Type Description
IClientSession

The specified session with additional sessions. Note: additionalSessionKeys should be set to an empty collection if it is required to only load the primary session.

Exceptions
Type Condition
System.ArgumentException

Thrown if any of the sessions could not be loaded.

Load(SessionKey, ConnectionInformationBase, IEnumerable<String>)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.Load(SessionKey, ConnectionInformationBase, IEnumerable<String>)
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 override 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.

Overrides
SessionManagerBase.Load(SessionKey, ConnectionInformationBase, IEnumerable<String>, SessionChildItemsToLoad)
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 a primary session and its associated sessions. The associated sessions will be loaded and their contents exposed through the primary session.

Declaration
public override IClientSession Load(SessionKey key, string connectionString)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

The session key of the primary session.

System.String connectionString

Connection string to the SQL Race database.

Returns
Type Description
IClientSession

The specified session with its associated sessions.

Overrides
SessionManagerBase.Load(SessionKey, String)
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<SessionKey>)

Loads a primary session and the specified additional sessions and returns the primary session. The additional sessions will be loaded and their contents exposed through the primary session.

Declaration
public IClientSession Load(SessionKey primarySessionKey, string connectionString, IEnumerable<SessionKey> additionalSessionKeys)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey primarySessionKey

The session key of the primary session.

System.String connectionString

The connection string.

System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> additionalSessionKeys

The additional session keys.

Returns
Type Description
IClientSession

The specified session with additional sessions. Note: additionalSessionKeys should be set to an empty collection if it is required to only load the primary session.

Exceptions
Type Condition
System.ArgumentException

Thrown if any of the sessions could not be loaded.

Load(SessionKey, String, IEnumerable<String>)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.Load(SessionKey, String, IEnumerable<String>)
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 override 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.

Overrides
SessionManagerBase.Load(SessionKey, String, IEnumerable<String>, SessionChildItemsToLoad)
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 a primary session and its associated sessions. The associated sessions will be loaded and their contents exposed through the primary session.

Declaration
public override IClientSession Load(SessionKey key, string connectionString, IReadOnlyDictionary<SessionKey, string> associateSessions)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

The session key of the primary session.

System.String connectionString

Connection string to the SQL Race database.

System.Collections.Generic.IReadOnlyDictionary<MAT.OCS.Core.SessionKey, System.String> associateSessions

The additional session keys.

Returns
Type Description
IClientSession

The specified session with its associated sessions.

Overrides
SessionManagerBase.Load(SessionKey, String, IReadOnlyDictionary<SessionKey, String>)
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 override 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 a collection of summaries for associated sessions.

Overrides
SessionManagerBase.LoadAssociatesForSession(SessionKey, ConnectionInformationBase)

LoadAssociatesForSession(SessionKey, String)

Loads the associate sessions for a session.

Declaration
public override 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 a collection of summaries for associated sessions.

Overrides
SessionManagerBase.LoadAssociatesForSession(SessionKey, String)

LoadLightweight(SessionKey, ConnectionInformationBase)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, ConnectionInformationBase)
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 override IClientSession LoadLightweight(SessionKey key, ConnectionInformationBase connectionInformation, IEnumerable<SessionKey> additionalSessionKeys)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

Session key.

ConnectionInformationBase connectionInformation
System.Collections.Generic.IEnumerable<MAT.OCS.Core.SessionKey> additionalSessionKeys

Associated sessions to load

Returns
Type Description
IClientSession

Session that was loaded.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<SessionKey>)

LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<String>)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<String>)
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 override 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
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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, ConnectionInformationBase, IEnumerable<String>, IEnumerable<SessionKey>)

LoadLightweight(SessionKey, String)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, String)
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 override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, String, IEnumerable<SessionKey>)

LoadLightweight(SessionKey, String, IEnumerable<String>)

Loads an existing session from the system, but without loading any of the session's child items.

Declaration
public override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, String, IEnumerable<String>)
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 override 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.

Overrides
SessionManagerBase.LoadLightweight(SessionKey, String, IEnumerable<String>, IEnumerable<SessionKey>)

MountSession(MountedSession, SessionKey)

Mounts an external session into SQL Race. The supplied MountedSession is an adapter for another telemetry format and service. Capable of exposing both live and historic data as read-only.

Declaration
public IClientSession MountSession(MountedSession session, SessionKey sessionKey)
Parameters
Type Name Description
MountedSession session

Adapter for the session.

MAT.OCS.Core.SessionKey sessionKey

Session key to use for the session.

Returns
Type Description
IClientSession

The SQL Race session mounting the external data.

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 override 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 true sessions with no channel data are returned. Default is false.

System.Threading.CancellationToken token

Used to cancel the polling

Returns
Type Description
System.Collections.Generic.IEnumerable<SessionSummary>

A list of SessionSummary items.

Overrides
SessionManagerBase.Poll(String, IList<SessionState>, Nullable<Boolean>, CancellationToken)
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)

Abstract base class for SessionManager, to facilitate testing.

Declaration
public override Task ReindexFolder(string path, string connectionString, CancellationToken token)
Parameters
Type Name Description
System.String path
System.String connectionString
System.Threading.CancellationToken token
Returns
Type Description
System.Threading.Tasks.Task
Overrides
SessionManagerBase.ReindexFolder(String, String, CancellationToken)

Remove(SessionKey, ConnectionInformationBase)

Removes an existing session from the system.

Declaration
public override 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.

Overrides
SessionManagerBase.Remove(SessionKey, ConnectionInformationBase)

Remove(SessionKey, String)

Removes an existing session from the system.

Declaration
public override 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.

Overrides
SessionManagerBase.Remove(SessionKey, String)

SessionExists(SessionKey, ConnectionInformationBase)

Check if a Sessions exists.

Declaration
public bool SessionExists(SessionKey sessionKey, ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey sessionKey

The session key.

ConnectionInformationBase connectionInformation

The connection information.

Returns
Type Description
System.Boolean

SetDefaultDistance(String)

The register default distance.

Declaration
public void SetDefaultDistance(string parameterIdentifier)
Parameters
Type Name Description
System.String parameterIdentifier

The parameter identifier.

Undelete(SessionKey, ConnectionInformationBase)

Undeletes an existing session from the system.

Declaration
public override void Undelete(SessionKey key, ConnectionInformationBase connectionInformation)
Parameters
Type Name Description
MAT.OCS.Core.SessionKey key

Session key.

ConnectionInformationBase connectionInformation

The connection information.

Overrides
SessionManagerBase.Undelete(SessionKey, ConnectionInformationBase)

Undelete(SessionKey, String)

Undeletes an existing session from the system.

Declaration
public override 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.

Overrides
SessionManagerBase.Undelete(SessionKey, String)

Events

AsyncErrorOccurred

Event fired when an error has been detected on a background process.

Declaration
public override event EventHandler<AsyncEventArgs> AsyncErrorOccurred
Event Type
Type Description
System.EventHandler<AsyncEventArgs>
Overrides
SessionManagerBase.AsyncErrorOccurred

LoggerEventOccurred

Event fired for various logging events in SQL Race.

Declaration
public override event EventHandler<LoggerEventArgs> LoggerEventOccurred
Event Type
Type Description
System.EventHandler<MESL.SqlRace.Common.LoggerEventArgs>
Overrides
SessionManagerBase.LoggerEventOccurred

MessagingErrorOccurred

Event fired when an error occurs on a remote connection using messaging.

Declaration
public override event EventHandler<MessagingErrorEventArgs> MessagingErrorOccurred
Event Type
Type Description
System.EventHandler<MESL.SqlRace.Messaging.Interface.MessagingErrorEventArgs>
Overrides
SessionManagerBase.MessagingErrorOccurred

SessionEventOccurred

Event fired for various event on a session.

Declaration
public override event EventHandler<SessionEventArgs> SessionEventOccurred
Event Type
Type Description
System.EventHandler<SessionEventArgs>
Overrides
SessionManagerBase.SessionEventOccurred

Explicit Interface Implementations

IApplicationInformationService.GetApplicationVersion()

Returns the SQL Race application version number.

Declaration
string IApplicationInformationService.GetApplicationVersion()
Returns
Type Description
System.String

Application version string.

IApplicationInformationService.GetDatabaseVersion(String)

Returns the SQL Race database version number for the connection string.

Declaration
string IApplicationInformationService.GetDatabaseVersion(string connectionString)
Parameters
Type Name Description
System.String connectionString

The connection string.

Returns
Type Description
System.String

Database version string.

Implements

IApplicationInformationService
IAuditManager
Back to top Generated by DocFX