Package com.attivio.sdk.ingest
Class DocumentList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- com.attivio.sdk.esb.AbstractListMessage<IngestDocument>
-
- com.attivio.sdk.ingest.DocumentList
-
- All Implemented Interfaces:
GroupedMessage
,PersistsThroughCycles
,PlatformMessage
,IndexMessage
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<IngestDocument>
,java.util.Collection<IngestDocument>
,java.util.List<IngestDocument>
,java.util.RandomAccess
public class DocumentList extends AbstractListMessage<IngestDocument> implements java.lang.Iterable<IngestDocument>, IndexMessage, PersistsThroughCycles, GroupedMessage
The basic container for a collection of IngestDocuments.- 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 DocumentList()
The default constructorDocumentList(int size)
Creates an empty document list, with pre-allocated space forsize
documents.DocumentList(java.util.UUID cid, WorkflowQueue workFlows)
Constructor with a client ID and a workflow queue.DocumentList(java.util.UUID cid, java.lang.String... workFlows)
Constructor with a client ID and a list of workflows.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageToGroup(GroupedMessage msg)
Addsmsg
to the group.DocumentList
clone()
Clones a message.protected IngestDocument
clone(IngestDocument tmp)
boolean
containsDocument(java.lang.String docID)
Determines if this list contains a given document based on docID.boolean
equals(java.lang.Object other)
IngestDocument
getDocument(java.lang.String id)
Gets a document from this list by document ID.long
getEstimatedSize()
GroupedMessageId
getGroupedMessageId()
java.util.List<java.lang.String>
getIds()
Returns a new unmodifiable list of all document ID's in this DocumentList.int
getSize()
Gets the size of the list.int
hashCode()
void
setGroupedMessageId(GroupedMessageId groupedMessageId)
Sets the GroupedMessageId for this message.-
Methods inherited from class com.attivio.sdk.esb.AbstractListMessage
addMessageHistory, addMessageHistory, getClientId, getMessageHistory, getMessageId, getMetadata, getProperty, getWorkflowQueue, getWorkflowQueue, isRedelivered, removeProperty, setClientId, setMessageId, setProperty, setRedelivered, setWorkflowQueue, setWorkflowQueue, toMessageString, toString, 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
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.attivio.sdk.esb.PlatformMessage
addMessageHistory, addMessageHistory, getClientId, getMessageHistory, getMessageId, getMetadata, getProperty, getWorkflowQueue, getWorkflowQueue, isRedelivered, removeProperty, setClientId, setMessageId, setProperty, setRedelivered, setWorkflowQueue, setWorkflowQueue, toMessageString
-
-
-
-
Constructor Detail
-
DocumentList
public DocumentList()
The default constructor
-
DocumentList
public DocumentList(int size)
Creates an empty document list, with pre-allocated space forsize
documents.
-
DocumentList
public DocumentList(java.util.UUID cid, java.lang.String... workFlows)
Constructor with a client ID and a list of workflows.- Parameters:
cid
- the client IDworkFlows
- the list of workflows
-
DocumentList
public DocumentList(java.util.UUID cid, WorkflowQueue workFlows)
Constructor with a client ID and a workflow queue.- Parameters:
cid
- the client IDworkFlows
- the workflow queue
-
-
Method Detail
-
containsDocument
public boolean containsDocument(java.lang.String docID)
Determines if this list contains a given document based on docID.- Parameters:
docID
- the document ID- Returns:
- true if the list contains the document with the specified ID
-
getDocument
public IngestDocument getDocument(java.lang.String id)
Gets a document from this list by document ID.- Parameters:
id
- the ID to look for- Returns:
- the document or null if not in this list
-
getSize
public int getSize()
Gets the size of the list.
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection<IngestDocument>
- Specified by:
hashCode
in interfacejava.util.List<IngestDocument>
- Overrides:
hashCode
in classAbstractListMessage<IngestDocument>
-
equals
public boolean equals(java.lang.Object other)
- Specified by:
equals
in interfacejava.util.Collection<IngestDocument>
- Specified by:
equals
in interfacejava.util.List<IngestDocument>
- Overrides:
equals
in classAbstractListMessage<IngestDocument>
-
clone
public DocumentList clone()
Clones a message. The message ID is not cloned.- Specified by:
clone
in interfaceIndexMessage
- Specified by:
clone
in interfacePlatformMessage
- Overrides:
clone
in classAbstractListMessage<IngestDocument>
- Returns:
- the cloned index message
-
getIds
public java.util.List<java.lang.String> getIds()
Returns a new unmodifiable list of all document ID's in this DocumentList.
-
getGroupedMessageId
public GroupedMessageId getGroupedMessageId()
- Specified by:
getGroupedMessageId
in interfaceGroupedMessage
- Returns:
- the GroupedMessageId for this message
-
setGroupedMessageId
public void setGroupedMessageId(GroupedMessageId groupedMessageId)
Description copied from interface:GroupedMessage
Sets the GroupedMessageId for this message. This method should normally be used only for the first message in the group with subsequent messages being added to the group viaGroupedMessage.addMessageToGroup(GroupedMessage)
.- Specified by:
setGroupedMessageId
in interfaceGroupedMessage
-
addMessageToGroup
public void addMessageToGroup(GroupedMessage msg)
Description copied from interface:GroupedMessage
Addsmsg
to the group. For ordering purposes,msg
will appear after this.- Specified by:
addMessageToGroup
in interfaceGroupedMessage
-
clone
protected IngestDocument clone(IngestDocument tmp)
- Specified by:
clone
in classAbstractListMessage<IngestDocument>
-
getEstimatedSize
public long getEstimatedSize()
- Specified by:
getEstimatedSize
in interfacePlatformMessage
- Overrides:
getEstimatedSize
in classAbstractListMessage<IngestDocument>
-
-