C# 클래스 Raven.AspNet.SessionState.RavenSessionStateStoreProvider

An ASP.NET session-state store-provider implementation (http://msdn.microsoft.com/en-us/library/ms178588.aspx) using RavenDb (http://ravendb.net) for persistence.
상속: System.Web.SessionState.SessionStateStoreProviderBase, IDisposable
파일 보기 프로젝트 열기: MJRichardson/RavenDbSessionStateStoreProvider 1 사용 예제들

Private Properties

프로퍼티 타입 설명
Deserialize System.Web.SessionState.SessionStateStoreData
GetSessionStaticObjects System.Web.HttpStaticObjectsCollection
GetSessionStoreItem System.Web.SessionState.SessionStateStoreData
Initialize void
Serialize string

공개 메소드들

메소드 설명
CreateNewStoreData ( HttpContext context, int timeout ) : System.Web.SessionState.SessionStateStoreData

returns a new SessionStateStoreData object with an empty ISessionStateItemCollection object, an HttpStaticObjectsCollection collection, and the specified Timeout value.

CreateUninitializedItem ( HttpContext context, string sessionId, int timeout ) : void

Adds an uninitialized item to the session data store.

Dispose ( ) : void
EndRequest ( HttpContext context ) : void

Performs any cleanup required by your session-state store provider.

GetItem ( HttpContext context, string sessionId, bool &locked, System.TimeSpan &lockAge, object &lockId, SessionStateActions &actions ) : System.Web.SessionState.SessionStateStoreData

This method performs the same work as the GetItemExclusive method, except that it does not attempt to lock the session item in the data store.

GetItemExclusive ( HttpContext context, string sessionId, bool &locked, System.TimeSpan &lockAge, object &lockId, SessionStateActions &actions ) : System.Web.SessionState.SessionStateStoreData

Retrieves session values and information from the session data store and locks the session-item data at the data store for the duration of the request.

Initialize ( string name, System config ) : void
InitializeRequest ( HttpContext context ) : void

Performs any initialization required by your session-state store provider.

RavenSessionStateStoreProvider ( ) : System

Public parameterless constructor

RavenSessionStateStoreProvider ( IDocumentStore documentStore ) : System

Constructor accepting a document store instance, used for testing.

ReleaseItemExclusive ( HttpContext context, string sessionId, object lockId ) : void

Releases the lock on an item in the session data store.

RemoveItem ( HttpContext context, string sessionId, object lockId, System.Web.SessionState.SessionStateStoreData item ) : void

deletes the session information from the data store where the data store item matches the supplied SessionID value, the current application, and the supplied lock identifier.

ResetItemTimeout ( HttpContext context, string sessionId ) : void

Resets the expiry timeout for a session item.

SetAndReleaseItemExclusive ( HttpContext context, string sessionId, System.Web.SessionState.SessionStateStoreData item, object lockId, bool newItem ) : void

If the newItem parameter is true, the SetAndReleaseItemExclusive method inserts a new item into the data store with the supplied values. Otherwise, the existing item in the data store is updated with the supplied values, and any lock on the data is released.

SetItemExpireCallback ( SessionStateItemExpireCallback expireCallback ) : bool

Takes as input a delegate that references the Session_OnEnd event defined in the Global.asax file. If the session-state store provider supports the Session_OnEnd event, a local reference to the SessionStateItemExpireCallback parameter is set and the method returns true; otherwise, the method returns false.

비공개 메소드들

메소드 설명
Deserialize ( HttpContext context, string serializedItems, int timeout ) : System.Web.SessionState.SessionStateStoreData
GetSessionStaticObjects ( HttpContext context ) : System.Web.HttpStaticObjectsCollection
GetSessionStoreItem ( bool lockRecord, HttpContext context, string sessionId, bool &locked, System.TimeSpan &lockAge, object &lockId, SessionStateActions &actionFlags ) : System.Web.SessionState.SessionStateStoreData
Initialize ( string name, System config, IDocumentStore documentStore ) : void
Serialize ( System.Web.SessionState.SessionStateItemCollection items ) : string

메소드 상세

CreateNewStoreData() 공개 메소드

returns a new SessionStateStoreData object with an empty ISessionStateItemCollection object, an HttpStaticObjectsCollection collection, and the specified Timeout value.
public CreateNewStoreData ( HttpContext context, int timeout ) : System.Web.SessionState.SessionStateStoreData
context System.Web.HttpContext The HttpContext instance for the current request
timeout int The expiry timeout in minutes.
리턴 System.Web.SessionState.SessionStateStoreData

CreateUninitializedItem() 공개 메소드

Adds an uninitialized item to the session data store.
public CreateUninitializedItem ( HttpContext context, string sessionId, int timeout ) : void
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
timeout int The expiry timeout in minutes.
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

EndRequest() 공개 메소드

Performs any cleanup required by your session-state store provider.
public EndRequest ( HttpContext context ) : void
context System.Web.HttpContext The HttpContext instance for the current request
리턴 void

GetItem() 공개 메소드

This method performs the same work as the GetItemExclusive method, except that it does not attempt to lock the session item in the data store.
public GetItem ( HttpContext context, string sessionId, bool &locked, System.TimeSpan &lockAge, object &lockId, SessionStateActions &actions ) : System.Web.SessionState.SessionStateStoreData
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
locked bool An output parameter indicating whether the item is currently exclusively locked.
lockAge System.TimeSpan The age of the exclusive lock (if present)
lockId object The identifier of the exclusive lock (if present)
actions SessionStateActions Used with sessions whose Cookieless property is true, /// when the regenerateExpiredSessionId attribute is set to true. /// An actionFlags value set to InitializeItem (1) indicates that the entry in the session data store is a /// new session that requires initialization.
리턴 System.Web.SessionState.SessionStateStoreData

GetItemExclusive() 공개 메소드

Retrieves session values and information from the session data store and locks the session-item data at the data store for the duration of the request.
public GetItemExclusive ( HttpContext context, string sessionId, bool &locked, System.TimeSpan &lockAge, object &lockId, SessionStateActions &actions ) : System.Web.SessionState.SessionStateStoreData
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
locked bool An output parameter indicating whether the item is currently exclusively locked.
lockAge System.TimeSpan The age of the exclusive lock (if present)
lockId object The identifier of the exclusive lock (if present)
actions SessionStateActions Used with sessions whose Cookieless property is true, /// when the regenerateExpiredSessionId attribute is set to true. /// An actionFlags value set to InitializeItem (1) indicates that the entry in the session data store is a /// new session that requires initialization.
리턴 System.Web.SessionState.SessionStateStoreData

Initialize() 공개 메소드

public Initialize ( string name, System config ) : void
name string
config System
리턴 void

InitializeRequest() 공개 메소드

Performs any initialization required by your session-state store provider.
public InitializeRequest ( HttpContext context ) : void
context System.Web.HttpContext The HttpContext instance for the current request
리턴 void

RavenSessionStateStoreProvider() 공개 메소드

Public parameterless constructor
public RavenSessionStateStoreProvider ( ) : System
리턴 System

RavenSessionStateStoreProvider() 공개 메소드

Constructor accepting a document store instance, used for testing.
public RavenSessionStateStoreProvider ( IDocumentStore documentStore ) : System
documentStore IDocumentStore
리턴 System

ReleaseItemExclusive() 공개 메소드

Releases the lock on an item in the session data store.
public ReleaseItemExclusive ( HttpContext context, string sessionId, object lockId ) : void
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
lockId object The lock identifier for the current request.
리턴 void

RemoveItem() 공개 메소드

deletes the session information from the data store where the data store item matches the supplied SessionID value, the current application, and the supplied lock identifier.
public RemoveItem ( HttpContext context, string sessionId, object lockId, System.Web.SessionState.SessionStateStoreData item ) : void
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
lockId object The exclusive-lock identifier.
item System.Web.SessionState.SessionStateStoreData
리턴 void

ResetItemTimeout() 공개 메소드

Resets the expiry timeout for a session item.
public ResetItemTimeout ( HttpContext context, string sessionId ) : void
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
리턴 void

SetAndReleaseItemExclusive() 공개 메소드

If the newItem parameter is true, the SetAndReleaseItemExclusive method inserts a new item into the data store with the supplied values. Otherwise, the existing item in the data store is updated with the supplied values, and any lock on the data is released.
public SetAndReleaseItemExclusive ( HttpContext context, string sessionId, System.Web.SessionState.SessionStateStoreData item, object lockId, bool newItem ) : void
context System.Web.HttpContext The HttpContext instance for the current request
sessionId string The session identifier.
item System.Web.SessionState.SessionStateStoreData The current session values to be stored
lockId object The lock identifier for the current request.
newItem bool If true, a new item is inserted into the store. Otherwise, the existing item in /// the data store is updated with the supplied values, and any lock on the data is released.
리턴 void

SetItemExpireCallback() 공개 메소드

Takes as input a delegate that references the Session_OnEnd event defined in the Global.asax file. If the session-state store provider supports the Session_OnEnd event, a local reference to the SessionStateItemExpireCallback parameter is set and the method returns true; otherwise, the method returns false.
public SetItemExpireCallback ( SessionStateItemExpireCallback expireCallback ) : bool
expireCallback SessionStateItemExpireCallback A callback.
리턴 bool