Interface OCommandContext
- All Known Subinterfaces:
OServerCommandContext
- All Known Implementing Classes:
OBasicCommandContext,OBasicServerCommandContext,OETLContext
public interface OCommandContext
Basic interface for commands. Manages the context variables during execution.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com)
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidbeginExecution(long timeoutMs, OCommandContext.TIMEOUT_STRATEGY iStrategy) booleanCheck if timeout is elapsed, if defined.copy()Creates a copy of execution context.voiddeclareScriptVariable(String varName) voidgetVariable(String iName) getVariable(String iName, Object iDefaultValue) incrementVariable(String getNeighbors) booleanbooleanbooleanisScriptVariableDeclared(String varName) voidmerge(OCommandContext iContext) Merges a context with current one.setChild(OCommandContext context) voidsetCurrent(OResult result) voidsetCurrentIfMissing(OResult result) voidsetInputParameters(Map<Object, Object> inputParameters) setParent(OCommandContext iParentContext) setRecordingMetrics(boolean recordMetrics) setVariable(String iName, Object iValue) voidlongupdateMetric(String iName, long iValue) Updates a counter.
-
Method Details
-
getVariable
-
getVariable
-
setVariable
-
incrementVariable
-
getVariables
-
getParent
OCommandContext getParent() -
setParent
-
setChild
-
updateMetric
Updates a counter. Used to record metrics.- Parameters:
iName- Metric's nameiValue- delta to add or subtract- Returns:
-
isRecordingMetrics
boolean isRecordingMetrics() -
setRecordingMetrics
-
beginExecution
-
checkTimeout
boolean checkTimeout()Check if timeout is elapsed, if defined.- Returns:
- false if it the timeout is elapsed and strategy is "return"
- Throws:
OTimeoutException- if the strategy is "exception" (default)
-
getInputParameters
-
setInputParameters
-
copy
OCommandContext copy()Creates a copy of execution context. -
merge
Merges a context with current one.- Parameters:
iContext-
-
getDatabase
ODatabaseSession getDatabase() -
declareScriptVariable
-
isScriptVariableDeclared
-
isProfiling
boolean isProfiling() -
startProfiling
-
endProfiling
-
getStats
-
getCurrent
OResult getCurrent() -
setCurrent
-
setCurrentIfMissing
-