public class OperationContext extends Object implements Map<String,Object>
Context objects are:
setCoreSession(CoreSession)
method. When running the operation chain
in asynchronous mode another session will be created by preserving the current session credentials.
Each entry in the operation list contains the ID of the operation to be run and a map of operation parameters to use when initializing the operation.
The context parameters map can be filled with contextual information by the caller. Each operation will be able to access the contextual data at runtime and to update it if needed.
Modifier and Type | Class and Description |
---|---|
protected static class |
OperationContext.ChainCallback
ChainCallback store all automation traces for execution
|
Modifier and Type | Field and Description |
---|---|
protected OperationContext.ChainCallback |
chainCallback |
protected List<CleanupHandler> |
cleanupHandlers |
protected boolean |
commit
Whether to save the session at the end of the chain execution.
|
protected Object |
input
The execution input that will be updated after an operation run with the operation output
|
protected LoginStack |
loginStack
A logins stack manage multiple logins and sessions in a single chain execution
|
protected Map<String,List<Object>> |
stacks
Each stack use a key the type of the objects in the stack: document, documents, blob or blobs
|
protected List<String> |
trace
A list of trace.
|
protected Map<String,Object> |
vars
The context variables map
|
Constructor and Description |
---|
OperationContext() |
OperationContext(CoreSession session) |
OperationContext(CoreSession session,
Map<String,Object> vars) |
OperationContext(OperationContext ctx) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
protected boolean commit
protected final transient List<CleanupHandler> cleanupHandlers
protected final transient Map<String,List<Object>> stacks
protected transient LoginStack loginStack
protected Object input
protected List<String> trace
protected OperationContext.ChainCallback chainCallback
public OperationContext()
public OperationContext(OperationContext ctx)
public OperationContext(CoreSession session)
public OperationContext(CoreSession session, Map<String,Object> vars)
public void setCoreSession(CoreSession session)
public void setCommit(boolean commit)
public boolean isCommit()
public CoreSession getCoreSession()
public LoginStack getLoginStack()
public Principal getPrincipal()
public <T> T getAdapter(Class<T> type)
@Deprecated public void addTrace(String trace)
@Deprecated public List<String> getTrace()
@Deprecated public String getFormattedTrace()
public void addCleanupHandler(CleanupHandler handler)
public void removeCleanupHandler(CleanupHandler handler)
public void dispose() throws OperationException
OperationException
public void setRollback()
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
public boolean containsValue(Object value)
containsValue
in interface Map<String,Object>
public OperationCallback getChainCallback()
public void addChainCallback(OperationCallback chainCallback)
public OperationContext getSubContext(Boolean isolate, Object input)
isolate
- define if keeps context variables for the subcontextCopyright © 2015 Nuxeo SA. All rights reserved.