public class JobMessage extends Object implements Serializable
| Constructor and Description |
|---|
JobMessage(String message)
Constructor that only stores a message.
|
JobMessage(String message,
byte[] payload)
Constructor that takes a message and payload with no action.
|
JobMessage(String message,
String action)
Constructor that takes a message and action with no payload.
|
JobMessage(String message,
String action,
byte[] payload)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static JobMessage |
fromByteArray(byte[] array)
Deserializes a
JobMessage object from a payload. |
String |
getAction()
Retrieves the action.
|
String |
getMessage()
Retrieves the message.
|
byte[] |
getPayload()
Retrieves the payload.
|
byte[] |
toByteArray()
Serializes this object.
|
String |
toString() |
public JobMessage(String message, String action, byte[] payload)
message - The message to store.action - The action associated with the message.payload - The serialized payload to send.public JobMessage(String message)
message - The message to store.public JobMessage(String message, String action)
message - The message to store.action - The action associated with the message.public JobMessage(String message, byte[] payload)
message - The message to store.payload - The payload to attach.public String getMessage()
String containing the message.public String getAction()
String containing the action.public byte[] getPayload()
byte[] containing the payload of data.public byte[] toByteArray()
byte[] containing the serialized data.public static JobMessage fromByteArray(byte[] array)
JobMessage object from a payload.array - byte[] of data to deserialize.JobMessage after deserialization, null if it could not be deserialized.Copyright © 2015. All rights reserved.