SessionManager
Overview
This is the abstract base class for all session manager implementations. You will descend from this class when implementing a custom session manager, or use one of the existing descendants.
Location
- Reference: RemObjects.SDK.Server.dll
- Namespace: RemObjects.SDK.Server
- Platforms: .NET Core, .NET Framework, .NET Standard
- Ancestry: Component | SessionManager
constructor protected
constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)
SessionManager(Boolean register, Boolean initializeSessionExpirationTimer)
init(_ register: Boolean, _ initializeSessionExpirationTimer: Boolean)
Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)
Parameters:
- register:
- initializeSessionExpirationTimer:
CreateNewSession protected
method CreateNewSession(sessionId: Guid): ISession
ISession CreateNewSession(Guid sessionId)
func CreateNewSession(_ sessionId: Guid) -> ISession
Function CreateNewSession(sessionId As Guid) As ISession
Parameters:
- sessionId:
DestroySession (ISession)
method DestroySession(session: ISession)
void DestroySession(ISession session)
func DestroySession(_ session: ISession)
Sub DestroySession(session As ISession)
Parameters:
- session:
DestroySession (Guid)
method DestroySession(sessionId: Guid)
void DestroySession(Guid sessionId)
func DestroySession(_ sessionId: Guid)
Sub DestroySession(sessionId As Guid)
Parameters:
- sessionId:
Dispose protected
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
func Dispose(_ disposing: Boolean)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
ExpireSessions
This method will expire all sessions in the Session Manager that have exceeded the timeout. Note: SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.
method ExpireSessions
void ExpireSessions()
func ExpireSessions()
Sub ExpireSessions()
GetAllSessions
method GetAllSessions: IList<Guid>
IList<Guid> GetAllSessions()
func GetAllSessions() -> IList<Guid>
Function GetAllSessions() As IList<Guid>
GetExistingSession
Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.
method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession GetExistingSession(Guid sessionId, Boolean updateTime)
func GetExistingSession(_ sessionId: Guid, _ updateTime: Boolean) -> ISession
Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId: Session Id
- updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated
GetSession
Returns session with provided Id. If there is no session stored with the provided Id then new session is created.
method GetSession(sessionId: Guid): ISession
ISession GetSession(Guid sessionId)
func GetSession(_ sessionId: Guid) -> ISession
Function GetSession(sessionId As Guid) As ISession
Parameters:
- sessionId: Session Id
IsOutOfProcess
property IsOutOfProcess: Boolean read;
Boolean IsOutOfProcess { get; }
var IsOutOfProcess: Boolean { get{} }
ReadOnly Property IsOutOfProcess() As Boolean
LocateExistingSession protected
method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession LocateExistingSession(Guid sessionId, Boolean updateTime)
func LocateExistingSession(_ sessionId: Guid, _ updateTime: Boolean) -> ISession
Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId:
- updateTime:
OnSessionCreated
Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.
event OnSessionCreated: SessionEventHandler
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)
__event SessionEventHandler: OnSessionCreated!
delegate: func OnSessionCreated(_ sender: Object, _ e: SessionEventArgs)
Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)
OnSessionDestroyed
Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.
Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.
event OnSessionDestroyed: SessionIDEventHandler
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)
delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)
__event SessionIDEventHandler: OnSessionDestroyed!
delegate: func OnSessionDestroyed(_ sender: Object, _ e: SessionIDEventArgs)
Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)
OnSessionExpired
Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.
Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.
event OnSessionExpired: SessionEventHandler
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)
__event SessionEventHandler: OnSessionExpired!
delegate: func OnSessionExpired(_ sender: Object, _ e: SessionEventArgs)
Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)
ReleaseSession
method ReleaseSession(session: ISession)
void ReleaseSession(ISession session)
func ReleaseSession(_ session: ISession)
Sub ReleaseSession(session As ISession)
Parameters:
- session:
SessionCount protected
property SessionCount: Int32 read;
Int32 SessionCount { get; }
var SessionCount: Int32 { get{} }
ReadOnly Property SessionCount() As Int32
Timeout
Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).
[DefaultValue(600)]
property Timeout: Int32 read write;
[DefaultValue(600)]
Int32 Timeout { get; set; }
@DefaultValue(600)
var Timeout: Int32 { get{} set{} }
<DefaultValue(600)>
Property Timeout() As Int32
TriggerOnSessionCreated protected
method TriggerOnSessionCreated(e: SessionEventArgs)
void TriggerOnSessionCreated(SessionEventArgs e)
func TriggerOnSessionCreated(_ e: SessionEventArgs)
Sub TriggerOnSessionCreated(e As SessionEventArgs)
Parameters:
- e:
TriggerOnSessionDestroyed protected
method TriggerOnSessionDestroyed(e: SessionIDEventArgs)
void TriggerOnSessionDestroyed(SessionIDEventArgs e)
func TriggerOnSessionDestroyed(_ e: SessionIDEventArgs)
Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)
Parameters:
- e:
TriggerOnSessionExpired protected
method TriggerOnSessionExpired(e: SessionEventArgs)
void TriggerOnSessionExpired(SessionEventArgs e)
func TriggerOnSessionExpired(_ e: SessionEventArgs)
Sub TriggerOnSessionExpired(e As SessionEventArgs)
Parameters:
- e:
IsOutOfProcess
property IsOutOfProcess: Boolean read;
Boolean IsOutOfProcess { get; }
var IsOutOfProcess: Boolean { get{} }
ReadOnly Property IsOutOfProcess() As Boolean
SessionCount protected
property SessionCount: Int32 read;
Int32 SessionCount { get; }
var SessionCount: Int32 { get{} }
ReadOnly Property SessionCount() As Int32
Timeout
Determines the timeout (in seconds) after which sessions will be discarded if they have not been accessed. The default value is 600 seconds (10 minutes).
[DefaultValue(600)]
property Timeout: Int32 read write;
[DefaultValue(600)]
Int32 Timeout { get; set; }
@DefaultValue(600)
var Timeout: Int32 { get{} set{} }
<DefaultValue(600)>
Property Timeout() As Int32
constructor protected
constructor(register: Boolean; initializeSessionExpirationTimer: Boolean)
SessionManager(Boolean register, Boolean initializeSessionExpirationTimer)
init(_ register: Boolean, _ initializeSessionExpirationTimer: Boolean)
Sub New(register As Boolean, initializeSessionExpirationTimer As Boolean)
Parameters:
- register:
- initializeSessionExpirationTimer:
CreateNewSession protected
method CreateNewSession(sessionId: Guid): ISession
ISession CreateNewSession(Guid sessionId)
func CreateNewSession(_ sessionId: Guid) -> ISession
Function CreateNewSession(sessionId As Guid) As ISession
Parameters:
- sessionId:
DestroySession (ISession)
method DestroySession(session: ISession)
void DestroySession(ISession session)
func DestroySession(_ session: ISession)
Sub DestroySession(session As ISession)
Parameters:
- session:
DestroySession (Guid)
method DestroySession(sessionId: Guid)
void DestroySession(Guid sessionId)
func DestroySession(_ sessionId: Guid)
Sub DestroySession(sessionId As Guid)
Parameters:
- sessionId:
Dispose protected
method Dispose(disposing: Boolean)
void Dispose(Boolean disposing)
func Dispose(_ disposing: Boolean)
Sub Dispose(disposing As Boolean)
Parameters:
- disposing:
ExpireSessions
This method will expire all sessions in the Session Manager that have exceeded the timeout. Note: SessionManager will regularly check for expired sessions automatically, but you can use this method to trigger an expiration cycle manually.
method ExpireSessions
void ExpireSessions()
func ExpireSessions()
Sub ExpireSessions()
GetAllSessions
method GetAllSessions: IList<Guid>
IList<Guid> GetAllSessions()
func GetAllSessions() -> IList<Guid>
Function GetAllSessions() As IList<Guid>
GetExistingSession
Returns existing session with provided Id or null in case the session cannot be found. Depending on the updateTime parameter value updates the session's LastaccessedTime attribute.
method GetExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession GetExistingSession(Guid sessionId, Boolean updateTime)
func GetExistingSession(_ sessionId: Guid, _ updateTime: Boolean) -> ISession
Function GetExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId: Session Id
- updateTime: Flag indicating whether session's LastAccessedTime attribute should be updated
GetSession
Returns session with provided Id. If there is no session stored with the provided Id then new session is created.
method GetSession(sessionId: Guid): ISession
ISession GetSession(Guid sessionId)
func GetSession(_ sessionId: Guid) -> ISession
Function GetSession(sessionId As Guid) As ISession
Parameters:
- sessionId: Session Id
LocateExistingSession protected
method LocateExistingSession(sessionId: Guid; updateTime: Boolean): ISession
ISession LocateExistingSession(Guid sessionId, Boolean updateTime)
func LocateExistingSession(_ sessionId: Guid, _ updateTime: Boolean) -> ISession
Function LocateExistingSession(sessionId As Guid, updateTime As Boolean) As ISession
Parameters:
- sessionId:
- updateTime:
ReleaseSession
method ReleaseSession(session: ISession)
void ReleaseSession(ISession session)
func ReleaseSession(_ session: ISession)
Sub ReleaseSession(session As ISession)
Parameters:
- session:
TriggerOnSessionCreated protected
method TriggerOnSessionCreated(e: SessionEventArgs)
void TriggerOnSessionCreated(SessionEventArgs e)
func TriggerOnSessionCreated(_ e: SessionEventArgs)
Sub TriggerOnSessionCreated(e As SessionEventArgs)
Parameters:
- e:
TriggerOnSessionDestroyed protected
method TriggerOnSessionDestroyed(e: SessionIDEventArgs)
void TriggerOnSessionDestroyed(SessionIDEventArgs e)
func TriggerOnSessionDestroyed(_ e: SessionIDEventArgs)
Sub TriggerOnSessionDestroyed(e As SessionIDEventArgs)
Parameters:
- e:
TriggerOnSessionExpired protected
method TriggerOnSessionExpired(e: SessionEventArgs)
void TriggerOnSessionExpired(SessionEventArgs e)
func TriggerOnSessionExpired(_ e: SessionEventArgs)
Sub TriggerOnSessionExpired(e As SessionEventArgs)
Parameters:
- e:
OnSessionCreated
Gets triggered after a new Session has been created. You can use it to perform initialization functions or fill the session with default values.
event OnSessionCreated: SessionEventHandler
delegate: method OnSessionCreated(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionCreated()
delegate: void OnSessionCreated(Object sender, SessionEventArgs e)
__event SessionEventHandler: OnSessionCreated!
delegate: func OnSessionCreated(_ sender: Object, _ e: SessionEventArgs)
Event OnSessionCreated As SessionEventHandler
delegate: Sub OnSessionCreated(sender As Object, e As SessionEventArgs)
OnSessionDestroyed
Gets triggered after a new Session has been manually destroyed. You can use it to perform cleanup for a specific session id.
Note: The session has already been Disposed when the OnSessionDestroyed event fires. This event will not fire for sessions that expire.
event OnSessionDestroyed: SessionIDEventHandler
delegate: method OnSessionDestroyed(sender: Object; e: SessionIDEventArgs)
delegate SessionIDEventHandler OnSessionDestroyed()
delegate: void OnSessionDestroyed(Object sender, SessionIDEventArgs e)
__event SessionIDEventHandler: OnSessionDestroyed!
delegate: func OnSessionDestroyed(_ sender: Object, _ e: SessionIDEventArgs)
Event OnSessionDestroyed As SessionIDEventHandler
delegate: Sub OnSessionDestroyed(sender As Object, e As SessionIDEventArgs)
OnSessionExpired
Gets triggered after a new Session has been expired. You can use it to perform cleanup and/or inspect the values of the expired session.
Note: The session has already been Disposed when the OnSessionExpired event fires. This event will not fire for sessions that are manually destroyed.
event OnSessionExpired: SessionEventHandler
delegate: method OnSessionExpired(sender: Object; e: SessionEventArgs)
delegate SessionEventHandler OnSessionExpired()
delegate: void OnSessionExpired(Object sender, SessionEventArgs e)
__event SessionEventHandler: OnSessionExpired!
delegate: func OnSessionExpired(_ sender: Object, _ e: SessionEventArgs)
Event OnSessionExpired As SessionEventHandler
delegate: Sub OnSessionExpired(sender As Object, e As SessionEventArgs)