public class IndexingCommand extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
IndexingCommand.Type |
Constructor and Description |
---|
IndexingCommand(DocumentModel document,
IndexingCommand.Type commandType,
boolean sync,
boolean recurse)
Create an indexing command
|
Modifier and Type | Method and Description |
---|---|
void |
addSchemas(String schema) |
void |
attach(CoreSession session) |
IndexingCommand |
clone(DocumentModel newDoc) |
static IndexingCommand |
fromJSON(org.codehaus.jackson.JsonNode jsonNode) |
static IndexingCommand |
fromJSON(String json)
Create a command from a JSON string.
|
String |
getId() |
String |
getRepositoryName() |
String[] |
getSchemas() |
String |
getSignature()
Return a command signature used for deduplication
|
DocumentModel |
getTargetDocument()
Return the document or null if it does not exists anymore.
|
String |
getTargetDocumentId() |
IndexingCommand.Type |
getType() |
boolean |
isRecurse() |
boolean |
isSync() |
void |
makeSync()
Try to make the command synchronous.
|
boolean |
merge(IndexingCommand other) |
String |
toJSON() |
void |
toJSON(org.codehaus.jackson.JsonGenerator jsonGen) |
String |
toString() |
public static final String PREFIX
public IndexingCommand(DocumentModel document, IndexingCommand.Type commandType, boolean sync, boolean recurse)
document
- the target documentcommandType
- the type of commandsync
- if true the command will be processed on the same thread after transaction completion and the
Elasticsearch index will be refreshrecurse
- the command affect the document and all its descendantspublic void attach(CoreSession session)
public DocumentModel getTargetDocument()
IllegalStateException
- if there is no session attachedClientException
- if the document can not be loadedpublic String getRepositoryName()
public boolean merge(IndexingCommand other)
public boolean isSync()
public boolean isRecurse()
public IndexingCommand.Type getType()
public String toJSON() throws IOException
IOException
public void toJSON(org.codehaus.jackson.JsonGenerator jsonGen) throws IOException
IOException
public static IndexingCommand fromJSON(String json)
IllegalArgumentException
- if json is invalid or command is invalidpublic static IndexingCommand fromJSON(org.codehaus.jackson.JsonNode jsonNode)
public String getId()
public String getTargetDocumentId()
public IndexingCommand clone(DocumentModel newDoc)
public String[] getSchemas()
public void addSchemas(String schema)
public void makeSync()
public String getSignature()
Copyright © 2015 Nuxeo SA. All rights reserved.