Class FileSystemSession
Represents a user-impersonated session of working with a file system. This class is NOT thread-safe
Inheritance
System.Object
FileSystemSession
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
public class FileSystemSession : DisposableObject, IDisposable, INamed
Constructors
FileSystemSession(FileSystem, IFileSystemHandle, FileSystemSessionConnectParams)
Starts new file system session
Declaration
protected FileSystemSession(FileSystem fs, IFileSystemHandle handle, FileSystemSessionConnectParams cParams)
Parameters
Fields
m_FileSystem
Declaration
protected readonly FileSystem m_FileSystem
Field Value
m_Handle
Declaration
protected readonly IFileSystemHandle m_Handle
Field Value
m_Items
Declaration
protected readonly List<FileSystemSessionItem> m_Items
Field Value
m_Name
Declaration
protected readonly string m_Name
Field Value
Type |
Description |
System.String |
|
m_TransactionHandle
Declaration
protected IFileSystemTransactionHandle m_TransactionHandle
Field Value
m_User
Declaration
protected readonly User m_User
Field Value
Properties
FileSystem
Returns file system instance that this session operates under
Declaration
public FileSystem FileSystem { get; }
Property Value
Handle
Returns file system handle for this session
Declaration
public IFileSystemHandle Handle { get; }
Property Value
Item[String]
Navigates to the specified path
Declaration
public FileSystemSessionItem this[string path] { get; }
Parameters
Type |
Name |
Description |
System.String |
path |
Path to navigate to
|
Property Value
Type |
Description |
FileSystemSessionItem |
FileSystemSessionItem instance - a directory or a file or null if it does not exist
|
Items
Returns file system items initialized through this session
Declaration
public IEnumerable<FileSystemSessionItem> Items { get; }
Property Value
LatestVersion
Returns latest version for file systems that support versioning, null otherwise
Declaration
public virtual IFileSystemVersion LatestVersion { get; }
Property Value
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
SecurityManager
Returns security manager that services this file system session. This may be useful in cases when file system implements
its own permission structure and user directory
Declaration
public virtual ISecurityManager SecurityManager { get; }
Property Value
TransactionHandle
Returns transaction object if transaction has been started or null
Declaration
public IFileSystemTransactionHandle TransactionHandle { get; }
Property Value
UniqueSequenceProvider
Returns unique sequence provider for the system or null if it is not supported
Declaration
public virtual IUniqueSequenceProvider UniqueSequenceProvider { get; }
Property Value
User
Returns user that this file system session is for
Declaration
public User User { get; }
Property Value
Version
Gets/sets version of the file system that this session works against (a changeset that session "sees")
Declaration
public virtual IFileSystemVersion Version { get; set; }
Property Value
Methods
BeginTransaction()
Starts a transaction returning its' transaction handle object, otherwise does nothing
Declaration
public IFileSystemTransactionHandle BeginTransaction()
Returns
BeginTransactionAsync()
Declaration
public Task<IFileSystemTransactionHandle> BeginTransactionAsync()
Returns
CheckDisposed()
Declaration
protected void CheckDisposed()
CommitTransaction()
Commits active transaction, does nothing otherwise
Declaration
public void CommitTransaction()
CommitTransactionAsync()
Declaration
public Task CommitTransactionAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Destructor()
Declaration
protected override void Destructor()
Overrides
GetItemAsync(String)
Async version of Item(string)
Declaration
public Task<FileSystemSessionItem> GetItemAsync(string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
GetLatestVersionAsync()
Async version of LatestVersion
Declaration
public virtual Task<IFileSystemVersion> GetLatestVersionAsync()
Returns
GetVersions(IFileSystemVersion, Int32)
Returns specified number of versions going back from the specific version. This call is thread-safe
Declaration
public virtual IEnumerable<IFileSystemVersion> GetVersions(IFileSystemVersion from, int countBack)
Parameters
Returns
GetVersionsAsync(IFileSystemVersion, Int32)
Declaration
public virtual Task<IEnumerable<IFileSystemVersion>> GetVersionsAsync(IFileSystemVersion from, int countBack)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<IFileSystemVersion>> |
|
RollbackTransaction()
Cancels active transaction changes, does nothing otherwise
Declaration
public void RollbackTransaction()
RollbackTransactionAsync()
Declaration
public Task RollbackTransactionAsync()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SetFileSystemVersionAsync(IFileSystemVersion)
Declaration
public virtual Task SetFileSystemVersionAsync(IFileSystemVersion version)
Parameters
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
ValidateConnectParams(FileSystemSessionConnectParams)
Declaration
protected virtual void ValidateConnectParams(FileSystemSessionConnectParams cParams)
Parameters
Implements
System.IDisposable
Extension Methods