@Deprecated public interface ServiceTopicHandler
A service topic is one that provides request/response capability (see
ServiceTopicData
). 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. In response to
such a message the client application should create a handler of this type
using the client connection
method
and declaring a ServiceTopicListener
to receive all responses
and notifications from the 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 Listener
declared to the
client connection
object.
Modifier and Type | Method and Description |
---|---|
ServerConnection |
getConnection()
Deprecated.
Returns the client connection.
|
String |
getNextRequestId()
Deprecated.
Returns a new unique request identifier that may be used in the
request(String, String, TopicMessage) call. |
TopicMessage |
getServiceData()
Deprecated.
Returns a message containing any fixed data returned by the service on
subscription.
|
String |
getServiceType()
Deprecated.
Returns the service type.
|
void |
request(String requestType,
String requestId,
TopicMessage data)
Deprecated.
Sends a request to the service.
|
String |
request(String requestType,
TopicMessage data)
Deprecated.
Sends a request to the Service.
|
ServerConnection getConnection()
String getServiceType()
This is the service type as returned by the
ServiceTopicData
.
TopicMessage getServiceData()
The message may contain headers and/or data as set in the
ServiceTopicData
or may be empty if no data was set.
String request(String requestType, TopicMessage data) throws APIException
If the request succeeds then a response will be returned on
ServiceTopicListener.serviceResponse(ServiceTopicResponse)
and if
it fails or is timed out at the server then an error will be returned on
ServiceTopicListener.serviceError(ServiceTopicError)
.
requestType
- the request type. This must be one of the allowed
types for the servicedata
- optional request data. If supplied then the headers and data
from the given message will be sent with the request.APIException
- if request failedString getNextRequestId()
request(String, String, TopicMessage)
call.void request(String requestType, String requestId, TopicMessage data) throws APIException
If the request succeeds then a response will be returned on
ServiceTopicListener.serviceResponse(ServiceTopicResponse)
and if
it fails or is timed out at the server then an error will be returned on
ServiceTopicListener.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.APIException
- if request failedCopyright © 2016 Push Technology Ltd. All Rights Reserved.