org.nuxeo.ecm.automation
Class OperationContext
java.lang.Object
org.nuxeo.ecm.automation.OperationContext
- All Implemented Interfaces:
- Map<String,Object>
- Direct Known Subclasses:
- RestOperationContext
public class OperationContext
- extends Object
- implements Map<String,Object>
An operation context. Holds context objects, a context parameters map and a
list of operations to run.
Context objects are:
- The Operation Chain Input - optional. It will be used as the input for
the first operation in the chain. If input is null then only VOID methods in
the first operation will be matched.
- A Core Session - which is optional and should be provided by the caller.
(either at creation time as a constructor argument, either using the
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.
- Author:
- Bogdan Stefanescu
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
OperationContext
public OperationContext()
OperationContext
public OperationContext(CoreSession session)
OperationContext
public OperationContext(CoreSession session,
Map<String,Object> vars)
setCoreSession
public void setCoreSession(CoreSession session)
setCommit
public void setCommit(boolean commit)
isCommit
public boolean isCommit()
getCoreSession
public CoreSession getCoreSession()
getLoginStack
public LoginStack getLoginStack()
getPrincipal
public Principal getPrincipal()
setInput
public void setInput(Object input)
getInput
public Object getInput()
peek
public Object peek(String type)
push
public void push(String type,
Object obj)
pop
public Object pop(String type)
pull
public Object pull(String type)
getAdapter
public <T> T getAdapter(Class<T> type)
addTrace
public void addTrace(String trace)
getTrace
public List<String> getTrace()
getFormattedTrace
public String getFormattedTrace()
addCleanupHandler
public void addCleanupHandler(CleanupHandler handler)
removeCleanupHandler
public void removeCleanupHandler(CleanupHandler handler)
dispose
public void dispose()
throws OperationException
- Throws:
OperationException
setRollback
public void setRollback()
- Set the rollback mark on the current tx. This will cause the transaction to rollback.
Also this is setting the session commit flag on false
getVars
public Map<String,Object> getVars()
size
public int size()
- the map API
- Specified by:
size
in interface Map<String,Object>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface Map<String,Object>
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interface Map<String,Object>
containsValue
public boolean containsValue(Object value)
- Specified by:
containsValue
in interface Map<String,Object>
get
public Object get(Object key)
- Specified by:
get
in interface Map<String,Object>
put
public Object put(String key,
Object value)
- Specified by:
put
in interface Map<String,Object>
remove
public Object remove(Object key)
- Specified by:
remove
in interface Map<String,Object>
putAll
public void putAll(Map<? extends String,? extends Object> m)
- Specified by:
putAll
in interface Map<String,Object>
clear
public void clear()
- Specified by:
clear
in interface Map<String,Object>
keySet
public Set<String> keySet()
- Specified by:
keySet
in interface Map<String,Object>
values
public Collection<Object> values()
- Specified by:
values
in interface Map<String,Object>
entrySet
public Set<Map.Entry<String,Object>> entrySet()
- Specified by:
entrySet
in interface Map<String,Object>
Copyright © 2011 Nuxeo SAS. All Rights Reserved.