Class Message

java.lang.Object
org.codehaus.plexus.build.connect.messages.Message
Direct Known Subclasses:
InitMessage, MojoMessage, ProjectMessage, ProjectsMessage, RefreshMessage, SessionMessage

public class Message extends Object
A message exchanged between two endpoints, usually an IDE and a maven build
  • Method Details

    • keys

      public Stream<String> keys()
      Returns:
      the keys stored in this message
    • getProperty

      public String getProperty(String key)
      Get a String property from the payload
      Parameters:
      key - the key to fetch
      Returns:
      the value
    • getProperty

      public String getProperty(String key, String defaultValue)
      Get a String property from the payload
      Parameters:
      key - the key to fetch
      defaultValue - default value to use when no value is present
      Returns:
      the value
    • getBooleanProperty

      public boolean getBooleanProperty(String key)
      Get a boolean property from the payload
      Parameters:
      key - the key to fetch
      Returns:
      the value
    • getBooleanProperty

      public boolean getBooleanProperty(String key, boolean defaultValue)
      Get a boolean property from the payload
      Parameters:
      key - the key to fetch
      defaultValue - the value to use if not value is present
      Returns:
      the value
    • getSessionId

      public String getSessionId()
      Returns:
      the remote session id for this message, only valid for messages not created locally
    • serialize

      public byte[] serialize()
      Returns:
      the bytes using the message session id
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • serialize

      public byte[] serialize(String sessionId)
      Creates bytes for this message using the session id
      Parameters:
      sessionId -
      Returns:
      the bytes using the supplied message id
    • replyTo

      public static Message replyTo(Message message, Map<String,String> payload)
      Creates a reply to a message using the thread id and session id from the original but with the provided payload
      Parameters:
      message - the reply message to inherit from
      payload - the new payload
      Returns:
      the message
    • decode

      public static Message decode(byte[] bytes)
      Decodes a message from its bytes
      Parameters:
      bytes - the bytes to decode
      Returns:
      the message or null if decoding failed
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object