Package com.attivio.sdk.esb
Class AbstractListMessage<T>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- com.attivio.sdk.esb.AbstractListMessage<T>
-
- Type Parameters:
T
-
- All Implemented Interfaces:
PlatformMessage
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<T>
,java.util.Collection<T>
,java.util.List<T>
,java.util.RandomAccess
- Direct Known Subclasses:
DocumentList
,MessageList
public abstract class AbstractListMessage<T> extends java.util.ArrayList<T> implements PlatformMessage
Abstract container for list based messages.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface com.attivio.sdk.esb.PlatformMessage
DEFAULT_MAX_LOG_LENGTH, MESSAGE_DROPPED, MESSAGE_SEND_TIME_PROP, PROP_MAX_LOG_LENGTH
-
-
Constructor Summary
Constructors Constructor Description AbstractListMessage()
Creates an empty list.AbstractListMessage(int size)
Creates an empty list of a fixed size.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addMessageHistory(MessageHistory msg)
Adds a message to the message history.void
addMessageHistory(java.util.List<MessageHistory> historyList)
Adds a list of history.AbstractListMessage<T>
clone()
Clones a message.protected abstract T
clone(T tmp)
boolean
equals(java.lang.Object other)
java.util.UUID
getClientId()
Gets the client to which this message belongs (may have originated with the client or be a response to the client).long
getEstimatedSize()
java.util.List<MessageHistory>
getMessageHistory()
Gets the list of components that have processed this message.MessageId
getMessageId()
Gets the message id associated with the message.MessageMetadata
getMetadata()
Gets the message metadata from this message.java.lang.Object
getProperty(java.lang.String key)
Gets an arbitrary property for the message.WorkflowQueue
getWorkflowQueue()
Gets the workflow queue.WorkflowQueue
getWorkflowQueue(boolean createIfNull)
Optionally creates a new empty queue if null.int
hashCode()
boolean
isRedelivered()
Returns true if the message (or its originating message) is re-delivered Redelivery is generally due to a failure and subsequent recovery in a fault tolerant system.void
removeProperty(java.lang.String key)
Removes a property from the message.void
setClientId(java.util.UUID clientId)
Sets the client to which this message belongs.void
setMessageId(MessageId msgId)
Sets the message id associated with the message.void
setProperty(java.lang.String key, java.lang.Object value)
Sets an arbitrary property for the message.void
setRedelivered(boolean redelivered)
Sets the re-delivered flag.void
setWorkflowQueue(WorkflowQueue workflowQueue)
Sets the workflow queue.void
setWorkflowQueue(java.lang.String... workflows)
Sets the workflow queue.java.lang.String
toMessageString()
Gets a string-based representation of the message containing string data only.java.lang.String
toString()
java.lang.String
toStringDetailed()
-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Method Detail
-
getProperty
public java.lang.Object getProperty(java.lang.String key)
Gets an arbitrary property for the message. Some transformations of messages may result in the value being converted to a String.- Specified by:
getProperty
in interfacePlatformMessage
- Parameters:
key
- the key- Returns:
- property value
-
setProperty
public void setProperty(java.lang.String key, java.lang.Object value)
Sets an arbitrary property for the message. Some transformations of messages may result in the value being converted to a String.- Specified by:
setProperty
in interfacePlatformMessage
- Parameters:
key
- the keyvalue
- the value
-
removeProperty
public void removeProperty(java.lang.String key)
Removes a property from the message.- Specified by:
removeProperty
in interfacePlatformMessage
-
getClientId
public java.util.UUID getClientId()
Gets the client to which this message belongs (may have originated with the client or be a response to the client).- Specified by:
getClientId
in interfacePlatformMessage
- Returns:
- the client ID
-
setClientId
public void setClientId(java.util.UUID clientId)
Sets the client to which this message belongs.- Specified by:
setClientId
in interfacePlatformMessage
- Parameters:
clientId
- the client ID
-
getMessageId
public MessageId getMessageId()
Gets the message id associated with the message. message ids are used for internal ordering guarantees and may change as the message propagates through the system.- Specified by:
getMessageId
in interfacePlatformMessage
- Returns:
- the message ID
-
setMessageId
public void setMessageId(MessageId msgId)
Sets the message id associated with the message.- Specified by:
setMessageId
in interfacePlatformMessage
- Parameters:
msgId
- the message ID
-
getMetadata
public MessageMetadata getMetadata()
Gets the message metadata from this message.- Specified by:
getMetadata
in interfacePlatformMessage
- Returns:
- the message metadata
-
getMessageHistory
public java.util.List<MessageHistory> getMessageHistory()
Gets the list of components that have processed this message. The returned list is unmodifiable.- Specified by:
getMessageHistory
in interfacePlatformMessage
- Returns:
- the message history
-
addMessageHistory
public void addMessageHistory(MessageHistory msg)
Adds a message to the message history.- Specified by:
addMessageHistory
in interfacePlatformMessage
- Parameters:
msg
- the message to add
-
addMessageHistory
public void addMessageHistory(java.util.List<MessageHistory> historyList)
Adds a list of history.- Specified by:
addMessageHistory
in interfacePlatformMessage
- Parameters:
historyList
-
-
getWorkflowQueue
public WorkflowQueue getWorkflowQueue()
Gets the workflow queue. Modifying the returned value will change the workflow destinations for the message.- Specified by:
getWorkflowQueue
in interfacePlatformMessage
- Returns:
- the workflow queue, may be null.
-
getWorkflowQueue
public WorkflowQueue getWorkflowQueue(boolean createIfNull)
Optionally creates a new empty queue if null. Modifying the returned value will change the workflow destinations for the message.- Specified by:
getWorkflowQueue
in interfacePlatformMessage
- Parameters:
createIfNull
- if true and the queue is not set, creates a new empty queue- Returns:
- the workflow queue
-
setWorkflowQueue
public void setWorkflowQueue(WorkflowQueue workflowQueue)
Sets the workflow queue.wfQueue
will be cloned.- Specified by:
setWorkflowQueue
in interfacePlatformMessage
- Parameters:
workflowQueue
- the workflow queue
-
setWorkflowQueue
public void setWorkflowQueue(java.lang.String... workflows)
Sets the workflow queue.wfQueue
will be cloned.- Specified by:
setWorkflowQueue
in interfacePlatformMessage
- Parameters:
workflows
- the list of workflows
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<T>
-
toStringDetailed
public java.lang.String toStringDetailed()
-
toMessageString
public java.lang.String toMessageString()
Gets a string-based representation of the message containing string data only.- Specified by:
toMessageString
in interfacePlatformMessage
- Returns:
- the message string
-
isRedelivered
public boolean isRedelivered()
Returns true if the message (or its originating message) is re-delivered Redelivery is generally due to a failure and subsequent recovery in a fault tolerant system.- Specified by:
isRedelivered
in interfacePlatformMessage
- Returns:
- true if the message is re-delivered
-
setRedelivered
public void setRedelivered(boolean redelivered)
Sets the re-delivered flag.- Specified by:
setRedelivered
in interfacePlatformMessage
-
hashCode
public int hashCode()
-
equals
public boolean equals(java.lang.Object other)
-
clone
public AbstractListMessage<T> clone()
Clones a message. The message ID is not cloned.- Specified by:
clone
in interfacePlatformMessage
- Overrides:
clone
in classjava.util.ArrayList<T>
- Returns:
- the cloned index message
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSize
in interfacePlatformMessage
-
-