Diffusion .NET Client Library
6.1.5
|
A client session with a server or servers. More...
Public Member Functions | |
void | Close () |
Close the session. More... | |
Properties | |
ISessionId | SessionId [get] |
Returns the unique identifier for the session as assigned by the (first) server it connects to. More... | |
string | Principal [get] |
Returns the name of the security principal associated with the session. More... | |
ISessionAttributes | Attributes [get] |
Returns the session attributes. More... | |
SessionState | State [get] |
Returns the current state of the session. More... | |
ITopics | Topics [get] |
Gets the 'Topics' feature. More... | |
IPings | Ping [get] |
Gets the 'Ping' feature. More... | |
ITopicControl | TopicControl [get] |
Gets the 'Topic Control' feature. More... | |
ISubscriptionControl | SubscriptionControl [get] |
Gets the 'Subscription Control' feature. More... | |
IAuthenticationControl | AuthenticationControl [get] |
Gets the 'Authentication Control' feature. More... | |
ISystemAuthenticationControl | SystemAuthenticationControl [get] |
Gets the 'System Authentication Control' feature. More... | |
ISecurity | Security [get] |
Gets the 'Security' feature. More... | |
ITopicUpdateControl | TopicUpdateControl [get] |
Gets the 'Topic Update Control' feature. More... | |
IMessaging | Messaging [get] |
Gets the 'Messaging' feature. More... | |
IMessagingControl | MessagingControl [get] |
Gets the 'Messaging Control' feature. More... | |
IClientControl | ClientControl [get] |
Gets the 'Client Control' feature. More... | |
ISecurityControl | SecurityControl [get] |
Gets the 'Security Control' feature. More... | |
ITimeSeries | TimeSeries [get] |
Gets the 'Time Series' feature. More... | |
ITopicNotifications | TopicNotifications [get] |
Gets the 'Topic Notifications' feature. More... | |
Events | |
EventHandler < SessionListenerEventArgs > | StateChanged |
Notifies when the session state changes. More... | |
EventHandler < SessionErrorHandlerEventArgs > | ErrorNotified |
Notifies when an error occurs. More... | |
A client session with a server or servers.
To open a new session connection to a server, use ISessionFactory.Open(string) specifying the server url. There is also a non-blocking version ISessionFactory.Open(string,ISessionOpenCallback) which calls back when the session has been connected.
The factory allows a number of other attributes of the session to be specified.
The functionality of a session is exposed to the application by getting the required feature(s) using the various retrieval methods.
For each session there is a single instance of each feature which may be obtained and used at any time.
Session properties
Every session has a number of fixed properties associated with it and may also have additional user-defined properties assigned to it by AuthenticationHandler authentication handlers}.
Properties are essentially key/value pairs. A property is identified by its key. All property keys must be alphanumeric, starting with an alphabetic and are case sensitive. Embedded whitespace is not allowed.
All fixed properties are identified by a '$' prefix. The currently available fixed session properties are:
Fixed Property Key | Property Description |
$SessionId | The session identifier. Equivalent to ISessionId.ToString(). |
$Principal | The session principal. Equivalent to ClientSummary.Principal . |
$ClientType | The client type of the session. Equivalent to ClientSummary.ClientType. |
$Transport | The session transport type. Equivalent to ClientSummary.TransportType. |
$Connector | The name of the connector on which the client connected. See ISessionDetails.ConnectorName. |
$Country | The session's country code. See ICountryDetails.Country. |
$Language | The session's language code. See ICountryDetails.Language. |
$ServerName | The name of the session's server. See ISessionDetails.ServerName. |
$ClientIP | The session's address. See IClientLocation.Address. |
$Latitude | The session's latitude, if available. See ClientLocation.Coordinates. |
$Longitude | The session's longitude, if available. See ClientLocation.Coordinates. |
$StartTime | The session's start time in milliseconds since the epoch. |
Any additional properties assigned must not be prefixed by '$' and should not have embedded whitespace in the name.
When registering to receive session properties special key values of SessionControlConstants.AllFixedProperties and SessionControlConstants.AllUserProperties may be used.
Session filters Session filters are a mechanism for accessing sessions by means of a query expression. For example, it is possible to send a message to all sessions that satisfy a specified filter. Filters are parsed and evaluated at the server.
A session filter query consists of either a single search clause (example 1) or multiple search clauses connected by boolean operators (example 2):
Search clauses may be linked by the boolean operators and or or. 'and' takes precedence over 'or' but parentheses may be used to override the precedence as follows:
(Department is "Accounts" or Department is "Payroll") and Status is "Closed"
The boolean not operator may be used to negate the following clause or an expression within parentheses:
A search clause takes the form:
key operator value
Where key is the name of a session property and value is the property value. Only string values are currently supported and must be enclosed within either single or double quotes.
Supported operators are as follows:
Operator | Description |
is or eq | equals |
ne | not equals |
All operators are case insensitive.
The following are examples of valid expressions:
$Principal is "Alice" Department is "Accounts" and $Country ne "US" $Language EQ "en" and $Country NE "US" not (Department is "Accounts" or "Department is "Payroll") and $Country is "FR"
Since 5.1
void PushTechnology.ClientInterface.Client.Session.ISession.Close | ( | ) |
Close the session.
Has no effect if the session is already closed.
|
get |
Returns the session attributes.
|
get |
Gets the 'Authentication Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Client Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Messaging' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Messaging Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Ping' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Returns the name of the security principal associated with the session.
|
get |
Gets the 'Security' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Security Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Returns the unique identifier for the session as assigned by the (first) server it connects to.
|
get |
Returns the current state of the session.
|
get |
Gets the 'Subscription Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'System Authentication Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Time Series' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
Added in version 6.1.
|
get |
Gets the 'Topic Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Topic Notifications' feature.
Added in version 6.1.
|
get |
Gets the 'Topics' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
|
get |
Gets the 'Topic Update Control' feature.
This may be used to get the feature and it will automatically instantiate the feature the first time it is called.
EventHandler<SessionErrorHandlerEventArgs> PushTechnology.ClientInterface.Client.Session.ISession.ErrorNotified |
Notifies when an error occurs.
EventHandler<SessionListenerEventArgs> PushTechnology.ClientInterface.Client.Session.ISession.StateChanged |
Notifies when the session state changes.