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. |
fileSessionPath | Path and filename to compute key for |
Returns
Type | Description |
---|---|
MAT. |
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. |
fileSessionPath | Path and filename to compute key for |
System. |
startTime | Session Start time |
System. |
endTime | Session End time |
Returns
Type | Description |
---|---|
MAT. |
SessionKey |
CreateFileSessionManager()
Creates a new instance of the File
Declaration
public static FileSessionManager CreateFileSessionManager()
Returns
Type | Description |
---|---|
File |
A new File |
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. |
connectionString | The connection string for the cache database |
System. |
path | The path to the indexed folder |
System. |
includeSubdirectories | Whether or not to include descendent directories of the path given. |
Returns
Type | Description |
---|---|
System. |
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. |
connectionString | The connection string for the cache database |
System. |
path | The path to the indexed folder |
System. |
includeSubdirectories | Whether or not to include descendent directories of the path given. |
IFilter | filter | The filter to limit the number of sessions returned |
System. |
sortCriteria | The fields to sort the result by |
System. |
pageNumber | The 1 based page number |
System. |
pageSize | The number of items per page |
Returns
Type | Description |
---|---|
System. |
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. |
fileSessionFullPaths | Fully qualified path and filename to a file based session |
System. |
connectionString | Database connection string to use for file session |
System. |
processAssociated | Whether to include Associate sessions for processing |
Returns
Type | Description |
---|---|
System. |
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. |
filePath |
Returns
Type | Description |
---|---|
System. |
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. |
filePath |
Returns
Type | Description |
---|---|
System. |
Load(String, IList<String>)
Loads the specified file session.
Declaration
public IClientSession Load(string fileSession, IList<string> associatesToLoad = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
fileSession | The file session. |
System. |
associatesToLoad | The associates to load |
Returns
Type | Description |
---|---|
IClient |
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. |
files | The files that need to be the summary been loaded |
IFilter | filter | |
System. |
sortCriteria | |
System. |
token | A token to cancel the operation |
System. |
progress |
Returns
Type | Description |
---|---|
System. |
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. |
files | The files that need to be the summary been loaded |
System. |
token | A token to cancel the operation |
System. |
progress |
Returns
Type | Description |
---|---|
System. |
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. |
folderPath | Fully qualified path |
System. |
includeSubdirectories | Recursive or not |
IFilter | filter | |
System. |
sortCriteria | An ordered list of sort field and direction |
System. |
pageNumber | The 1 based page number |
System. |
pageSize | The number of items per page |
System. |
token | A token to cancel the operation |
System. |
progress |
Returns
Type | Description |
---|---|
System. |
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. |
folderPath | Fully qualified path |
System. |
includeSubdirectories | Recursive or not |
System. |
token | A token to cancel the operation |
System. |
progress |
Returns
Type | Description |
---|---|
System. |
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. |
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. |
fileSessionFullPath | The file session full path. |
System. |
connectionString | The connection string. |
System. |
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. |