public class OperationContext extends AbstractMap<String,Object> implements AutoCloseable
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.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
protected OperationCallback |
callback |
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,Deque<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 |
Modifier | Constructor and Description |
---|---|
|
OperationContext() |
|
OperationContext(CoreSession session) |
protected |
OperationContext(CoreSession session,
Map<String,Object> bindings) |
clear, clone, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
protected boolean commit
protected final transient List<CleanupHandler> cleanupHandlers
protected final transient Map<String,Deque<Object>> stacks
protected transient LoginStack loginStack
protected Object input
protected List<String> trace
protected OperationCallback callback
public OperationContext()
public OperationContext(CoreSession session)
protected OperationContext(CoreSession session, Map<String,Object> bindings)
public void setCoreSession(CoreSession session)
public void setCommit(boolean commit)
public boolean isCommit()
public CoreSession getCoreSession()
public LoginStack getLoginStack()
public Principal getPrincipal()
public void pop(Map<String,?> map)
map
- public <T> T getAdapter(Class<T> type)
public void addCleanupHandler(CleanupHandler handler)
public void removeCleanupHandler(CleanupHandler handler)
public void close() throws OperationException
close
in interface AutoCloseable
OperationException
public void setRollback()
public boolean containsKey(Object key)
containsKey
in interface Map<String,Object>
containsKey
in class AbstractMap<String,Object>
public OperationCallback getCallback()
public void setCallback(OperationCallback chainCallback)
public OperationContext getSubContext(boolean isolate, Object input)
isolate
- define if keeps context variables for the subcontextinput
- an input objectpublic OperationContext getSubContext(boolean isolate)
isolate
- define if keeps context variables for the subcontextCopyright © 2017 Nuxeo. All rights reserved.