Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.operation
Class Operation<T>

java.lang.Object
  extended by org.nuxeo.ecm.core.api.operation.Operation<T>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
LockOperation, PingOperation, UnlockOperation

public abstract class Operation<T>
extends Object
implements Serializable

Author:
Bogdan Stefanescu
See Also:
Serialized Form

Field Summary
static int ASYNC
           
static int BLOCK_CHILD_NOTIFICATIONS
           
static int BLOCK_JMS
           
static int INTERNAL
           
static int KEYED_DATA
           
static int NONE
          Operation flags.
static String OPERATION_END
           
static String OPERATION_START
           
static int RESERVED
           
static int RUNNING
           
static String START_EVENT
           
static String TERMINATE_EVENT
           
static int TERMINATED
           
static int URGENT
           
static int USER_FLAGS
          User flags may be used by clients to set custom flags on the operation.
 
Method Summary
 void addModification(DocumentRef ref, int modifType)
           
 void addModification(Modification modif)
           
 void clearFlags(int flags)
           
abstract  T doRun(ProgressMonitor montior)
           
 void fillCommandStack(List<Operation<?>> cmds)
           
 List<Operation<?>> getCommandStack()
           
static Operation<?> getCurrent()
           
 Object getData()
           
 Object getData(String key)
           
 long getDuration()
           
 Date getEndedDate()
           
 int getFlags()
           
 ModificationSet getModifications()
           
 String getName()
           
 Operation<?> getParent()
           
 T getResult()
           
 CoreSession getSession()
           
static Operation<?>[] getStack()
           
 Date getStartedDate()
           
 Status getStatus()
           
 boolean isFlagSet(int flag)
           
 boolean isRunning()
           
 boolean isStartedBefore(long time)
           
 boolean isTerminated()
           
 void printCommandStack(PrintStream out)
           
static Operation<?>[] printStack(PrintStream out)
           
 T run(CoreSession session, OperationHandler handler, ProgressMonitor monitor)
           
 void setData(Object value)
           
 void setData(String key, Object value)
           
 void setFlags(int flags)
           
 String toString()
           
static int USER_FLAG(int n)
          A convenience method to compute the correct user flag from the 0 based representation of that bit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

START_EVENT

public static final String START_EVENT
See Also:
Constant Field Values

TERMINATE_EVENT

public static final String TERMINATE_EVENT
See Also:
Constant Field Values

OPERATION_START

public static final String OPERATION_START
See Also:
Constant Field Values

OPERATION_END

public static final String OPERATION_END
See Also:
Constant Field Values

NONE

public static final int NONE
Operation flags. The first 2 bits are reserved to operation execution state The first 8 bits are reserved (bits 0-7)

See Also:
Constant Field Values

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

TERMINATED

public static final int TERMINATED
See Also:
Constant Field Values

INTERNAL

public static final int INTERNAL
See Also:
Constant Field Values

URGENT

public static final int URGENT
See Also:
Constant Field Values

ASYNC

public static final int ASYNC
See Also:
Constant Field Values

BLOCK_JMS

public static final int BLOCK_JMS
See Also:
Constant Field Values

KEYED_DATA

public static final int KEYED_DATA
See Also:
Constant Field Values

BLOCK_CHILD_NOTIFICATIONS

public static final int BLOCK_CHILD_NOTIFICATIONS
See Also:
Constant Field Values

RESERVED

public static final int RESERVED
See Also:
Constant Field Values

USER_FLAGS

public static final int USER_FLAGS
User flags may be used by clients to set custom flags on the operation. These flags must use only the range of bits from 8 to 31 (the first byte is reserved for core use)

See Also:
Constant Field Values
Method Detail

USER_FLAG

public static int USER_FLAG(int n)
A convenience method to compute the correct user flag from the 0 based representation of that bit

Parameters:
n -
Returns:

getCurrent

public static Operation<?> getCurrent()

getStack

public static Operation<?>[] getStack()

printStack

public static Operation<?>[] printStack(PrintStream out)

getStatus

public final Status getStatus()

getFlags

public final int getFlags()

setFlags

public final void setFlags(int flags)

clearFlags

public final void clearFlags(int flags)

isRunning

public final boolean isRunning()

isTerminated

public final boolean isTerminated()

isFlagSet

public final boolean isFlagSet(int flag)

getResult

public final T getResult()

getName

public final String getName()

getParent

public final Operation<?> getParent()

getSession

public final CoreSession getSession()

run

public T run(CoreSession session,
             OperationHandler handler,
             ProgressMonitor monitor)

getStartedDate

public Date getStartedDate()

getEndedDate

public Date getEndedDate()

getDuration

public long getDuration()

isStartedBefore

public boolean isStartedBefore(long time)

getCommandStack

public List<Operation<?>> getCommandStack()

fillCommandStack

public void fillCommandStack(List<Operation<?>> cmds)

printCommandStack

public void printCommandStack(PrintStream out)

toString

public String toString()
Overrides:
toString in class Object

addModification

public void addModification(Modification modif)

addModification

public void addModification(DocumentRef ref,
                            int modifType)

getModifications

public ModificationSet getModifications()

doRun

public abstract T doRun(ProgressMonitor montior)
                 throws Exception
Throws:
Exception

getData

public Object getData()

getData

public Object getData(String key)

setData

public void setData(Object value)

setData

public void setData(String key,
                    Object value)

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.