Diffusion .NET API
5.9.24
|
Representation of a service topic at the client side. More...
Public Member Functions | |
void | SetHandler (IRequesterFeatureResponseHandler handler) |
Sets a handler to receive responses from the service topic. More... | |
string | Request (string requestType, IContent 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, IContent ) call. More... | |
void | Request (string requestType, string requestId, IContent data) |
Sends a request to the service. More... | |
Properties | |
int | Topic [get] |
Returns the identifier of the service topic. More... | |
string | ServiceType [get] |
Returns the service type. More... | |
IContent | ServiceData [get] |
Returns any fixed data returned by the service on subscription. More... | |
Representation of a service topic at the client side.
A service topic is one that provides request/response capability.
When the IServices service is in use then a subscription to a service topic will be notified via IRequesterFeatureHandler.ServiceTopicSubscribed( IServiceTopic ) which will pass an instance of this class for interacting with the service topic at the server side. An IRequesterFeatureResponseHandler must be set using SetHandler( IRequesterFeatureResponseHandler ) to receive responses from the service topic.
The service topic simplifies the use of such a topic and avoids having to format content to send to the topic or parse content received from it.
When such a service topic is in use, content received on the topic will not be delivered to any topic listener declared for the topic.
string PushTechnology.ClientInterface.Client.Features.IServiceTopic.GetNextRequestId | ( | ) |
Returns a new unique request identifier that may be used in the Request( string, string, IContent ) call.
string PushTechnology.ClientInterface.Client.Features.IServiceTopic.Request | ( | string | requestType, |
IContent | data | ||
) |
Sends a request to the service.
If the request succeeds, a response will be returned on IServiceResponseHandler.ServiceResponse( IResponse ) and if it fails or is timed out at the server, an error will be returned on IServiceResponseHandler.ServiceError( IServiceResponseError ).
requestType | The request type. This must be one of the allowed types for the service as defined at the server. |
data | Optional request data. |
void PushTechnology.ClientInterface.Client.Features.IServiceTopic.Request | ( | string | requestType, |
string | requestId, | ||
IContent | data | ||
) |
Sends a request to the service.
If the request succeeds, a response will be returned on IServiceResponseHandler.ServiceResponse( IResponse ) and if it fails or is timed out at the server, an error will be returned on IServiceResponseHandler.ServiceError( IServiceResponseError ).
requestType | The request type. This must be one of the allowed types for the service as defined at the server. |
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 will be sent with the request. |
void PushTechnology.ClientInterface.Client.Features.IServiceTopic.SetHandler | ( | IRequesterFeatureResponseHandler | handler | ) |
Sets a handler to receive responses from the service topic.
A handler must be set before sending requests to the service.
handler |
|
get |
Returns any fixed data returned by the service on subscription.
The content may contain headers and/or data as set in the service topic or may be empty if no data was set.
|
get |
Returns the service type.
This is the service type as defined by the service topic at the server.
|
get |
Returns the identifier of the service topic.