Class MessageEnvelope

java.lang.Object
i5.las2peer.p2p.pastry.MessageEnvelope
All Implemented Interfaces:
Serializable, rice.p2p.commonapi.Message

public class MessageEnvelope extends Object implements rice.p2p.commonapi.Message
a simple envelope for sending las2peer messages through the pastry network
See Also:
  • Field Summary

    Fields inherited from interface rice.p2p.commonapi.Message

    DEFAULT_PRIORITY, HIGH_PRIORITY, LOW_PRIORITY, LOWEST_PRIORITY, MAX_PRIORITY, MEDIUM_HIGH_PRIORITY, MEDIUM_LOW_PRIORITY, MEDIUM_PRIORITY
  • Constructor Summary

    Constructors
    Constructor
    Description
    MessageEnvelope(rice.p2p.commonapi.NodeHandle sendingNode, Message content)
    generate an Pastry message envelope from a las2peer message
    MessageEnvelope(rice.p2p.commonapi.NodeHandle sendingNode, String content)
    create a message envelope with simple string content
  • Method Summary

    Modifier and Type
    Method
    Description
    get the contained las2peer message
    get the content string of this message
    int
     
    rice.p2p.commonapi.NodeHandle
    get a handle to the sending node

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MessageEnvelope

      public MessageEnvelope(rice.p2p.commonapi.NodeHandle sendingNode, String content)
      create a message envelope with simple string content
      Parameters:
      sendingNode - A sending node handle
      content - Arbitrary message content string
    • MessageEnvelope

      public MessageEnvelope(rice.p2p.commonapi.NodeHandle sendingNode, Message content)
      generate an Pastry message envelope from a las2peer message
      Parameters:
      sendingNode - A sending node handle
      content - Another message to wrap
  • Method Details

    • getSendingNode

      public rice.p2p.commonapi.NodeHandle getSendingNode()
      get a handle to the sending node
      Returns:
      handle to the sending (pastry) node
    • getContent

      public String getContent()
      get the content string of this message
      Returns:
      the contained data as String
    • getContainedMessage

      public Message getContainedMessage() throws MalformedXMLException
      get the contained las2peer message
      Returns:
      the contained las2peer message
      Throws:
      MalformedXMLException - If the XML data string is malformed
    • getPriority

      public int getPriority()
      Specified by:
      getPriority in interface rice.p2p.commonapi.Message