Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.automation
Class OperationContext

java.lang.Object
  extended by 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:

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 Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
OperationContext()
           
OperationContext(CoreSession session)
           
OperationContext(CoreSession session, Map<String,Object> vars)
           
 
Method Summary
 void addCleanupHandler(CleanupHandler handler)
           
 void addTrace(String trace)
           
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 void dispose()
           
 Set<Map.Entry<String,Object>> entrySet()
           
 Object get(Object key)
           
<T> T
getAdapter(Class<T> type)
           
 CoreSession getCoreSession()
           
 String getFormattedTrace()
           
 Object getInput()
           
 LoginStack getLoginStack()
           
 Principal getPrincipal()
           
 List<String> getTrace()
           
 Map<String,Object> getVars()
           
 boolean isCommit()
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 Object peek(String type)
           
 Object pop(String type)
           
 Object pull(String type)
           
 void push(String type, Object obj)
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> m)
           
 Object remove(Object key)
           
 void removeCleanupHandler(CleanupHandler handler)
           
 void setCommit(boolean commit)
           
 void setCoreSession(CoreSession session)
           
 void setInput(Object input)
           
 void setRollback()
          Set the rollback mark on the current tx.
 int size()
          the map API
 Collection<Object> values()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

OperationContext

public OperationContext()

OperationContext

public OperationContext(CoreSession session)

OperationContext

public OperationContext(CoreSession session,
                        Map<String,Object> vars)
Method Detail

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>

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.