Interface IRemoteServers
This feature allows a client session to manage remote servers.
Inherited Members
Namespace: PushTechnology.ClientInterface.Client.Features.Control.Clients
Assembly: Diffusion.Client.dll
Syntax
public interface IRemoteServers : IFeature
Remarks
A remote server provides the configuration to connect to a Diffusion server belonging to a different cluster. Each server in the local cluster will establish a session with each remote server.
Higher level components, such as remote topic views, can specify the use of such remote servers by name. The connecting and disconnecting is handled automatically by the server (or servers in the same cluster) where the remote servers are defined.
A component can specify a remote server by name even if it does not exist (has not yet been created) and when the remote server is created the connection will take place automatically.
If a remote server is removed and there are components that depend upon it, those components will be disabled.
An example of the use of remote servers is within remote topic views (those that indicate that their source topics are to be taken from a different server) where the name of such a server can be specified.
Remote Server persistence and replication
Remote server configurations created through this feature are replicated across a cluster and persisted to disk.
Access Control
The following access control restrictions are applied:
- To create a remote server (see CreateRemoteServerAsync(String, String, String, ICredentials)), remove a remote server (see RemoveRemoteServerAsync(String)) or check a remote server (see CheckRemoteServerAsync(String)), a session needs the CONTROL_SERVER global permission.
- To list remote servers (see ListRemoteServersAsync()), a session needs the VIEW_SERVER global permission.
Accessing the feature
This feature may be obtained from an ISession as follows:
var remoteServers = session.RemoteServers;
Added in version 6.5.
Methods
CheckRemoteServerAsync(String)
Check the current state of a named remote server.
This will report back the current state of the remote server, but also can be used to forcibly retry a failed remote server connection.
Declaration
Task<ICheckRemoteServerResult> CheckRemoteServerAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
Returns
Type | Description |
---|---|
Task<ICheckRemoteServerResult> | A |
CheckRemoteServerAsync(String, CancellationToken)
Check the current state of a named remote server.
This will report back the current state of the remote server, but also can be used to forcibly retry a failed remote server connection.
Declaration
Task<ICheckRemoteServerResult> CheckRemoteServerAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<ICheckRemoteServerResult> | A |
CreateRemoteServerAsync(IRemoteServer)
Create a new remote server instance at the server.
If a remote server with the same name already exists an error will be returned. Since 6.7.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(IRemoteServer remoteServer)
Parameters
Type | Name | Description |
---|---|---|
IRemoteServer | remoteServer | a remote server definition created using a PushTechnology.ClientInterface.Client.Features.RemoteServers.RemoteServerBuilder remote server builder. |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
CreateRemoteServerAsync(IRemoteServer, CancellationToken)
Create a new remote server instance at the server.
If a remote server with the same name already exists an error will be returned. Since 6.7.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(IRemoteServer remoteServer, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IRemoteServer | remoteServer | a remote server definition created using a PushTechnology.ClientInterface.Client.Features.RemoteServers.RemoteServerBuilder remote server builder. |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
CreateRemoteServerAsync(String, String, String, ICredentials)
Create a new remote server instance with default connection options.
If a remote server with the same name already exists an error will be returned.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(string name, string url, string principal, ICredentials credentials)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
String | url | the URL to use to connect to the primary server |
String | principal | the name of a principal used by the remote server to connect to the primary server. A zero length string may be supplied to indicate an anonymous connection |
ICredentials | credentials | to use for connecting to the primary server |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
Remarks
> [!CAUTION] > Deprecated since 6.7. > Use CreateRemoteServerAsync(IRemoteServer) in preference. > This method will be removed in a future release.
CreateRemoteServerAsync(String, String, String, ICredentials, CancellationToken)
Create a new remote server instance with default connection options.
If a remote server with the same name already exists an error will be returned.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(string name, string url, string principal, ICredentials credentials, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
String | url | the URL to use to connect to the primary server |
String | principal | the name of a principal used by the remote server to connect to the primary server. A zero length string may be supplied to indicate an anonymous connection |
ICredentials | credentials | to use for connecting to the primary server |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
Remarks
> [!CAUTION] > Deprecated since 6.7. > Use CreateRemoteServerAsync(IRemoteServer) in preference. > This method will be removed in a future release.
CreateRemoteServerAsync(String, String, String, ICredentials, Dictionary<RemoteServerConnectionOption, String>)
Create a new remote server instance.
If a remote server with the same name already exists an error will be returned.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(string name, string url, string principal, ICredentials credentials, Dictionary<RemoteServerConnectionOption, string> connectionOptions)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
String | url | the URL to use to connect to the primary server |
String | principal | the name of a principal used by the remote server to connect to the primary server. A zero length string may be supplied to indicate an anonymous connection |
ICredentials | credentials | to use for connecting to the primary server |
Dictionary<RemoteServerConnectionOption, String> | connectionOptions | a map of connection option settings. Any options not supplied will take their default values |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
Remarks
> [!CAUTION] > Deprecated since 6.7. > Use CreateRemoteServerAsync(IRemoteServer) in preference. > This method will be removed in a future release.
CreateRemoteServerAsync(String, String, String, ICredentials, Dictionary<RemoteServerConnectionOption, String>, CancellationToken)
Create a new remote server instance with default connection options.
If a remote server with the same name already exists an error will be returned.
Declaration
Task<IRemoteServer> CreateRemoteServerAsync(string name, string url, string principal, ICredentials credentials, Dictionary<RemoteServerConnectionOption, string> connectionOptions, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
String | url | the URL to use to connect to the primary server |
String | principal | the name of a principal used by the remote server to connect to the primary server. A zero length string may be supplied to indicate an anonymous connection |
ICredentials | credentials | to use for connecting to the primary server |
Dictionary<RemoteServerConnectionOption, String> | connectionOptions | a map of connection option settings. Any options not supplied will take their default values |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<IRemoteServer> | A |
Remarks
> [!CAUTION] > Deprecated since 6.7. > Use CreateRemoteServerAsync(IRemoteServer) in preference. > This method will be removed in a future release.
ListRemoteServersAsync()
List all the remote servers that have been created.
Declaration
Task<List<IRemoteServer>> ListRemoteServersAsync()
Returns
Type | Description |
---|---|
Task<List<IRemoteServer>> | A |
ListRemoteServersAsync(CancellationToken)
List all the remote servers that have been created.
Declaration
Task<List<IRemoteServer>> ListRemoteServersAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<List<IRemoteServer>> | A |
RemoveRemoteServerAsync(String)
Remove a named remote server if it exists.
If the named remote server does not exist the Task will complete successfully.
When a named remote server is removed, any components that specify it would be disabled.
Declaration
Task<object> RemoveRemoteServerAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
Returns
Type | Description |
---|---|
Task<Object> | A |
RemoveRemoteServerAsync(String, CancellationToken)
Remove a named remote server if it exists.
If the named remote server does not exist the Task will complete successfully.
When a named remote server is removed, any components that specify it would be disabled.
Declaration
Task<object> RemoveRemoteServerAsync(string name, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
String | name | the name of the remote server |
CancellationToken | cancellationToken | The cancellation token used to cancel the current operation. |
Returns
Type | Description |
---|---|
Task<Object> | A |