Package host.anzo.simon.codec.messages
Class AbstractMessage
java.lang.Object
host.anzo.simon.codec.messages.AbstractMessage
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
MsgCloseRawChannel,MsgCloseRawChannelReturn,MsgEquals,MsgEqualsReturn,MsgError,MsgHashCode,MsgHashCodeReturn,MsgInterfaceLookup,MsgInterfaceLookupReturn,MsgInvoke,MsgInvokeReturn,MsgNameLookup,MsgNameLookupReturn,MsgOpenRawChannel,MsgOpenRawChannelReturn,MsgPing,MsgPong,MsgRawChannelData,MsgRawChannelDataReturn,MsgReleaseRef,MsgToString,MsgToStringReturn
A base message for SIMON protocol messages.
Error messages are not being sent via the errorMsg field:
In case of a problems reading a message, the responsible decoder class will
inject the error message, so that the ProcessMessageRunnable can react on
that error accordingly.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMessage(byte msgType) Creates a new message decoder -
Method Summary
Modifier and TypeMethodDescriptionReturns the error message.byteReturns the message type as described bySimonMessageConstantsintReturns, guess what, the sequence id of the messagebooleanhasError()Returns whether this message has an error or notvoidsetErrorMsg(String errorMsg) Sets the error message related to this messagevoidsetSequence(int sequence) Stores the sequence id in the message
-
Constructor Details
-
AbstractMessage
protected AbstractMessage(byte msgType) Creates a new message decoder- Parameters:
msgType- specifies a unique ID for the type of message
-
-
Method Details
-
getErrorMsg
Returns the error message. ContainsStatics.NO_ERRORif no error is present.- Returns:
- the errorMsg
-
setErrorMsg
Sets the error message related to this message- Parameters:
errorMsg- the errorMsg to set
-
hasError
public boolean hasError()Returns whether this message has an error or not- Returns:
- true, if error is present, false if not
-
getMsgType
public byte getMsgType()Returns the message type as described bySimonMessageConstants- Returns:
- the msgType
-
getSequence
public int getSequence()Returns, guess what, the sequence id of the message- Returns:
- the sequence
-
setSequence
public void setSequence(int sequence) Stores the sequence id in the message- Parameters:
sequence- the sequence to set
-