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 voidaddMessageHistory(MessageHistory msg)Adds a message to the message history.voidaddMessageHistory(java.util.List<MessageHistory> historyList)Adds a list of history.AbstractListMessage<T>clone()Clones a message.protected abstract Tclone(T tmp)booleanequals(java.lang.Object other)java.util.UUIDgetClientId()Gets the client to which this message belongs (may have originated with the client or be a response to the client).longgetEstimatedSize()java.util.List<MessageHistory>getMessageHistory()Gets the list of components that have processed this message.MessageIdgetMessageId()Gets the message id associated with the message.MessageMetadatagetMetadata()Gets the message metadata from this message.java.lang.ObjectgetProperty(java.lang.String key)Gets an arbitrary property for the message.WorkflowQueuegetWorkflowQueue()Gets the workflow queue.WorkflowQueuegetWorkflowQueue(boolean createIfNull)Optionally creates a new empty queue if null.inthashCode()booleanisRedelivered()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.voidremoveProperty(java.lang.String key)Removes a property from the message.voidsetClientId(java.util.UUID clientId)Sets the client to which this message belongs.voidsetMessageId(MessageId msgId)Sets the message id associated with the message.voidsetProperty(java.lang.String key, java.lang.Object value)Sets an arbitrary property for the message.voidsetRedelivered(boolean redelivered)Sets the re-delivered flag.voidsetWorkflowQueue(WorkflowQueue workflowQueue)Sets the workflow queue.voidsetWorkflowQueue(java.lang.String... workflows)Sets the workflow queue.java.lang.StringtoMessageString()Gets a string-based representation of the message containing string data only.java.lang.StringtoString()java.lang.StringtoStringDetailed()-
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:
getPropertyin 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:
setPropertyin interfacePlatformMessage- Parameters:
key- the keyvalue- the value
-
removeProperty
public void removeProperty(java.lang.String key)
Removes a property from the message.- Specified by:
removePropertyin 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:
getClientIdin interfacePlatformMessage- Returns:
- the client ID
-
setClientId
public void setClientId(java.util.UUID clientId)
Sets the client to which this message belongs.- Specified by:
setClientIdin 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:
getMessageIdin interfacePlatformMessage- Returns:
- the message ID
-
setMessageId
public void setMessageId(MessageId msgId)
Sets the message id associated with the message.- Specified by:
setMessageIdin interfacePlatformMessage- Parameters:
msgId- the message ID
-
getMetadata
public MessageMetadata getMetadata()
Gets the message metadata from this message.- Specified by:
getMetadatain 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:
getMessageHistoryin interfacePlatformMessage- Returns:
- the message history
-
addMessageHistory
public void addMessageHistory(MessageHistory msg)
Adds a message to the message history.- Specified by:
addMessageHistoryin interfacePlatformMessage- Parameters:
msg- the message to add
-
addMessageHistory
public void addMessageHistory(java.util.List<MessageHistory> historyList)
Adds a list of history.- Specified by:
addMessageHistoryin 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:
getWorkflowQueuein 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:
getWorkflowQueuein 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.wfQueuewill be cloned.- Specified by:
setWorkflowQueuein interfacePlatformMessage- Parameters:
workflowQueue- the workflow queue
-
setWorkflowQueue
public void setWorkflowQueue(java.lang.String... workflows)
Sets the workflow queue.wfQueuewill be cloned.- Specified by:
setWorkflowQueuein interfacePlatformMessage- Parameters:
workflows- the list of workflows
-
toString
public java.lang.String toString()
- Overrides:
toStringin 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:
toMessageStringin 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:
isRedeliveredin interfacePlatformMessage- Returns:
- true if the message is re-delivered
-
setRedelivered
public void setRedelivered(boolean redelivered)
Sets the re-delivered flag.- Specified by:
setRedeliveredin 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:
clonein interfacePlatformMessage- Overrides:
clonein classjava.util.ArrayList<T>- Returns:
- the cloned index message
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSizein interfacePlatformMessage
-
-