message
Interface BasicMessage

All Known Subinterfaces:
Reply, Request
All Known Implementing Classes:
BatchSizeMessage, ChannelEstablishMessage, ChannelMessage, ChannelReleaseMessage, Message, ReplyMessage

public interface BasicMessage

Interface any type of message the InputOutputHandler shall be capable of transmitting must implement.

Author:
Karl-Peter Fuchs

Method Summary
 byte[] getByteMessage()
          Must return the byte representation of this message.
 User getChannel()
          Must return a reference on the channel/user this message belongs to.
 int getChannelID()
          Must return an identifier for the channel/user this message belongs to.
 int getMessageID()
          Must return an identifier for this message.
 int getNextMixChannelID()
          Must return an identifier for the channel/user this message belongs to, used by the next mix of the cascade.
 long getTimeOfReceival()
          Must return the point of time (timestamp), this message was received.
 void setByteMessage(byte[] byteMessage)
          Sets the byte representation of this message to the bypassed array.
 void setMessageID(int newIdentifier)
          Must set this message's identifier to the bypassed value.
 void setPayloadRange(int startIndexOfPayload, int payloadLength)
          Only a certain part of the message array must be transmitted to the cascade's next mix (Some parts (e. g. the session key for the corresponding mix) are not supposed to be sent).
 void setTimeOfReceival(long newTimeOfReceival)
          Must set the point of time (timestamp), this message was received to the bypassed value.
 

Method Detail

getMessageID

int getMessageID()
Must return an identifier for this message.

Returns:
Identifier for this message.

setMessageID

void setMessageID(int newIdentifier)
Must set this message's identifier to the bypassed value.

Parameters:
newIdentifier - Value this message's identifier shall be set to.

getChannelID

int getChannelID()
Must return an identifier for the channel/user this message belongs to.

Returns:
Identifier for the channel/user this message belongs to.

getNextMixChannelID

int getNextMixChannelID()
Must return an identifier for the channel/user this message belongs to, used by the next mix of the cascade.

Returns:
Identifier for the channel/user this message belongs to, used by the next mix of the cascade.

getChannel

User getChannel()
Must return a reference on the channel/user this message belongs to.

Returns:
Reference on the channel/user this message belongs to.

setPayloadRange

void setPayloadRange(int startIndexOfPayload,
                     int payloadLength)
Only a certain part of the message array must be transmitted to the cascade's next mix (Some parts (e. g. the session key for the corresponding mix) are not supposed to be sent). Which part is relevant depends on the type of message.

This method must define the offset and length of the part to be transmitted.

Parameters:
startIndexOfPayload - Offset of the part to be transmitted.
payloadLength - Length of the part to be transmitted.

getTimeOfReceival

long getTimeOfReceival()
Must return the point of time (timestamp), this message was received.

Returns:
Point of time (timestamp), this message was received.

setTimeOfReceival

void setTimeOfReceival(long newTimeOfReceival)
Must set the point of time (timestamp), this message was received to the bypassed value.

Parameters:
newTimeOfReceival - Point of time (timestamp), this message was received.

getByteMessage

byte[] getByteMessage()
Must return the byte representation of this message.

Returns:
Byte representation of this message.

setByteMessage

void setByteMessage(byte[] byteMessage)
Sets the byte representation of this message to the bypassed array.

Parameters:
byteMessage - New content for this message.