things.thinger.service.command
Interface CommandResponse

All Known Implementing Classes:
LocalCommandResponse

public interface CommandResponse

A command response interface.

Version:
1.0

Version History

EPG - Initial - 10 APR 06
 
Author:
Erich P. Gatejen

Nested Class Summary
static class CommandResponse.CompletionDisposition
          The completion disposition describes the response.
static class CommandResponse.ResponseState
          The response state disposition describes state of the interaction.
 
Field Summary
static long serialVersionUID
           
 
Method Summary
 void dispose()
          Dispose of the response, command, or anything else that might be associated with this interaction.
 Receipt getFinalReceipt()
          Get the final receipt.
 ReceiptList getReceiptList()
          Get the receipt list.
 CommandResponse.ResponseState getState()
          Get state of the command response.
 Entity<Receipt> next()
          Get next available submission.
 AttributeReader rollup()
          Get a rollup of all the attributes.
 CommandResponse.CompletionDisposition validateCompletion(boolean throwReason)
          Assuming the response is done, was the reponse well formed per the scheme?
 Entity<Receipt> waitResponse(int timeout)
          Wait for a submission and then get it.
 AttributeReader waitRollup(int timeout)
          Wait for the whole transation to be done and then get a rollup of attributes.
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values
Method Detail

getState

CommandResponse.ResponseState getState()
Get state of the command response.

Returns:
the State

validateCompletion

CommandResponse.CompletionDisposition validateCompletion(boolean throwReason)
                                                         throws SystemException
Assuming the response is done, was the reponse well formed per the scheme?

Parameters:
throwReason - If true and the disposition is BAD, it will throw a SystemException for the reason that makes it BAD.
Throws:
SystemException

getFinalReceipt

Receipt getFinalReceipt()
Get the final receipt.

Returns:
the terminal receipt for the interaction, or null if it isn't DONE.
See Also:
Receipt

getReceiptList

ReceiptList getReceiptList()
Get the receipt list.

Returns:
the complete receipt list for the interaction, or null if it isn't DONE.
See Also:
Receipt

next

Entity<Receipt> next()
                     throws SystemException
Get next available submission. If there is an exception, it'll be from the underlying implementation and not something specific to API usage.

Returns:
submission, or null if nothing is available.
Throws:
SystemException
See Also:
Receipt, Entity

waitResponse

Entity<Receipt> waitResponse(int timeout)
                             throws SystemException
Wait for a submission and then get it. If there is an exception, it'll be from the underlying implementation and not something specific to API usage.

Parameters:
timeout - a timeout period in milliseconds. It'll throw a ThingsCodes.SYSTEM_SERVICE_RESPONSE_TIMEOUT SystemException at the end of the timeout. This is a harmless exception and can be safely thrown away. The timeout resolution isn't exact, so don't base any critical timing on it.
Returns:
submission, or null if nothing is available.
Throws:
SystemException
See Also:
Receipt, Entity

rollup

AttributeReader rollup()
                       throws SystemException
Get a rollup of all the attributes. It will validate against the scheme.

Returns:
submission, or null if it is not DONE.
Throws:
SystemException
See Also:
Receipt, Entity

waitRollup

AttributeReader waitRollup(int timeout)
                           throws SystemException
Wait for the whole transation to be done and then get a rollup of attributes. It will validate against the scheme.

Parameters:
timeout - a timeout period in milliseconds. It'll throw a ThingsCodes.SYSTEM_SERVICE_RESPONSE_TIMEOUT SystemException at the end of the timeout. This is a harmless exception and can be safely thrown away. The timeout resolution isn't exact, so don't base any critical timing on it.
Returns:
submission, or null if it is not DONE.
Throws:
SystemException
See Also:
Receipt, Entity

dispose

void dispose()
Dispose of the response, command, or anything else that might be associated with this interaction.



Things.