Interface ISoContextProvider
Interface that needs to be implemented by plug-ins handling the internal NetServer context.
Plug-ins implemented with this interface needs to be mareked with the
Namespace: SuperOffice.Security.Principal
Assembly: SoCore.dll
Syntax
public interface ISoContextProvider
Properties
InheritSynchronizationContextInThreadManager
Interface that needs to be implemented by plug-ins handling the internal NetServer context.
Plug-ins implemented with this interface needs to be mareked with the
Declaration
bool InheritSynchronizationContextInThreadManager { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetCurrentPrincipal()
This method will be called every time the current context is required by anybody in NetServer
Declaration
IPrincipal GetCurrentPrincipal()
Returns
Type | Description |
---|---|
IPrincipal | Current principal as required by NetServer. |
Remarks
This method might be called from any thread. This means that worker threads will call it in addition to threads held by the application (i.e. IIS).
Implementations can call the IsWorkerThread to check if the thread has been executed by the ThreadManager. This will be the case for all worker threads initiated automatically within NetServer.
SetCurrentPrincipal(IPrincipal)
This method is called every time the current context needs to be stored.
Declaration
void SetCurrentPrincipal(IPrincipal principal)
Parameters
Type | Name | Description |
---|---|---|
IPrincipal | principal |
Remarks
This method will be called when a user authenticates or continues a session.
It will be called with a NULL value when a user closes or suspends his session.
This method might be called from any thread. This means that worker threads will call it in addition to threads held by the application (i.e. IIS).
Implementations can call the IsWorkerThread to check if the thread has been executed by the ThreadManager. This will be the case for all worker threads initiated automatically within NetServer.
It is safe to serialize and de-serialize the value of the context.