public class IndexingCommand extends Object implements Serializable
Modifier and Type | Class and Description |
---|---|
static class |
IndexingCommand.Type |
Modifier and Type | Field and Description |
---|---|
protected String |
id |
protected long |
order |
protected String |
path |
static String |
PREFIX |
protected boolean |
recurse |
protected String |
repositoryName |
protected List<String> |
schemas |
protected static AtomicLong |
seq |
protected String |
sessionId |
protected boolean |
sync |
protected String |
targetDocumentId |
protected IndexingCommand.Type |
type |
Modifier | Constructor and Description |
---|---|
protected |
IndexingCommand() |
|
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) |
protected boolean |
canBeMerged(IndexingCommand other) |
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() |
long |
getOrder() |
String |
getRepositoryName() |
String[] |
getSchemas() |
DocumentModel |
getTargetDocument()
Return the document or null if it does not exists anymore.
|
String |
getTargetDocumentId() |
IndexingCommand.Type |
getType() |
protected DocumentModel |
getValidTargetDocument(DocumentModel target) |
boolean |
isRecurse() |
boolean |
isSync() |
void |
makeSync()
Try to make the command synchronous.
|
protected void |
merge(boolean sync,
boolean recurse) |
boolean |
merge(IndexingCommand other) |
void |
setOrder(long order) |
String |
toJSON() |
void |
toJSON(org.codehaus.jackson.JsonGenerator jsonGen) |
String |
toString() |
public static final String PREFIX
protected IndexingCommand.Type type
protected boolean sync
protected boolean recurse
protected String targetDocumentId
protected String repositoryName
protected long order
protected static transient AtomicLong seq
protected IndexingCommand()
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 descendantsprotected DocumentModel getValidTargetDocument(DocumentModel target)
public void attach(CoreSession session)
public DocumentModel getTargetDocument()
IllegalStateException
- if there is no session attachedpublic String getRepositoryName()
public boolean merge(IndexingCommand other)
protected void merge(boolean sync, boolean recurse)
protected boolean canBeMerged(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 getTargetDocumentId()
public IndexingCommand clone(DocumentModel newDoc)
public String[] getSchemas()
public void addSchemas(String schema)
public void makeSync()
public long getOrder()
public void setOrder(long order)
Copyright © 2018 Nuxeo. All rights reserved.