Configuration Platform SDK 7.6 API Reference

com.genesyslab.platform.commons.protocol
Interface RequestChannel

All Superinterfaces:
AsyncChannel, Channel, ChannelListenerSupport
All Known Subinterfaces:
Protocol
All Known Implementing Classes:
ClientChannel

public interface RequestChannel
extends Channel


Field Summary
 
Fields inherited from interface com.genesyslab.platform.commons.protocol.Channel
DEFAULT_TIMEOUT, INFINITE_TIMEOUT
 
Method Summary
 RequestFuture beginRequest(Message message)
          Start request and exit.
 Message endRequest(RequestFuture future)
          Try to finnish request started with beginRequest(Message)
 Message endRequest(RequestFuture future, long timeout)
          Try to finnish request started with beginRequest(Message)
 boolean getCopyResponse()
          Is responce to request() copied to receive queue.
 Message request(Message message)
          Send the message and waitResponse for response.
 Message request(Message message, long timeout)
          Send the message and waitResponse for response or while specified timeout is elapsed.
 void setCopyResponse(boolean copyResponse)
          Is responce to request() copied to receive queue.
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.Channel
close, close, getTimeout, open, open, setTimeout
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.AsyncChannel
beginClose, beginOpen, getState
 
Methods inherited from interface com.genesyslab.platform.commons.protocol.ChannelListenerSupport
addChannelListener, removeChannelListener
 

Method Detail

request

public Message request(Message message)
                throws ProtocolException,
                       java.lang.IllegalStateException
Send the message and waitResponse for response. Time to waitResponse is set by "timeout" property. Only referenceable messages can be awaited, so if message doesn't support referencing there will be no waiting and null will be returned.

Parameters:
message - Message to send
Returns:
Response message or null if no response implied.
Throws:
java.lang.IllegalStateException - if channel is not in an appropriate state (e.g. closed)
ProtocolException - if some protocol problems occured

request

public Message request(Message message,
                       long timeout)
                throws ProtocolException,
                       java.lang.IllegalStateException
Send the message and waitResponse for response or while specified timeout is elapsed. Only referenceable messages can be awaited, so if message doesn't support referencing there will be no waiting and null will be returned.

Parameters:
message - Message to send
timeout - timeout in ms.
Returns:
Response message or null if no response implied.
Throws:
java.lang.IllegalStateException - if channel is not in an appropriate state (e.g. closed)
ProtocolException - if some protocol problems occured

beginRequest

public RequestFuture beginRequest(Message message)
                           throws ProtocolException,
                                  java.lang.IllegalStateException
Start request and exit. To waitResponse for request result you can use either returned RequestFuture or endRequest(RequestFuture) method.

Parameters:
message - message to request with
Returns:
future object which allow to get result of the request
Throws:
ProtocolException - if sending of the request fails
java.lang.IllegalStateException - if channel is in inapropriate state to execute the request
See Also:
request(Message)

endRequest

public Message endRequest(RequestFuture future)
                   throws ProtocolException
Try to finnish request started with beginRequest(Message)

Parameters:
future - future object obtained from beginRequest(Message)
Returns:
message if request is successful or null if there were no response
Throws:
ProtocolException - if there are protocol related problems
See Also:
request(Message)

endRequest

public Message endRequest(RequestFuture future,
                          long timeout)
                   throws ProtocolException
Try to finnish request started with beginRequest(Message)

Parameters:
future - future object obtained from beginRequest(Message)
timeout - timeout to waitResponse for response
Returns:
message if request is successful or null if there were no response
Throws:
ProtocolException - if there are protocol related problems
See Also:
request(Message, long)

getCopyResponse

public boolean getCopyResponse()
Is responce to request() copied to receive queue.

Returns:
true if responce goes to recieve queue

setCopyResponse

public void setCopyResponse(boolean copyResponse)
Is responce to request() copied to receive queue.

Parameters:
copyResponse - true if responce goes to recieve queue

Configuration Platform SDK 7.6 API Reference

Send comments on this topic.
Copyright © 2006–2008 Genesys Telecommunication Laboratories, Inc. All rights reserved.