public final class OperationState extends Object
OperationState instances are used in many of the server-side extensibility methods, such as extendedPreInsert(). Currently, none of the methods on this class that are used internally to manage the state of operations are published. Until this changes, this class should be treated as an "opaque" container of operation state.
Modifier and Type | Field and Description |
---|---|
protected Vector |
m_AtomicOperations
The set of inidividual actions that comprise this operation.
|
protected HashMap |
m_CycleCheckMap
A table used to protect against cycles within the operation.
|
protected S_LibraryObject |
m_Object
The object that was the initial target of the operation.
|
protected S_LibrarySession |
m_Session
The session that is carrying out this operation.
|
static int |
OPERATIONTYPE_COPY
Operation type for Copy operations.
|
static int |
OPERATIONTYPE_DELETE
Operation type for Delete operations.
|
static int |
OPERATIONTYPE_FREE
Operation type for Free operations.
|
static int |
OPERATIONTYPE_INSERT
Operation type for Insert operations.
|
static int |
OPERATIONTYPE_UNDELETE
Operation type for Undelete operations.
|
static int |
OPERATIONTYPE_UPDATE
Operation type for Update operations.
|
Constructor and Description |
---|
OperationState(S_LibrarySession session,
S_LibraryObject obj)
Construct an OperationState on a specified initial object, on
behalf of a session.
|
Modifier and Type | Method and Description |
---|---|
void |
addAtomicOperation(S_LibraryObject obj,
int operationType,
S_LibraryObjectDefinition sdef)
add an atomic operation to this OperationState.
|
void |
addAtomicOperation(S_LibraryObject obj,
int operationType,
S_LibraryObjectDefinition sdef,
Object customObject)
add an atomic operation to this OperationState, specifying a custom
object related to the operation.
|
protected void |
executeAtomicOperations()
execute all of the atomic operations in the order in which they
were added to this OperationState.
|
Object |
getAtomicOperationCustomObject(S_LibraryObject obj,
int operationType)
get the custom object specified when an AtomicOperation was added.
|
S_LibraryObjectDefinition |
getAtomicOperationDefinition(S_LibraryObject obj,
int operationType)
get the Definition specified when an AtomicOperation was added.
|
AtomicOperation[] |
getAtomicOperations()
Gets the atomic operations.
|
protected Long |
getClassId()
getClassId - get the initiating object's class Id
|
protected Long |
getId()
getId - get the initiating object's Id
|
protected Object |
getInitialCustomObject()
getInitialCustomObject - get the initial custom object
specified in the first Operation for the initiating object.
|
S_LibraryObjectDefinition |
getInitialDefinition()
getInitialDefinition - get the initial S_LibraryObjectDefinition
specified in the first Operation for the initiating object.
|
protected S_LibraryObject |
getInitialLibraryObject()
getInitialLibraryObject - get the initiating object.
|
boolean |
isOperationInProgress(S_LibraryObject obj,
int operationType)
Gets whether an atomic operation is in progress
|
protected boolean |
wasInitiatedBy(S_LibraryObject obj)
wasInitiatedBy - return true if the specified object
initiated this Operation.
|
public static final int OPERATIONTYPE_INSERT
public static final int OPERATIONTYPE_FREE
public static final int OPERATIONTYPE_UPDATE
public static final int OPERATIONTYPE_COPY
public static final int OPERATIONTYPE_DELETE
public static final int OPERATIONTYPE_UNDELETE
protected S_LibraryObject m_Object
protected S_LibrarySession m_Session
protected Vector m_AtomicOperations
protected HashMap m_CycleCheckMap
public OperationState(S_LibrarySession session, S_LibraryObject obj) throws IfsException
session
- the sessionobj
- the initial target objectIfsException
- if the operation failsprotected S_LibraryObject getInitialLibraryObject() throws IfsException
IfsException
- if the operation failspublic S_LibraryObjectDefinition getInitialDefinition() throws IfsException
IfsException
- if the operation failsprotected Object getInitialCustomObject() throws IfsException
IfsException
- if the operation failsprotected Long getId() throws IfsException
IfsException
- if the operation failsprotected Long getClassId() throws IfsException
IfsException
- if the operation failsprotected boolean wasInitiatedBy(S_LibraryObject obj) throws IfsException
obj
- the Object to check for initiationIfsException
- if the operation failspublic void addAtomicOperation(S_LibraryObject obj, int operationType, S_LibraryObjectDefinition sdef) throws IfsException
obj
- the target object for this atomic operationoperationType
- the operation typesdef
- any options or info related to the atomic operationIfsException
- if the operation failspublic void addAtomicOperation(S_LibraryObject obj, int operationType, S_LibraryObjectDefinition sdef, Object customObject) throws IfsException
obj
- the target object for this atomic operationoperationType
- the operation typesdef
- any options or info related to the atomic operationcustomObject
- the custom object that is related to the operationIfsException
- if the operation failspublic S_LibraryObjectDefinition getAtomicOperationDefinition(S_LibraryObject obj, int operationType) throws IfsException
obj
- the target object for this atomic operationoperationType
- the operation typeIfsException
- if the operation failspublic Object getAtomicOperationCustomObject(S_LibraryObject obj, int operationType) throws IfsException
obj
- the target object for this atomic operationoperationType
- the operation typeIfsException
- if the operation failspublic boolean isOperationInProgress(S_LibraryObject obj, int operationType) throws IfsException
obj
- the target object for the atomic operation in questionoperationType
- the operation typeIfsException
- if the operation failspublic AtomicOperation[] getAtomicOperations() throws IfsException
IfsException
- if the operation failsprotected void executeAtomicOperations() throws IfsException
IfsException
- if the operation failsCopyright © 2023. All rights reserved.