public abstract class Exchange
extends java.lang.Object
Constructor and Description |
---|
Exchange() |
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Retrieve the byte[] representation of the exchange.
|
int |
getConditionFlag() |
java.lang.String |
getDescription()
Retrieve the description associated with this exchange.
|
int |
getExchangeSubType() |
int |
getExchangeType() |
java.lang.String |
getIdentifier() |
java.lang.String |
getRespondTo()
Retrieve the respondTo field for this exchange.
|
long |
getTimestamp()
Retrieve the timestamp for this exchange.
|
boolean |
isRequest()
Indicates whether this exchange is a Request
|
boolean |
isResponse()
Indicates whether this exchange is a Response to a previously issued
request.
|
abstract boolean |
isValidExchangeSubType()
Checks to see if the exchange sub-type in the reconstructed exchange is a
valid one.
|
abstract byte[] |
marshallExchangeSpecificElements()
This method is utilized by the derived classes to marshall (or serialize)
elements that are specific to the derived class.
|
void |
reconstruct(byte[] marshalledBytes)
Reconstruct the exchange from the byte[] representation.
|
protected void |
setConditionFlag(int conditionFlag) |
protected void |
setDescription(java.lang.String description) |
protected void |
setExchangeSubType(int exchangeSubType) |
void |
setExchangeType(int exchangeType) |
protected void |
setIdentifier(java.lang.String identifier) |
protected void |
setRequest()
Sets this exchange as a request.
|
void |
setRespondTo(java.lang.String respondTo)
Set the repondTo field for this exchange.
|
protected void |
setResponse()
Sets this exchange as a reponse.
|
void |
setTimestamp(long timestamp)
Set the timestamp for this exchange.
|
abstract void |
unmarshallExchangeSpecificElements(byte[] exchangeSpecificBytes)
This method is utilized by the derived classes to reconstruct elements
that are specific to the derived class.
|
public final byte[] getBytes() throws java.io.IOException, MarshallingException
java.io.IOException
- If there are IO problems while performing this operation.MarshallingException
- If there are Marshalling problems while performing this
operation.public final void reconstruct(byte[] marshalledBytes) throws java.io.IOException, MarshallingException
marshalledBytes
- The byte[] representation of the exchange.java.io.IOException
- If there are IO problems while performing this operation.MarshallingException
- If there are Marshalling problems while performing this
operation.public abstract boolean isValidExchangeSubType()
true
If the exchange subType is a valid one, or
false
otherwise.public abstract byte[] marshallExchangeSpecificElements() throws java.io.IOException, MarshallingException
java.io.IOException
- If there are IO problems while performing this operation.MarshallingException
- If there are Marshalling problems while performing this
operation.public abstract void unmarshallExchangeSpecificElements(byte[] exchangeSpecificBytes) throws java.io.IOException, MarshallingException
exchangeSpecificBytes
- The byte[] representation of the derived class.java.io.IOException
- If there are IO problems while performing this operation.MarshallingException
- If there are Marshalling problems while performing this
operation.public void setExchangeType(int exchangeType)
exchangeType
- the exchangeType to setpublic int getExchangeType()
public boolean isRequest()
true
if this exchange is a request;
false
otherwise.public boolean isResponse()
true
if the exchange is a reponse;false
otherwise.protected void setRequest()
protected void setResponse()
protected void setExchangeSubType(int exchangeSubType)
exchangeSubType
- the exchangeSubType to setpublic int getExchangeSubType()
protected void setConditionFlag(int conditionFlag)
conditionFlag
- the conditionFlag to setpublic int getConditionFlag()
protected void setIdentifier(java.lang.String identifier)
identifier
- the identifier to setpublic java.lang.String getIdentifier()
protected void setDescription(java.lang.String description)
description
- the description to setpublic java.lang.String getDescription()
public void setRespondTo(java.lang.String respondTo)
respondTo
- the respondTo to setpublic java.lang.String getRespondTo()
public void setTimestamp(long timestamp)
timestamp
- the timestamp to setpublic long getTimestamp()