Class MessageS2CTransfer

java.lang.Object
marauroa.common.net.message.Message
marauroa.common.net.message.MessageS2CTransfer
All Implemented Interfaces:
Serializable

public class MessageS2CTransfer extends Message
This message is used to transfer the client a list of contents that has already being approved by it.
Author:
miguel
  • Constructor Details

    • MessageS2CTransfer

      public MessageS2CTransfer()
      Constructor for allowing creation of an empty message
    • MessageS2CTransfer

      public MessageS2CTransfer(Channel source)
      Creates a new MessageS2CTransfer
      Parameters:
      source - socket channel
    • MessageS2CTransfer

      public MessageS2CTransfer(Channel source, TransferContent content)
      Creates a new MessageS2CTransfer
      Parameters:
      source - socket channel
      content - content to transfer
  • Method Details

    • addContent

      public void addContent(TransferContent content)
      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

      public List<TransferContent> 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 class Message
      Returns:
      true, if this message requires a perception, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Message
    • writeObject

      public void writeObject(OutputSerializer out) throws IOException
      Description copied from class: Message
      Serialize the object into an ObjectOutput
      Specified by:
      writeObject in interface Serializable
      Overrides:
      writeObject in class Message
      Parameters:
      out - the output serializer.
      Throws:
      IOException - if the serializations fails
    • writeToJson

      public void writeToJson(StringBuilder out)
      Description copied from class: Message
      Serialize the object to json
      Overrides:
      writeToJson in class Message
      Parameters:
      out - output buffer
    • readObject

      public void readObject(InputSerializer in) throws IOException
      Description copied from class: Message
      Serialize the object from an ObjectInput
      Specified by:
      readObject in interface Serializable
      Overrides:
      readObject in class Message
      Parameters:
      in - the input serializer
      Throws:
      IOException - if the serializations fails