public abstract class ActionAdapter extends ActionFactory implements Action
Constructor and Description |
---|
ActionAdapter()
Constructs a ActionAdapter for an instance used as an ActionFactory.
|
ActionAdapter(ActionFactory factory)
Constructs a ActionAdapter to be used to execute a new Action.
|
ActionAdapter(ActionFactory factory,
AuditEvent event)
Constructs a FollowAction reflecting a previously executed Action.
|
Modifier and Type | Method and Description |
---|---|
static int |
calculateOperationType(Integer targetCode,
Integer opCode)
Calculate a numeric Operation type from a target code and
operation code.
|
protected void |
dispatchEvent(AuditEventTypeDefinition eventType,
ActivityRecord ar,
Actor actor)
Dispatch an activity event.
|
protected void |
dispatchEvent(AuditEventTypeDefinition eventType,
ActivityRecord ar,
Actor actor,
LibraryObject auxObj2)
Dispatch an activity event.
|
protected void |
dispatchEvent(AuditEventTypeDefinition eventType,
ActivityRecord ar,
Actor actor,
LibraryObject auxObj2,
LibraryObject auxObj3)
Dispatch an activity event.
|
protected void |
dispatchEvent(AuditEventTypeDefinition eventType,
ActivityRecord ar,
Actor actor,
LibraryObject auxObj2,
LibraryObject auxObj3,
String auxString,
AttributeValue[] properties)
Dispatch an activity event.
|
protected abstract void |
execute()
Perform the Action execution.
|
void |
execute(ActivityRecord ar)
Execute the action described by this instance,
on the target ActivityRecord.
|
void |
execute(PublicObject po)
Execute the action described by this instance,
on the target PublicObject, using this PublicObject's
existing ActivityRecord context.
|
ActionSpecification |
getActionSpecification()
Gets the ActionSpecification value associated with this instance.
|
Long |
getActionSpecificationId()
Gets the ActionSpecification ID associated with this instance.
|
ActivityRecord |
getActivityRecord()
Gets the target ActivityRecord upon which this Action was executed.
|
Actor |
getActor()
Gets the Actor who executed this Action.
|
long |
getAuditEventId()
Gets the ID of the AuditEvent that reflects the execution of this Action.
|
int |
getAuditOperationType()
Gets the numeric repesentation of the operation type of the AuditEvent
that reflects the execution of this Action.
|
String |
getAuditOperationTypeKey()
Gets the String key repesentation of the operation type of the AuditEvent
that reflects the execution of this Action.
|
LibraryObject[] |
getAuxiliaryObjects()
Gets the auxiliary objects associated with this Action,
not counting the Actor.
|
String |
getAuxiliaryString()
Gets the auxiliary String associated with this Action.
|
Long |
getExecutingUserId()
Gets the ID of the effective DirectoryUser (not the Actor) when this Action
was executed.
|
Date |
getExecutionDate()
Gets the Date this Action was executed.
|
LibraryObject |
getFirstAuxiliaryObject()
Gets the first auxiliary object associated with this Action,
not counting the Actor.
|
static Action |
getInstance(LibrarySession session,
AuditEvent event)
Constructs a previously executed Action, using the AuditEvent as
the data source.
|
static Action |
getInstance(LibrarySession session,
String specName)
Constructs a pending Action, properly constructed by the factory
instance for the ActionSpecification (indicated by the specified name)
associated with this type of Action.
|
PerformedActivityRecord |
getPerformedActivityRecord()
Gets the PerformedActivityRecord for the Actor who is executing
this Action.
|
AttributeValue[] |
getProperties()
Gets the properties associated with this Action.
|
AttributeValueTable |
getPropertyTable()
Gets the AttributeValueTable representing the set of Properties defined
for the ActionSpecification associated with this instance.
|
LibraryObject |
getSecondAuxiliaryObject()
Gets the second auxiliary object associated with this Action,
not counting the Actor.
|
LibrarySession |
getSession()
Gets the session context associated with this instance.
|
TrackedActivityRecord |
getTrackedActivityRecord()
Gets the TrackedActivityRecord for the Actor who is executing
this Action.
|
boolean |
isActivityRecordFreed()
Returns indication as to whether or not the
target ActivityRecord has been freed.
|
boolean |
isActivityRecordUndiscoverable()
Returns indication as to whether or not the target
ActivityRecord is undiscoverable by the session selecting
the previously executed Action.
|
boolean |
isActorFreed()
Returns indication as to whether or not the performing Actor
has been freed.
|
boolean |
isActorUndiscoverable()
Returns indication as to whether or not the performing Actor is
undiscoverable by the session selecting the previously executed Action.
|
boolean |
isFactory()
Returns true is instance has been initialized as a factory instance.
|
boolean |
isPendingExecution()
Returns indication as to whether or not this instance reflects an
Action that can be used to execute an Action.
|
boolean |
isPreviouslyExecuted()
Returns indication as to whether or not this instance reflects a
previously executed Action.
|
protected void |
postExecute()
Handle anything after executing the Action.
|
protected void |
preExecute()
Handle anything prior to executing the Action.
|
protected void |
setExecutingActionType(AuditEventTypeDefinition eventDef)
Sets the type of Action being executed.
|
constructActivityEventTypeDefinition, constructExecutedAction, constructPendingAction, getAuditEventTypeDefinitions, initialize, isInitialized
public ActionAdapter()
Called from ActionSpecification when initializing the ActionFactory to use for that specific ActionSpecification.
public ActionAdapter(ActionFactory factory) throws IfsException
factory
- the ActionFactory used to construct this instanceIfsException
- if operation failspublic ActionAdapter(ActionFactory factory, AuditEvent event) throws IfsException
factory
- the ActionFactory used to construct this instanceevent
- The event that was posted as part of the
previously executed Action.IfsException
- if operation failspublic boolean isPreviouslyExecuted()
public boolean isPendingExecution()
public boolean isFactory()
public LibrarySession getSession()
getSession
in class ActionFactory
public ActionSpecification getActionSpecification()
getActionSpecification
in class ActionFactory
public Long getActionSpecificationId()
getActionSpecificationId
in class ActionFactory
public AttributeValueTable getPropertyTable()
getPropertyTable
in class ActionFactory
public PerformedActivityRecord getPerformedActivityRecord()
Only available after preExecute
is processed
in this class.
public TrackedActivityRecord getTrackedActivityRecord()
Only available after preExecute
is processed
in this class.
public ActivityRecord getActivityRecord()
Will be null if the target ActivityRecord was freed or is undiscoverable by the session selecting the previously executed Action.
public boolean isActivityRecordFreed()
public boolean isActivityRecordUndiscoverable()
public Actor getActor()
Will be null if the Actor was freed or is undiscoverable by the session selecting the previously executed Action.
public boolean isActorFreed()
public boolean isActorUndiscoverable()
public long getAuditEventId()
public int getAuditOperationType()
public String getAuditOperationTypeKey()
public Date getExecutionDate()
public Long getExecutingUserId()
public LibraryObject[] getAuxiliaryObjects()
public LibraryObject getFirstAuxiliaryObject()
public LibraryObject getSecondAuxiliaryObject()
public String getAuxiliaryString()
public AttributeValue[] getProperties()
public static Action getInstance(LibrarySession session, String specName) throws IfsException
session
- session contextspecName
- the name of the ActionSpecification.IfsException
- if operation failspublic static Action getInstance(LibrarySession session, AuditEvent event) throws IfsException
session
- session contextevent
- the event reflecting the previously executed actionIfsException
- if operation fails.protected void setExecutingActionType(AuditEventTypeDefinition eventDef)
Called by the subclasses when it is established as to the type of Action event being posted.
eventDef
- The event definition that defines the action event
that will be posted when the Action is executed.protected void dispatchEvent(AuditEventTypeDefinition eventType, ActivityRecord ar, Actor actor) throws IfsException
eventType
- the event type to dispatchar
- the target ActivityRecordactor
- actor performing the action, stored as 1st aux objectIfsException
- if operation failsprotected void dispatchEvent(AuditEventTypeDefinition eventType, ActivityRecord ar, Actor actor, LibraryObject auxObj2) throws IfsException
eventType
- the event type to dispatchar
- the target ActivityRecordactor
- actor performing the action, stored as 1st aux objectauxObj2
- 2nd aux object (optional)IfsException
- if operation failsprotected void dispatchEvent(AuditEventTypeDefinition eventType, ActivityRecord ar, Actor actor, LibraryObject auxObj2, LibraryObject auxObj3) throws IfsException
eventType
- the event type to dispatchar
- the target ActivityRecordactor
- actor performing the action, stored as 1st aux objectauxObj2
- 2nd aux object (optional)auxObj3
- 3rd aux object (optional)IfsException
- if operation failsprotected void dispatchEvent(AuditEventTypeDefinition eventType, ActivityRecord ar, Actor actor, LibraryObject auxObj2, LibraryObject auxObj3, String auxString, AttributeValue[] properties) throws IfsException
eventType
- the event type to dispatchar
- the target ActivityRecordactor
- actor performing the action, stored as 1st aux objectauxObj2
- 2nd aux object (optional)auxObj3
- 3rd aux object (optional)auxString
- the aux String (optional)properties
- set of event properties (optional)IfsException
- if operation failspublic void execute(PublicObject po) throws IfsException
execute
in interface Action
po
- The target PublicObject (use its ActivityRecord)IfsException
- if the operation fails.public void execute(ActivityRecord ar) throws IfsException
execute
in interface Action
ar
- The target ActivityRecordIfsException
- if the operation fails.protected void preExecute() throws IfsException
This is called prior to invoking execute
.
IfsException
- if the operation fails.protected abstract void execute() throws IfsException
This is called after first invoking preExecute
and before
invoking postExecute
.
IfsException
- if the operation fails.protected void postExecute() throws IfsException
This is called after invoking execute
.
IfsException
- if the operation fails.Copyright © 2023. All rights reserved.