Class IngestDocument
- java.lang.Object
-
- com.attivio.sdk.ingest.IngestDocument
-
- All Implemented Interfaces:
LocaleAware,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<IngestField>
public class IngestDocument extends java.lang.Object implements java.lang.Iterable<IngestField>, java.io.Serializable, java.lang.Cloneable, LocaleAware
A document for content ingestion.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static DocumentModeDEFAULT_DOCUMENT_MODE
-
Constructor Summary
Constructors Constructor Description IngestDocument(java.lang.String id)Construct a new IngestDocument.IngestDocument(java.lang.String id, DocumentMode mode)Construct a new IngestDocument.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(java.lang.String name, Point value)Add aPointvalue tofield.voidaddValue(java.lang.String name, Shape value)Add aShapevalue tofield.voidaddValue(java.lang.String name, ContentPointer value)Add aContentPointervalue tofield.voidaddValue(java.lang.String field, IngestFieldValue value)Add avaluetofield.voidaddValue(java.lang.String name, java.lang.Boolean value)Add aBooleanvalue tofield.voidaddValue(java.lang.String name, java.lang.Number value)Add anumericvalue tofield.voidaddValue(java.lang.String name, java.lang.String value)Add aStringvalue tofield.voidaddValue(java.lang.String name, java.util.Date value)Add aDatevalue tofield.voidaddValue(java.lang.String name, org.w3c.dom.Document value)Add aDocumentvalue tofield.voidaddValues(java.lang.String field, Point... values)voidaddValues(java.lang.String field, Shape... values)voidaddValues(java.lang.String field, ContentPointer... values)voidaddValues(java.lang.String field, java.lang.Boolean... values)AddBooleanvaluestofield.voidaddValues(java.lang.String field, java.lang.Number... values)Addnumericvaluestofield.voidaddValues(java.lang.String field, java.lang.String... values)AddStringvaluestofield.voidaddValues(java.lang.String field, java.util.Date... values)AddDatevaluestofield.voidaddValues(java.lang.String field, org.w3c.dom.Document... values)AddDocumentvaluestofield.voidclear()Remove all fields and attributes.IngestDocumentclone()booleancontainsField(java.lang.String name)Get if this document containsfield.voidensureCapacity()booleanequals(java.lang.Object other)voidforEach(java.util.function.Consumer<? super IngestField> consumer)AttivioAclgetAcl()Get theAttivioAclfor this document.java.util.UUIDgetCorrelationId()Get the correlation ID for this document.longgetEstimatedSize()Get the estimated size of the document in bytes.IngestFieldgetField(java.lang.String field)Get afieldor null iffielddoes not exist.java.lang.Iterable<java.lang.String>getFieldNames()Return anIterablefor iterating over all unique field names.IngestFieldValuegetFirstValue(java.lang.String field)Get the firstIngestFieldValueforfieldor null if the field does not exist.AttivioGroupMembershipgetGroupMembership()Get theAttivioGroupMembershipfor this document.java.lang.StringgetId()Get the unique document id.java.util.LocalegetLocale()Get theLocalefor this field.DocumentModegetMode()Gets the mode for ingesting this document.AttivioPrincipalgetPrincipal()Get theAttivioPrincipalfor this document.java.lang.StringgetZone()Get the zone for this document.inthashCode()voidimportFields(IngestDocument doc)Import all fields into this document.java.util.Iterator<IngestField>iterator()Get an iterator for iterating over allfields.voidremoveField(java.lang.String name)Remove a field byname.voidrenameField(java.lang.String oldName, java.lang.String newName)Rename a field.voidsetAcl(AttivioAcl value)Set theAttivioAclfor this document.voidsetCorrelationId(java.util.UUID value)Set the correlation ID for this document.voidsetField(IngestField field)Set afieldfor this document.voidsetField(java.lang.String field, Point... values)Set thevaluesfor afield.voidsetField(java.lang.String field, Shape... values)Set thevaluesfor afield.voidsetField(java.lang.String field, ContentPointer... values)Set thevaluesfor afield.voidsetField(java.lang.String field, java.lang.Boolean... values)Set thevaluesfor afield.voidsetField(java.lang.String field, java.lang.Number... values)Set thevaluesfor afield.voidsetField(java.lang.String field, java.lang.String... values)Set thevaluesfor afield.voidsetField(java.lang.String field, java.util.Date... values)Set thevaluesfor afield.voidsetField(java.lang.String field, org.w3c.dom.Document... values)Set thevaluesfor afield.voidsetGroupMembership(AttivioGroupMembership value)Set theAttivioGroupMembershipfor this document.voidsetId(java.lang.String value)Set the unique document id.voidsetLocale(java.util.Locale value)Set theLocalefor this field.voidsetMode(DocumentMode value)Gets the mode for ingesting this document.voidsetPrincipal(AttivioPrincipal value)Set theAttivioPrincipalfor this document.voidsetZone(java.lang.String value)Set the zone for this document.intsize()Get the number of fields in this document.java.lang.StringtoString()
-
-
-
Field Detail
-
DEFAULT_DOCUMENT_MODE
public static final DocumentMode DEFAULT_DOCUMENT_MODE
-
-
Constructor Detail
-
IngestDocument
public IngestDocument(java.lang.String id)
Construct a new IngestDocument.
-
IngestDocument
public IngestDocument(java.lang.String id, DocumentMode mode)Construct a new IngestDocument.
-
-
Method Detail
-
getId
public java.lang.String getId()
Get the unique document id.
-
setId
public void setId(java.lang.String value)
Set the unique document id.
-
getCorrelationId
public java.util.UUID getCorrelationId()
Get the correlation ID for this document.The correlation ID is used to tie different instances of the same document sent in back to their original source.
-
setCorrelationId
public void setCorrelationId(java.util.UUID value)
Set the correlation ID for this document.WARNING: internal use only. The correlation ID is set by the system and should not be modified by client code.
-
getLocale
public java.util.Locale getLocale()
Get theLocalefor this field.- Specified by:
getLocalein interfaceLocaleAware
-
setLocale
public void setLocale(java.util.Locale value)
Set theLocalefor this field.- Specified by:
setLocalein interfaceLocaleAware
-
getMode
public DocumentMode getMode()
Gets the mode for ingesting this document.
-
setMode
public void setMode(DocumentMode value)
Gets the mode for ingesting this document.
-
getAcl
public AttivioAcl getAcl()
Get theAttivioAclfor this document.
-
setAcl
public void setAcl(AttivioAcl value)
Set theAttivioAclfor this document.
-
getPrincipal
public AttivioPrincipal getPrincipal()
Get theAttivioPrincipalfor this document.
-
setPrincipal
public void setPrincipal(AttivioPrincipal value)
Set theAttivioPrincipalfor this document.
-
getGroupMembership
public AttivioGroupMembership getGroupMembership()
Get theAttivioGroupMembershipfor this document.
-
setGroupMembership
public void setGroupMembership(AttivioGroupMembership value)
Set theAttivioGroupMembershipfor this document.
-
getZone
public java.lang.String getZone()
Get the zone for this document.If set the zone acts as a composite key with the value of
getId().
-
setZone
public void setZone(java.lang.String value)
Set the zone for this document.
-
size
public int size()
Get the number of fields in this document.
-
containsField
public boolean containsField(java.lang.String name)
Get if this document containsfield.
-
getFieldNames
public java.lang.Iterable<java.lang.String> getFieldNames()
Return anIterablefor iterating over all unique field names.
-
iterator
public java.util.Iterator<IngestField> iterator()
Get an iterator for iterating over allfields.- Specified by:
iteratorin interfacejava.lang.Iterable<IngestField>
-
forEach
public void forEach(java.util.function.Consumer<? super IngestField> consumer)
- Specified by:
forEachin interfacejava.lang.Iterable<IngestField>
-
clear
public void clear()
Remove all fields and attributes.
-
getField
public IngestField getField(java.lang.String field)
Get afieldor null iffielddoes not exist.NOTE: if the field exists, but contains no field values,
nullwill be returned.
-
renameField
public void renameField(java.lang.String oldName, java.lang.String newName)Rename a field.If the field does not exist no action is taken.
-
removeField
public void removeField(java.lang.String name)
Remove a field byname.Will have no effect if field does not exist.
-
importFields
public void importFields(IngestDocument doc)
Import all fields into this document.Fields and FieldValues will be deep cloned.
-
getFirstValue
public IngestFieldValue getFirstValue(java.lang.String field)
Get the firstIngestFieldValueforfieldor null if the field does not exist.
-
setField
public void setField(IngestField field)
Set afieldfor this document.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, java.lang.String... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, java.lang.Number... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, java.lang.Boolean... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, java.util.Date... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, Point... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, Shape... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, ContentPointer... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
setField
public void setField(java.lang.String field, org.w3c.dom.Document... values)Set thevaluesfor afield.If a field already exists with the same name, it will be replaced.
-
addValues
public void addValues(java.lang.String field, java.lang.String... values)AddStringvaluestofield.
-
addValues
public void addValues(java.lang.String field, java.lang.Number... values)Addnumericvaluestofield.
-
addValues
public void addValues(java.lang.String field, java.util.Date... values)AddDatevaluestofield.
-
addValues
public void addValues(java.lang.String field, java.lang.Boolean... values)AddBooleanvaluestofield.
-
addValues
public void addValues(java.lang.String field, Point... values)
-
addValues
public void addValues(java.lang.String field, Shape... values)
-
addValues
public void addValues(java.lang.String field, org.w3c.dom.Document... values)AddDocumentvaluestofield.
-
addValues
public void addValues(java.lang.String field, ContentPointer... values)
-
addValue
public void addValue(java.lang.String field, IngestFieldValue value)Add avaluetofield.
-
addValue
public void addValue(java.lang.String name, java.lang.String value)Add aStringvalue tofield.
-
addValue
public void addValue(java.lang.String name, java.lang.Number value)Add anumericvalue tofield.
-
addValue
public void addValue(java.lang.String name, java.util.Date value)Add aDatevalue tofield.
-
addValue
public void addValue(java.lang.String name, java.lang.Boolean value)Add aBooleanvalue tofield.
-
addValue
public void addValue(java.lang.String name, org.w3c.dom.Document value)Add aDocumentvalue tofield.
-
addValue
public void addValue(java.lang.String name, ContentPointer value)Add aContentPointervalue tofield.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
clone
public IngestDocument clone()
- Overrides:
clonein classjava.lang.Object
-
ensureCapacity
public final void ensureCapacity()
-
getEstimatedSize
public long getEstimatedSize()
Get the estimated size of the document in bytes.NOTE: Includes size of remote content pointers.
-
-