Class FileSessionManager
Class for the management of finding file based sessions contained on the file system for indexing as SQL Race Sessions.
Inheritance
Implements
Namespace: MESL.SqlRace.Domain
Assembly: MESL.SqlRace.Domain.dll
Syntax
public sealed class FileSessionManager : Object, IFileSessionManager
Methods
ComputeGuidFor(String)
Computes a Session Key Guid for a FileSession
Declaration
public SessionKey ComputeGuidFor(string fileSessionPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileSessionPath | Path and filename to compute key for |
Returns
Type | Description |
---|---|
SessionKey | SessionKey |
ComputeLegacyKey(String, UInt64, UInt64)
Computes a Session Key Guid for a FileSession replicating MAT.SessionImportConsole algorithm
Declaration
public SessionKey ComputeLegacyKey(string fileSessionPath, ulong startTime, ulong endTime)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileSessionPath | Path and filename to compute key for |
System.UInt64 | startTime | Session Start time |
System.UInt64 | endTime | Session End time |
Returns
Type | Description |
---|---|
SessionKey | SessionKey |
CreateFileSessionManager()
Creates a new instance of the FileSessionManager.
Declaration
public static FileSessionManager CreateFileSessionManager()
Returns
Type | Description |
---|---|
FileSessionManager | A new FileSessionManager object. |
GetIndexedFileSessionFolder(String, String, Boolean)
Get the indexed file sessions from the cache
Declaration
public IEnumerable<ISessionSummary> GetIndexedFileSessionFolder(string connectionString, string path, bool includeSubdirectories)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The connection string for the cache database |
System.String | path | The path to the indexed folder |
System.Boolean | includeSubdirectories | Whether or not to include descendent directories of the path given. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> | The session summaries of the session files in the given folder |
GetIndexedFileSessionFolder(String, String, Boolean, IFilter, IEnumerable<SortCriterion>, Nullable<Int32>, Nullable<Int32>)
Get the indexed file sessions from the cache
Declaration
public IEnumerable<ISessionSummary> GetIndexedFileSessionFolder(string connectionString, string path, bool includeSubdirectories, IFilter filter, IEnumerable<SortCriterion> sortCriteria, Nullable<int> pageNumber, Nullable<int> pageSize)
Parameters
Type | Name | Description |
---|---|---|
System.String | connectionString | The connection string for the cache database |
System.String | path | The path to the indexed folder |
System.Boolean | includeSubdirectories | Whether or not to include descendent directories of the path given. |
IFilter | filter | The filter to limit the number of sessions returned |
System.Collections.Generic.IEnumerable<SortCriterion> | sortCriteria | The fields to sort the result by |
System.Nullable<System.Int32> | pageNumber | The 1 based page number |
System.Nullable<System.Int32> | pageSize | The number of items per page |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> | The session summaries of the session files in the given folder |
IndexFileSessions(List<String>, String, Boolean)
Load a FileSession from specified path
Declaration
public IEnumerable<ISessionSummary> IndexFileSessions(List<string> fileSessionFullPaths, string connectionString, bool processAssociated)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<System.String> | fileSessionFullPaths | Fully qualified path and filename to a file based session |
System.String | connectionString | Database connection string to use for file session |
System.Boolean | processAssociated | Whether to include Associate sessions for processing |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> | List of ISessionSummary representing the File session and Associates (if requested) |
IsSessionFile(String)
Returns true if the file is a type that we can load as a session, false otherwise
Declaration
public bool IsSessionFile(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath |
Returns
Type | Description |
---|---|
System.Boolean |
IsSessionFileOrDependent(String)
Returns true if the file is a type that we can load as a session or a file that depends on a session (e.g. SSE), false otherwise
Declaration
public bool IsSessionFileOrDependent(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath |
Returns
Type | Description |
---|---|
System.Boolean |
Load(String, IList<String>)
Loads the specified file session.
Declaration
public IClientSession Load(string fileSession, IList<string> associatesToLoad = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileSession | The file session. |
System.Collections.Generic.IList<System.String> | associatesToLoad | The associates to load |
Returns
Type | Description |
---|---|
IClientSession |
LoadSessionSummariesForFiles(IList<String>, IFilter, IEnumerable<SortCriterion>, CancellationToken, IProgress<SessionProcessingStatusUpdate>)
Load only session summaries for the given files
Declaration
public IEnumerable<ISessionSummary> LoadSessionSummariesForFiles(IList<string> files, IFilter filter, IEnumerable<SortCriterion> sortCriteria, CancellationToken token, IProgress<SessionProcessingStatusUpdate> progress)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.String> | files | The files that need to be the summary been loaded |
IFilter | filter | |
System.Collections.Generic.IEnumerable<SortCriterion> | sortCriteria | |
System.Threading.CancellationToken | token | A token to cancel the operation |
System.IProgress<SessionProcessingStatusUpdate> | progress |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> |
LoadSessionSummariesForFiles(IList<String>, CancellationToken, IProgress<SessionProcessingStatusUpdate>)
Load only session summaries for the given files
Declaration
public IEnumerable<ISessionSummary> LoadSessionSummariesForFiles(IList<string> files, CancellationToken token, IProgress<SessionProcessingStatusUpdate> progress)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IList<System.String> | files | The files that need to be the summary been loaded |
System.Threading.CancellationToken | token | A token to cancel the operation |
System.IProgress<SessionProcessingStatusUpdate> | progress |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> |
LoadSessionSummariesForPath(String, Boolean, IFilter, IEnumerable<SortCriterion>, Nullable<Int32>, Nullable<Int32>, CancellationToken, IProgress<SessionProcessingStatusUpdate>)
Load only session summaries for the files present in the given folder
Declaration
public IEnumerable<ISessionSummary> LoadSessionSummariesForPath(string folderPath, bool includeSubdirectories, IFilter filter, IEnumerable<SortCriterion> sortCriteria, Nullable<int> pageNumber, Nullable<int> pageSize, CancellationToken token, IProgress<SessionProcessingStatusUpdate> progress)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | Fully qualified path |
System.Boolean | includeSubdirectories | Recursive or not |
IFilter | filter | |
System.Collections.Generic.IEnumerable<SortCriterion> | sortCriteria | An ordered list of sort field and direction |
System.Nullable<System.Int32> | pageNumber | The 1 based page number |
System.Nullable<System.Int32> | pageSize | The number of items per page |
System.Threading.CancellationToken | token | A token to cancel the operation |
System.IProgress<SessionProcessingStatusUpdate> | progress |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> |
LoadSessionSummariesForPath(String, Boolean, CancellationToken, IProgress<SessionProcessingStatusUpdate>)
Load only session summaries for the files present in the given folder
Declaration
public IEnumerable<ISessionSummary> LoadSessionSummariesForPath(string folderPath, bool includeSubdirectories, CancellationToken token, IProgress<SessionProcessingStatusUpdate> progress)
Parameters
Type | Name | Description |
---|---|---|
System.String | folderPath | Fully qualified path |
System.Boolean | includeSubdirectories | Recursive or not |
System.Threading.CancellationToken | token | A token to cancel the operation |
System.IProgress<SessionProcessingStatusUpdate> | progress |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ISessionSummary> |
PopulateMetadataFromFullLoad(Session)
Assign any additional metadata to the session that has become available now that all of the data is being loaded.
Declaration
public bool PopulateMetadataFromFullLoad(Session session)
Parameters
Type | Name | Description |
---|---|---|
Session | session | File session object. |
Returns
Type | Description |
---|---|
System.Boolean | true if session summary is found. |
ProcessFileSessionConfiguration(String, String, Boolean)
Processes the file session configuration.
Declaration
public void ProcessFileSessionConfiguration(string fileSessionFullPath, string connectionString, bool processAssociated)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileSessionFullPath | The file session full path. |
System.String | connectionString | The connection string. |
System.Boolean | processAssociated | Process associated sessions |
Events
FileSessionEventOccurred
Event fired for various event on a session.
Declaration
public event EventHandler<SessionEventArgs> FileSessionEventOccurred
Event Type
Type | Description |
---|---|
System.EventHandler<SessionEventArgs> |