Package com.yahoo.docproc
Class Processing
java.lang.Object
com.yahoo.docproc.impl.ProcessingAccess
com.yahoo.docproc.Processing
A document processing. This contains the document(s) or document update(s) to process,
a map of processing context data and the processing instance to
invoke the next time any work needs to be done on this processing.
- Author:
- bratseth
-
Field Summary
-
Constructor Summary
ConstructorDescriptionCreate a Processing with no documents.Processing
(String service, com.yahoo.document.DocumentOperation documentOperation, CallStack callStack) Create a processing with one document. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDocumentOperation
(com.yahoo.document.DocumentOperation documentOperation) Returns the processors to call in this processingvoid
Clears all context variables that have been setstatic Processing
createProcessingFromDocumentOperations
(String service, List<com.yahoo.document.DocumentOperation> documentsAndUpdates, CallStack callStack) Creates a Processing from a list of operations.List<com.yahoo.document.DocumentOperation>
protected ProcessingEndpoint
protected List<com.yahoo.document.DocumentOperation>
Returns the name of the service processing this.getVariable
(String name) Returns a context variable, or null if it is not setReturns an iterator of all context variables that are setboolean
hasVariable
(String name) Returns true if this variable is present, even if it is nullstatic Processing
of
(com.yahoo.document.DocumentOperation documentOperation) Create a Processing from the given document operationremoveVariable
(String name) protected void
setCallStack
(CallStack callStack) protected void
setEndpoint
(ProcessingEndpoint endpoint) void
void
setServiceName
(String service) Sets the name of the service processing this.void
setVariable
(String name, Object value) Sets a context variable.timeLeft()
toString()
-
Field Details
-
NO_TIMEOUT
-
-
Constructor Details
-
Processing
public Processing()Create a Processing with no documents. Useful with DocprocService.process(Processing). Note that the callstack is initially empty when using this constructor (but it is set by DocprocService.process(Processing).) -
Processing
public Processing(String service, com.yahoo.document.DocumentOperation documentOperation, CallStack callStack) Create a processing with one document. The given document put or document update will be the single element indocumentOperations
.- Parameters:
service
- the unique name of the service processing thisdocumentOperation
- document operation (DocumentPut or DocumentUpdate)callStack
- the document processors to call in this processing. This tranfers ownership of this structure to this class. The caller must not modify it
-
-
Method Details
-
of
Create a Processing from the given document operation -
createProcessingFromDocumentOperations
public static Processing createProcessingFromDocumentOperations(String service, List<com.yahoo.document.DocumentOperation> documentsAndUpdates, CallStack callStack) Creates a Processing from a list of operations.- Parameters:
service
- the unique name of the service processing thisdocumentsAndUpdates
- the document operation list. This transfers ownership of this list to this class. The caller must not modify itcallStack
- the document processors to call in this processing. This transfers ownership of this structure to this class. The caller must not modify it
-
getServiceName
Returns the name of the service processing this. This will never return null -
setServiceName
Sets the name of the service processing this. -
getVariable
Returns a context variable, or null if it is not set -
getVariableAndNameIterator
Returns an iterator of all context variables that are set- Returns:
- an iterator over objects of type Map.Entry
-
clearVariables
public void clearVariables()Clears all context variables that have been set -
setVariable
Sets a context variable. -
removeVariable
-
hasVariable
Returns true if this variable is present, even if it is null -
getEndpoint
- Overrides:
getEndpoint
in classProcessingAccess
-
setEndpoint
- Overrides:
setEndpoint
in classProcessingAccess
-
addDocumentOperation
public void addDocumentOperation(com.yahoo.document.DocumentOperation documentOperation) -
getDocumentOperations
-
callStack
Returns the processors to call in this processing -
setCallStack
- Overrides:
setCallStack
in classProcessingAccess
-
getOnceOperationsToBeProcessed
- Overrides:
getOnceOperationsToBeProcessed
in classProcessingAccess
-
setExpiresAt
-
timeLeft
- Returns:
- time left or
NO_TIMEOUT
if processing has no timeout
-
toString
-