C# 클래스 GSF.Security.UserDataCache

Represents a secured inter-process cache for a Dictionary{TKey,TValue} of serialized UserData.
This is a personal user data cache that only contains basic LDAP information for the user. It is used to load the local and Active Directory groups a user is associated with when the user no longer has access to its domain server. This can happen when a laptop that is normally connected to the Active Directory domain gets shutdown then restarted without access to the domain, for example, on an airplane - in this mode the user can successfully still login to the laptop to their using domain account cached by Windows but the groups the user is in will no longer be accessible. If role based security happens to be based on Active Directory groups, this cache will make sure the user can still have needed role based access even when the domain is unavailable. This cache is maintained as a separate user cache from the system level AdoSecurityCache since the user data cache only contains group information and is used by the LdapSecurityProvider which can be used independently of the AdoSecurityProvider.
상속: GSF.IO.InterprocessCache
파일 보기 프로젝트 열기: GridProtectionAlliance/gsf 1 사용 예제들

공개 메소드들

메소드 설명
GetCurrentCache ( int providerID ) : UserDataCache

Loads the UserDataCache for the current local user.

Save ( ) : void

Initiates inter-process synchronized save of user data cache.

SaveUserData ( string loginID, GSF.Security.UserData userData ) : void

Serializes the userData for the given loginID into the UserDataCache.

This will add an entry into the user data cache for loginID if it doesn't exist; otherwise existing entry will be updated.

Updates are automatically queued up for serialization so user does not need to call Save.

TryGetUserData ( string loginID, GSF.Security.UserData &userData ) : bool

Attempts to retrieve UserData for given loginID.

UserDataCache ( int providerID = LdapSecurityProvider.ProviderID ) : System

Creates a new instance of the UserDataCache.

UserDataCache ( int providerID, int maximumConcurrentLocks ) : System

Creates a new instance of the UserDataCache with the specified number of maximumConcurrentLocks.

this ( string loginID ) : GSF.Security.UserData

Gets or sets UserData for given loginID.

보호된 메소드들

메소드 설명
HashLoginID ( string loginID ) : string

Calculates the hash of the loginID used as the key for the user data cache.

For added security, a hash of the loginID is used as the key for UserData in the user data cache instead of the actual loginID. This method allows the consumer to properly calculate this hash when directly using the user data cache.

LoadFileData ( FileStream fileStream ) : byte[]

Handles deserialization of file from disk; virtual method allows customization (e.g., pre-load decryption and/or data merge).

Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.

SaveFileData ( FileStream fileStream, byte fileData ) : void

Handles serialization of file to disk; virtual method allows customization (e.g., pre-save encryption and/or data merge).

Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.

비공개 메소드들

메소드 설명
DeserializeCache ( byte data ) : UserData>.Dictionary
SerializeCache ( UserData>.Dictionary cache ) : byte[]
WaitForDataReady ( ) : void

메소드 상세

GetCurrentCache() 공개 정적인 메소드

Loads the UserDataCache for the current local user.
public static GetCurrentCache ( int providerID ) : UserDataCache
providerID int Unique security provider ID used to distinguish cached user data that may be different based on provider.
리턴 UserDataCache

HashLoginID() 보호된 메소드

Calculates the hash of the loginID used as the key for the user data cache.
For added security, a hash of the loginID is used as the key for UserData in the user data cache instead of the actual loginID. This method allows the consumer to properly calculate this hash when directly using the user data cache.
protected HashLoginID ( string loginID ) : string
loginID string Login ID to hash.
리턴 string

LoadFileData() 보호된 메소드

Handles deserialization of file from disk; virtual method allows customization (e.g., pre-load decryption and/or data merge).
Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.
protected LoadFileData ( FileStream fileStream ) : byte[]
fileStream System.IO.FileStream used to deserialize data.
리턴 byte[]

Save() 공개 메소드

Initiates inter-process synchronized save of user data cache.
public Save ( ) : void
리턴 void

SaveFileData() 보호된 메소드

Handles serialization of file to disk; virtual method allows customization (e.g., pre-save encryption and/or data merge).
Consumers overriding this method should not directly call InterprocessCache.FileData property to avoid potential dead-locks.
protected SaveFileData ( FileStream fileStream, byte fileData ) : void
fileStream System.IO.FileStream used to serialize data.
fileData byte File data to be serialized.
리턴 void

SaveUserData() 공개 메소드

Serializes the userData for the given loginID into the UserDataCache.

This will add an entry into the user data cache for loginID if it doesn't exist; otherwise existing entry will be updated.

Updates are automatically queued up for serialization so user does not need to call Save.

public SaveUserData ( string loginID, GSF.Security.UserData userData ) : void
loginID string Login ID of associated to retrieve.
userData GSF.Security.UserData Reference to object to serialize into .
리턴 void

TryGetUserData() 공개 메소드

Attempts to retrieve UserData for given loginID.
public TryGetUserData ( string loginID, GSF.Security.UserData &userData ) : bool
loginID string Login ID of associated to retrieve.
userData GSF.Security.UserData Reference to object to populate if found.
리턴 bool

UserDataCache() 공개 메소드

Creates a new instance of the UserDataCache.
public UserDataCache ( int providerID = LdapSecurityProvider.ProviderID ) : System
providerID int Unique provider ID used to distinguish cached user data that may be different based on provider.
리턴 System

UserDataCache() 공개 메소드

Creates a new instance of the UserDataCache with the specified number of maximumConcurrentLocks.
public UserDataCache ( int providerID, int maximumConcurrentLocks ) : System
providerID int Unique provider ID used to distinguish cached user data that may be different based on provider.
maximumConcurrentLocks int Maximum concurrent reader locks to allow.
리턴 System

this() 공개 메소드

Gets or sets UserData for given loginID.
public this ( string loginID ) : GSF.Security.UserData
loginID string Login ID of associated to load or save.
리턴 GSF.Security.UserData