Class MessageRemote

java.lang.Object
convex.net.message.Message
convex.net.message.MessageRemote

public class MessageRemote extends Message
Message subclass handling return of results via a remote connection
  • Constructor Details

  • Method Details

    • getConnection

      public Connection getConnection()
      Gets the Connection instance associated with this Message
      Returns:
      Connection instance. May be null.
    • withConnection

      public MessageRemote withConnection(Connection peerConnection)
    • reportResult

      public boolean reportResult(Result res)
      Reports a result back to the originator of the message. Will set a Result ID if necessary.
      Specified by:
      reportResult in class Message
      Parameters:
      res - Result record
      Returns:
      True if reported successfully, false otherwise
    • reportResult

      public boolean reportResult(CVMLong id, ACell reply)
      Description copied from class: Message
      Report a result for a given message ID
      Specified by:
      reportResult in class Message
      Parameters:
      id - Message ID
      reply - Value for result
      Returns:
      True if reported successfully, false otherwise
    • getOriginString

      public String getOriginString()
      Gets a String identifying the origin of the message. Used for logging.
      Specified by:
      getOriginString in class Message
      Returns:
      String representing message origin
    • sendData

      public boolean sendData(ACell data)
      Description copied from class: Message
      Sends a cell of data to the connected Peer
      Specified by:
      sendData in class Message
      Parameters:
      data - Data to send
      Returns:
      true if data sent, false otherwise
    • sendMissingData

      public boolean sendMissingData(Hash hash)
      Description copied from class: Message
      Sends a missing data request to the connected Peer
      Specified by:
      sendMissingData in class Message
      Parameters:
      hash - HAsh of missing data
      Returns:
      True if request sent, false otherwise