![]() |
Diffusion .NET Classic API - Core and Common
5.9.4
|
A service topic handler. More...
Public Member Functions | |
string | Request (string requestType, ITopicMessage data) |
Sends a request to the service. More... | |
string | Request (string requestType, string requestId, ITopicMessage data) |
Sends a request to the service. More... | |
string | GetNextRequestId () |
Returns a new unique request identifier that may be used in the Request( string, string, ITopicMessage ) call. More... | |
Properties | |
IDiffusionClientConnector | Connection [get] |
Returns the client connection. More... | |
string | ServiceType [get] |
Returns the service type. More... | |
ITopicMessage | ServiceData [get] |
Returns a message containing any fixed data returned by the service on subscription. More... | |
A service topic handler.
A service topic is one that provides request/response capability (see IServiceTopicData). When a client subscribes to a service topic then a topic load message will be received by the client that indicates that it is a service load message (ITopicMessage.IsServiceLoad). In response to such a message, the client application should create a handler of this type using the client connection ExternalClient.CreateServiceTopicHandler( ITopicMessage, IServiceTopicListener) method and declaring an IServiceTopicListener to receive all responses and notifications from this topic.
The handler simplifies the use of such a topic and avoids having to format messages to send to the topic or parse messages received from it.
When such a handler is in use then messages received on the topic will not be delivered to the IServerConnectionListener declared to the ExternalClient object.
string PushTechnology.DiffusionCore.Connection.Connectors.ExternalClient.Service.IServiceTopicHandler.GetNextRequestId | ( | ) |
Returns a new unique request identifier that may be used in the Request( string, string, ITopicMessage ) call.
Implemented in PushTechnology.DiffusionCore.Messaging.Data.Service.ServiceTopicHandlerImpl.
string PushTechnology.DiffusionCore.Connection.Connectors.ExternalClient.Service.IServiceTopicHandler.Request | ( | string | requestType, |
ITopicMessage | data | ||
) |
Sends a request to the service.
If the request succeeds then a response will be returned on IServiceTopicListener.ServiceResponse( IServiceTopicResponse ) and if it fails or is timed out at the server then an error will be returned on IServiceTopicListener.ServiceError( ServiceTopicError ).
requestType | The request type. This must be one of the allowed types for the service. |
data | Optional request data. If supplied, then the headers and data from the given message will be sent with the request. |
Implemented in PushTechnology.DiffusionCore.Messaging.Data.Service.ServiceTopicHandlerImpl.
string PushTechnology.DiffusionCore.Connection.Connectors.ExternalClient.Service.IServiceTopicHandler.Request | ( | string | requestType, |
string | requestId, | ||
ITopicMessage | data | ||
) |
Sends a request to the service.
If the request succeeds then a response will be returned on IServiceTopicListener.ServiceResponse( IServiceTopicResponse ) and if it fails or is timed out at the server then an error will be returned on IServiceTopicListener.ServiceError( ServiceTopicError ).
requestType | The request type. This must be one of the allowed types for the service. |
requestId | A unique request identifier. This must be unique - the GetNextRequestId method may be used to generate a unique identifier. If the identifier passed is not unique then the results will be unpredictable. |
data | Optional request data. If supplied, then the headers and data from the given message will be sent with the request. |
Implemented in PushTechnology.DiffusionCore.Messaging.Data.Service.ServiceTopicHandlerImpl.
|
get |
Returns the client connection.
|
get |
Returns a message containing any fixed data returned by the service on subscription.
The message may contain headers and/or data as set in the IServiceTopicData or may be empty if no data was set.
|
get |
Returns the service type.
This is the service type as returned by the IServiceTopicData.