Diffusion .NET Client Library
6.1.5
|
This feature provides the ability for a client session to control other client sessions. More...
Public Member Functions | |
void | SetSessionPropertiesListener (ISessionPropertiesListener listener, params string[] requiredProperties) |
Register a listener that will be notified when client sessions are opened, disconnected, reconnected, closed or when selected session property values are updated. More... | |
void | GetSessionProperties (ISessionId sessionId, List< string > requiredProperties, ISessionPropertiesCallback callback) |
Query the server for property values of a specified client session. More... | |
void | GetSessionProperties< TC > (ISessionId sessionId, List< string > requiredProperties, TC context, ISessionPropertiesContextCallback< TC > callback) |
Query the server for property values of a specified client session. More... | |
Task< IReadOnlyDictionary < string, string > > | SetSessionPropertiesAsync (ISessionId sessionId, Dictionary< string, string > properties) |
Send a request to the server to change the user-defined session properties for a session. More... | |
Task< IReadOnlyDictionary < string, string > > | SetSessionPropertiesAsync (ISessionId sessionId, Dictionary< string, string > properties, CancellationToken cancellationToken) |
Send a request to the server to change the user-defined session properties for a session. More... | |
Task< object > | SetSessionPropertiesAsync (string filter, Dictionary< string, string > properties) |
Send a request to the server to set all sessions that satisfy a session filter with the new user-defined session properties. More... | |
Task< object > | SetSessionPropertiesAsync (string filter, Dictionary< string, string > properties, CancellationToken cancellationToken) |
Send a request to the server to set all sessions that satisfy a session filter with the new user-defined session properties. More... | |
void | SetQueueEventHandler (IQueueEventHandler handler) |
Register a handler for client queue threshold events. Each controller session may register a handler. For each event, the server will select a single handler. More... | |
void | Close (ISessionId clientSessionId, IClientCallback callback) |
Close a client session. More... | |
void | Close< TC > (ISessionId clientSessionId, TC context, IClientContextCallback< TC > callback) |
Close a client session with a contextual callback. More... | |
void | SetConflated (ISessionId clientSessionId, bool conflate, IClientCallback callback) |
Control client queue conflation. More... | |
void | SetConflated< TC > (ISessionId clientSessionId, bool conflate, TC context, IClientContextCallback< TC > callback) |
Control client queue conflation with a contextual callback. More... | |
void | SetThrottled (ISessionId clientSessionId, ThrottlerType throttlerType, int throttlingLimit, IClientCallback callback) |
Instruct a client to throttle the queue according to the provided parameters. More... | |
void | SetThrottled< TC > (ISessionId clientSessionId, ThrottlerType throttlerType, int throttlingLimit, TC context, IClientContextCallback< TC > callback) |
Instruct a client to throttle the queue according to the provided parameters. More... | |
ISessionId | SessionIdFromString (string sessionIdAsString) |
Restore a SessionId from a string. More... | |
Additional Inherited Members | |
Properties inherited from PushTechnology.ClientInterface.Client.Features.IFeature | |
ISession | Session [get] |
Returns the session that the feature is associated with. More... | |
This feature provides the ability for a client session to control other client sessions.
It allows for notifications of client sessions starting and closing as well as the ability to manage clients (forcibly closing them etc.).
Access Control
A session must have GlobalPermission.VIEW_SESSION permission to be able to listen for notifications using SetSessionPropertiesListener or GetSessionProperties of other sessions or listen for SetQueueEventHandler queue events. In addition GlobalPermission.REGISTER_HANDLER permission is required to set a session properties listener, a session details listener or queue event handler.
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.Close | ( | ISessionId | clientSessionId, |
IClientCallback | callback | ||
) |
Close a client session.
clientSessionId | The client session to close. |
callback | the operation callback. |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.Close< TC > | ( | ISessionId | clientSessionId, |
TC | context, | ||
IClientContextCallback< TC > | callback | ||
) |
Close a client session with a contextual callback.
clientSessionId | The client session to close. |
context | the context object to pass to the callback. |
callback | the operation callback. |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.GetSessionProperties | ( | ISessionId | sessionId, |
List< string > | requiredProperties, | ||
ISessionPropertiesCallback | callback | ||
) |
Query the server for property values of a specified client session.
sessionId | Identifies the client session. |
requiredProperties | Specifies the keys of the property values required. See ISession for a list of the available fixed property keys. To request all fixed properties, SessionControlConstants.AllFixedProperties should be included as a key and any other fixed property keys would be ignored. To request all user properties, SessionControlConstants.AllUserProperties should be included as a key and any other user property keys would be ignored. |
callback | Called with the response. |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.GetSessionProperties< TC > | ( | ISessionId | sessionId, |
List< string > | requiredProperties, | ||
TC | context, | ||
ISessionPropertiesContextCallback< TC > | callback | ||
) |
Query the server for property values of a specified client session.
TC | The context object type. |
sessionId | Identifies the client session. |
requiredProperties | Specifies the keys of the property values required. See ISession for a list of the available fixed property keys. To request all fixed properties, SessionControlConstants.AllFixedProperties may be included as a key in which case any other fixed property keys would be ignored. To request all user properties, SessionControlConstants.AllUserProperties can be included as a key in which case any other user property keys would be ignored. |
context | Passed to the callback to allow requests and responses to be correlated. The caller can use any convenient object reference, including null. |
callback | Called with the response. |
ISessionId PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SessionIdFromString | ( | string | sessionIdAsString | ) |
Restore a SessionId from a string.
This method allows a SessionId to be converted to a string with SessionIdImpl.ToString and later recovered from the string. This is a client operation. A session that has been closed will not be recreated.
sessionIdAsString | A string previously created with SessionIdImpl.ToString |
.
.
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetConflated | ( | ISessionId | clientSessionId, |
bool | conflate, | ||
IClientCallback | callback | ||
) |
Control client queue conflation.
clientSessionId | The client session. |
conflate | true to enable, false to disable. |
callback | the operation callback |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetConflated< TC > | ( | ISessionId | clientSessionId, |
bool | conflate, | ||
TC | context, | ||
IClientContextCallback< TC > | callback | ||
) |
Control client queue conflation with a contextual callback.
clientSessionId | The client session. |
conflate | true to enable, false to disable. |
context | the context to pass to the callback. |
callback | the operation callback |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetQueueEventHandler | ( | IQueueEventHandler | handler | ) |
Register a handler for client queue threshold events. Each controller session may register a handler. For each event, the server will select a single handler.
Each control session can register a single handler. See IServerHandler.OnActive closed (using IRegisteredHandler.Close()) if no longer required. To set a different handler the current handler must first be closed. For each event, the server will select a single handler.
The client may choose to act upon client queue events by conflating or throttling the client.
handler | the queue handler to set |
Task<IReadOnlyDictionary<string, string> > PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetSessionPropertiesAsync | ( | ISessionId | sessionId, |
Dictionary< string, string > | properties | ||
) |
Send a request to the server to change the user-defined session properties for a session.
If the session properties were updated, the Task
will complete successfully. The result type is a dictionary of properties that changed with their previous values. If no properties were changed, the dictionary will be empty. If any new properties were added, the values in the dictionary will be null
to indicate that they do not have an old value.
This method is equivalent to calling SetSessionPropertiesAsync(ISessionId, Dictionary{string, string}, CancellationToken) with CancellationToken.None.
Added in version 6.1.
sessionId | The session id of the client session. |
properties | The properties to change. Each entry in the dictionary is a property name and the new value. If the value is null any existing property with that name will be removed. Otherwise if the property name does not match any existing property, that entry will be added as a new property. |
ArgumentNullException | The sessionId or properties is null . |
NoSuchSessionException | The identified session was closed before the response was delivered. Thrown by the returned task. |
SessionSecurityException | The calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task. |
SessionClosedException | The calling session is closed. Thrown by the returned task. |
Task<IReadOnlyDictionary<string, string> > PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetSessionPropertiesAsync | ( | ISessionId | sessionId, |
Dictionary< string, string > | properties, | ||
CancellationToken | cancellationToken | ||
) |
Send a request to the server to change the user-defined session properties for a session.
If the session properties were updated, the Task
will complete successfully. The result type is a dictionary of properties that changed with their previous values. If no properties were changed, the dictionary will be empty. If any new properties were added, the values in the dictionary will be null
to indicate that they do not have an old value.
Added in version 6.1.
sessionId | The session id of the client session. |
properties | The properties to change. Each entry in the dictionary is a property name and the new value. If the value is null any existing property with that name will be removed. Otherwise if the property name does not match any existing property, that entry will be added as a new property. |
cancellationToken | The cancellation token used to cancell the current operation. |
ArgumentNullException | The sessionId or properties is null . |
NoSuchSessionException | The identified session was closed before the response was delivered. Thrown by the returned task. |
SessionSecurityException | The calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task. |
SessionClosedException | The calling session is closed. Thrown by the returned task. |
Task<object> PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetSessionPropertiesAsync | ( | string | filter, |
Dictionary< string, string > | properties | ||
) |
Send a request to the server to set all sessions that satisfy a session filter with the new user-defined session properties.
If the task completes successfully, the Task result will be null. The result type is Task{Object}
rather than Task
to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
This method is equivalent to calling SetSessionPropertiesAsync(string, Dictionary{string, string}, CancellationToken) with CancellationToken.None.
Added in version 6.1.
filter | The session filter. |
properties | The properties to change. Each entry in the dictionary is a property name and the new value. If the value is null , any existing property with that name will be removed. |
ArgumentNullException | The filter or properties is null . |
SessionSecurityException | The calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task. |
SessionClosedException | The calling session is closed. Thrown by the returned task. |
Task<object> PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetSessionPropertiesAsync | ( | string | filter, |
Dictionary< string, string > | properties, | ||
CancellationToken | cancellationToken | ||
) |
Send a request to the server to set all sessions that satisfy a session filter with the new user-defined session properties.
If the task completes successfully, the Task result will be null. The result type is Task{Object}
rather than Task
to provide forward compatibility with future iterations of this API that may provide a non-null result with a more specific result type.
Added in version 6.1.
filter | The session filter. |
properties | The properties to change. Each entry in the dictionary is a property name and the new value. If the value is null , any existing property with that name will be removed. |
cancellationToken | The cancellation token used to cancell the current operation. |
ArgumentNullException | The filter or properties is null . |
SessionSecurityException | The calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task. |
SessionClosedException | The calling session is closed. Thrown by the returned task. |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetSessionPropertiesListener | ( | ISessionPropertiesListener | listener, |
params string[] | requiredProperties | ||
) |
Register a listener that will be notified when client sessions are opened, disconnected, reconnected, closed or when selected session property values are updated.
When a listener is first set, it will be called with the required properties of all currently open client sessions. The amount of data transferred from the server is proportional to the number of connected clients and is potentially large. The amount of data can be reduced using the requiredProperties parameter.
Each control session can register a single listener (See Callbacks.IServerHandler.OnRegistered). A listener may be closed (using IRegistration.Close) if no longer required. To set a different listener the current listener must first be closed.
The requiredProperties parameter is used to select the property values required.
The requested property set controls the level of detail provided and whether the listener is called for updates to sessions. If no properties are requested then the listener is not called when session properties are updated.
listener | The listener to be called with session notifications. |
requiredProperties | A list of required property keys. See ISession for a full list of available fixed property keys. |
To request no properties, null or an empty set may be supplied. To requested all fixed properties, SessionControlConstants.AllFixedProperties should be included as a key and any other fixed property keys would be ignored. To request all user properties, SessionControlConstants.AllUserProperties should be included as a key and any other user property keys supplied would be ignored.
ArgumentNullException | If listener is null . |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetThrottled | ( | ISessionId | clientSessionId, |
ThrottlerType | throttlerType, | ||
int | throttlingLimit, | ||
IClientCallback | callback | ||
) |
Instruct a client to throttle the queue according to the provided parameters.
clientSessionId | The client session. |
throttlerType | The type of throttling. |
throttlingLimit | The throttling limit. The meaning of this limit depends on the throttler type. |
callback | the operation callback |
void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetThrottled< TC > | ( | ISessionId | clientSessionId, |
ThrottlerType | throttlerType, | ||
int | throttlingLimit, | ||
TC | context, | ||
IClientContextCallback< TC > | callback | ||
) |
Instruct a client to throttle the queue according to the provided parameters.
clientSessionId | The client session. |
throttlerType | The type of throttling. |
throttlingLimit | The throttling limit. The meaning of this limit depends on the throttler type. |
context | the context to pass to the callback. |
callback | the operation callback |