Class Message
java.lang.Object
org.codehaus.plexus.build.connect.messages.Message
- Direct Known Subclasses:
InitMessage,MojoMessage,ProjectMessage,ProjectsMessage,RefreshMessage,SessionMessage
A message exchanged between two endpoints, usually an IDE and a maven build
-
Method Summary
Modifier and TypeMethodDescriptionstatic Messagedecode(byte[] bytes) Decodes a message from its bytesbooleanbooleangetBooleanProperty(String key) Get a boolean property from the payloadbooleangetBooleanProperty(String key, boolean defaultValue) Get a boolean property from the payloadgetProperty(String key) Get a String property from the payloadgetProperty(String key, String defaultValue) Get a String property from the payloadinthashCode()keys()static MessageCreates a reply to a message using the thread id and session id from the original but with the provided payloadbyte[]byte[]Creates bytes for this message using the session idtoString()
-
Method Details
-
keys
- Returns:
- the keys stored in this message
-
getProperty
Get a String property from the payload- Parameters:
key- the key to fetch- Returns:
- the value
-
getProperty
Get a String property from the payload- Parameters:
key- the key to fetchdefaultValue- default value to use when no value is present- Returns:
- the value
-
getBooleanProperty
Get a boolean property from the payload- Parameters:
key- the key to fetch- Returns:
- the value
-
getBooleanProperty
Get a boolean property from the payload- Parameters:
key- the key to fetchdefaultValue- the value to use if not value is present- Returns:
- the value
-
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
-
serialize
Creates bytes for this message using the session id- Parameters:
sessionId-- Returns:
- the bytes using the supplied message id
-
replyTo
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 frompayload- the new payload- Returns:
- the message
-
decode
Decodes a message from its bytes- Parameters:
bytes- the bytes to decode- Returns:
- the message or
nullif decoding failed
-
hashCode
public int hashCode() -
equals
-