Diffusion .NET Client Library  6.1.5
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl Interface Reference

This feature provides the ability for a client session to control other client sessions. More...

Inheritance diagram for PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl:
PushTechnology.ClientInterface.Client.Features.IFeature

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...
 

Detailed Description

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.

Member Function Documentation

void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.Close ( ISessionId  clientSessionId,
IClientCallback  callback 
)

Close a client session.

Parameters
clientSessionIdThe client session to close.
callbackthe 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.

Parameters
clientSessionIdThe client session to close.
contextthe context object to pass to the callback.
callbackthe 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.

Parameters
sessionIdIdentifies the client session.
requiredPropertiesSpecifies 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.
callbackCalled 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.

Template Parameters
TCThe context object type.
Parameters
sessionIdIdentifies the client session.
requiredPropertiesSpecifies 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.
contextPassed to the callback to allow requests and responses to be correlated. The caller can use any convenient object reference, including null.
callbackCalled 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.

Parameters
sessionIdAsStringA string previously created with SessionIdImpl.ToString

.

Returns
The SessionId

.

void PushTechnology.ClientInterface.Client.Features.Control.Clients.IClientControl.SetConflated ( ISessionId  clientSessionId,
bool  conflate,
IClientCallback  callback 
)

Control client queue conflation.

Parameters
clientSessionIdThe client session.
conflatetrue to enable, false to disable.
callbackthe 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.

Parameters
clientSessionIdThe client session.
conflatetrue to enable, false to disable.
contextthe context to pass to the callback.
callbackthe 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.

Parameters
handlerthe 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.

Parameters
sessionIdThe session id of the client session.
propertiesThe 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.
Returns
A Task that completes when a response is received from the server by returning a dictionary of session properties that changed.
Exceptions
ArgumentNullExceptionThe sessionId or properties is null.
NoSuchSessionExceptionThe identified session was closed before the response was delivered. Thrown by the returned task.
SessionSecurityExceptionThe calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task.
SessionClosedExceptionThe 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.

Parameters
sessionIdThe session id of the client session.
propertiesThe 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.
cancellationTokenThe cancellation token used to cancell the current operation.
Returns
A Task that completes when a response is received from the server by returning a dictionary of session properties that changed.
Exceptions
ArgumentNullExceptionThe sessionId or properties is null.
NoSuchSessionExceptionThe identified session was closed before the response was delivered. Thrown by the returned task.
SessionSecurityExceptionThe calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task.
SessionClosedExceptionThe 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.

Parameters
filterThe session filter.
propertiesThe 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.
Returns
A Task that completes when a response is received from the server.
Exceptions
ArgumentNullExceptionThe filter or properties is null.
SessionSecurityExceptionThe calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task.
SessionClosedExceptionThe 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.

Parameters
filterThe session filter.
propertiesThe 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.
cancellationTokenThe cancellation token used to cancell the current operation.
Returns
A Task that completes when a response is received from the server.
Exceptions
ArgumentNullExceptionThe filter or properties is null.
SessionSecurityExceptionThe calling session does not have GlobalPermission.MODIFY_SESSION and GlobalPermission.VIEW_SESSION permissions. Thrown by the returned task.
SessionClosedExceptionThe 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.

Parameters
listenerThe listener to be called with session notifications.
requiredPropertiesA 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.

Exceptions
ArgumentNullExceptionIf 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.

Parameters
clientSessionIdThe client session.
throttlerTypeThe type of throttling.
throttlingLimitThe throttling limit. The meaning of this limit depends on the throttler type.
callbackthe 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.

Parameters
clientSessionIdThe client session.
throttlerTypeThe type of throttling.
throttlingLimitThe throttling limit. The meaning of this limit depends on the throttler type.
contextthe context to pass to the callback.
callbackthe operation callback

The documentation for this interface was generated from the following file: