Nuxeo Enterprise Platform 5.4

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:
java.io.Serializable
Direct Known Subclasses:
LockOperation, PingOperation, UnlockOperation

public abstract class Operation<T>
extends java.lang.Object
implements java.io.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 java.lang.String OPERATION_END
           
static java.lang.String OPERATION_START
           
static int RESERVED
           
static int RUNNING
           
static java.lang.String START_EVENT
           
static java.lang.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(java.util.List<Operation<?>> cmds)
           
 java.util.List<Operation<?>> getCommandStack()
           
static Operation<?> getCurrent()
           
 java.lang.Object getData()
           
 java.lang.Object getData(java.lang.String key)
           
 long getDuration()
           
 java.util.Date getEndedDate()
           
 int getFlags()
           
 ModificationSet getModifications()
           
 java.lang.String getName()
           
 Operation<?> getParent()
           
 T getResult()
           
 CoreSession getSession()
           
static Operation<?>[] getStack()
           
 java.util.Date getStartedDate()
           
 Status getStatus()
           
 boolean isFlagSet(int flag)
           
 boolean isRunning()
           
 boolean isStartedBefore(long time)
           
 boolean isTerminated()
           
 void printCommandStack(java.io.PrintStream out)
           
static Operation<?>[] printStack(java.io.PrintStream out)
           
 T run(CoreSession session, OperationHandler handler, ProgressMonitor monitor)
           
 void setData(java.lang.Object value)
           
 void setData(java.lang.String key, java.lang.Object value)
           
 void setFlags(int flags)
           
 java.lang.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 java.lang.String START_EVENT
See Also:
Constant Field Values

TERMINATE_EVENT

public static final java.lang.String TERMINATE_EVENT
See Also:
Constant Field Values

OPERATION_START

public static final java.lang.String OPERATION_START
See Also:
Constant Field Values

OPERATION_END

public static final java.lang.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(java.io.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 java.lang.String getName()

getParent

public final Operation<?> getParent()

getSession

public final CoreSession getSession()

run

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

getStartedDate

public java.util.Date getStartedDate()

getEndedDate

public java.util.Date getEndedDate()

getDuration

public long getDuration()

isStartedBefore

public boolean isStartedBefore(long time)

getCommandStack

public java.util.List<Operation<?>> getCommandStack()

fillCommandStack

public void fillCommandStack(java.util.List<Operation<?>> cmds)

printCommandStack

public void printCommandStack(java.io.PrintStream out)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.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 java.lang.Exception
Throws:
java.lang.Exception

getData

public java.lang.Object getData()

getData

public java.lang.Object getData(java.lang.String key)

setData

public void setData(java.lang.Object value)

setData

public void setData(java.lang.String key,
                    java.lang.Object value)

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.