Package marauroa.common.net.message
Class MessageS2CTransfer
java.lang.Object
marauroa.common.net.message.Message
marauroa.common.net.message.MessageS2CTransfer
- All Implemented Interfaces:
Serializable
This message is used to transfer the client a list of contents that has already being
approved by it.
- Author:
- miguel
-
Nested Class Summary
Nested classes/interfaces inherited from class marauroa.common.net.message.Message
Message.MessageType
-
Field Summary
Fields inherited from class marauroa.common.net.message.Message
channel, clientid, CLIENTID_INVALID, protocolVersion, timestampMessage, type
-
Constructor Summary
ConstructorDescriptionConstructor for allowing creation of an empty messageMessageS2CTransfer(Channel source)
Creates a new MessageS2CTransferMessageS2CTransfer(Channel source, TransferContent content)
Creates a new MessageS2CTransfer -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContent(TransferContent content)
adds content to the MessageThe list if contents to transfer.boolean
isEmpty()
does this method contain no content?void
Serialize the object from an ObjectInputboolean
does this message require a perceptiontoString()
void
writeObject(OutputSerializer out)
Serialize the object into an ObjectOutputvoid
writeToJson(StringBuilder out)
Serialize the object to jsonMethods inherited from class marauroa.common.net.message.Message
getAddress, getChannel, getClientID, getMessageTimestamp, getProtocolVersion, getType, internalToString, isPerception, isSkippable, readFromMap, setChannel, setClientID, setProtocolVersion
-
Constructor Details
-
MessageS2CTransfer
public MessageS2CTransfer()Constructor for allowing creation of an empty message -
MessageS2CTransfer
Creates a new MessageS2CTransfer- Parameters:
source
- socket channel
-
MessageS2CTransfer
Creates a new MessageS2CTransfer- Parameters:
source
- socket channelcontent
- content to transfer
-
-
Method Details
-
addContent
adds content to the Message- Parameters:
content
- TransferContent
-
isEmpty
public boolean isEmpty()does this method contain no content?- Returns:
- true, if there is no content; false otherwise
-
getContents
The list if contents to transfer.- Returns:
- The list if contents to transfer.
-
requiresPerception
public boolean requiresPerception()does this message require a perception- Overrides:
requiresPerception
in classMessage
- Returns:
- true, if this message requires a perception, false otherwise
-
toString
-
writeObject
Description copied from class:Message
Serialize the object into an ObjectOutput- Specified by:
writeObject
in interfaceSerializable
- Overrides:
writeObject
in classMessage
- Parameters:
out
- the output serializer.- Throws:
IOException
- if the serializations fails
-
writeToJson
Description copied from class:Message
Serialize the object to json- Overrides:
writeToJson
in classMessage
- Parameters:
out
- output buffer
-
readObject
Description copied from class:Message
Serialize the object from an ObjectInput- Specified by:
readObject
in interfaceSerializable
- Overrides:
readObject
in classMessage
- Parameters:
in
- the input serializer- Throws:
IOException
- if the serializations fails
-