public abstract class ActivityProcessor extends Object
Modifier and Type | Field and Description |
---|---|
static int |
SUMMARY_COUNT_POSITION_UPDATED
The count position for number of "Update" actions.
|
static int |
SUMMARY_INDICATION_POSITION_CREATED
The indication position for "Created".
|
static int |
SUMMARY_INDICATION_POSITION_DELETED
The indication position for "Deleted".
|
Constructor and Description |
---|
ActivityProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
applyActionToActivitySummaryDelta(ActivitySummary deltaSumm,
ActivitySummary parSumm,
Action action)
Apply an Action to an ActivitySummary delta.
|
protected void |
calculateCompositeActivityLevel(TrackedActivityRecord tar,
ActionAdapter action,
TrackedActivityRecordLevels levels)
Deprecated.
9.2.3: include calculation in other pre-Update overrides
|
protected void |
calculateDeltaActivityLevel(TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary deltaSumm,
TrackedActivityRecordLevels levels)
Deprecated.
9.2.3: use
preUpdateDeltaTrackedActivityRecord |
protected void |
calculateInclusionActivityLevel(TrackedActivityRecord tar,
ActionAdapter action,
TrackedActivityRecordLevels levels)
Deprecated.
9.2.3: use
preUpdateInclusionTrackedActivityRecord |
protected void |
calculateOverallActivityLevel(ActivityRecord ar,
ActivitySummary asumm,
ActionAdapter action,
TrackedActivityRecordLevels levels)
Calculate and apply the overall Activity Level to be used as one
of the components of TrackedActivityRecords, and to be stored as part
of the ActivityRecord, using Attribute ACTIVITYLEVEL.
|
protected void |
calculatePerformedActivityLevel(PerformedActivityRecord par,
TrackedActivityRecord tar,
ActionAdapter action,
TrackedActivityRecordLevels levels)
Deprecated.
9.2.3: use
preUpdatePerformingTrackedActivityRecord |
void |
deleteTrackedActivityRecord(TrackedActivityRecord tar)
Delete the specified TrackedActivityRecord.
|
ActivitySpecification |
getActivitySpecification()
Gets the ActivitySpecification value associated with this instance.
|
protected void |
getActivitySummaryCountPositions(List<Integer> countList)
Gets the Count Positions in effect for this class,
by adding them to the specified List.
|
protected void |
getActivitySummaryIndicationPositions(List<Integer> indList)
Gets the Indication Positions in effect for this class,
by adding them to the specified List.
|
protected void |
getActivitySummaryNumberPositions(List<Integer> numList)
Gets the Number Positions in effect for this class,
by adding them to the specified List.
|
protected void |
getIncludedActors(Action action,
LinkedHashMap map)
For a previously-executed committed Action, get the set of Actors that
have become included in the specified activity as a result of this Action,
and add to the specified map.
|
protected void |
getIncludedActors(PerformedActivityRecord par,
Action action,
LinkedHashMap map)
During the execution of the specified Action, get the set of Actors that
have become included in the specified activity as a result of this Action,
and add to the specified map.
|
static ActivityProcessor |
getInstance(LibrarySession session,
String specName)
Gets the ActivityProcessor for the specified ActivitySpecification
(identified by name and session) associated with this type of
ActivityProcessor.
|
AttributeValueTable |
getPropertyTable()
Gets the AttributeValueTable representing the set of Properties defined
for the ActivitySpecification associated with this instance.
|
LibrarySession |
getSession()
Gets the session context associated with this instance.
|
int |
getUpdateCount(ActivitySummary asumm)
Returns the number of times an UpdateAction has been posted.
|
void |
initialize(ActivitySpecification spec)
Initialize this instance.
|
protected boolean |
isCommittedActionProcessingRequired(ActivityRecord ar,
ActionAdapter action)
Returns indication as to whether the specified Action (which is in the
process of being executed) requires additional processing after the
Action is committed.
|
boolean |
isCreated(ActivitySummary asumm)
Returns indication as to whether a CreateAction has been posted.
|
boolean |
isDeleted(ActivitySummary asumm)
Returns indication as to whether a DeleteAction has been posted.
|
TrackedActivityRecord |
markLastViewedActivitySummaryAsPartiallyRead(TrackedActivityRecord tar,
ActionAdapter lastAction)
Refresh the LastViewed delta ActivitySummary for the specified
TrackedActivityRecord, marking it as partially viewed up to (and including)
the specified Action.
|
TrackedActivityRecord |
markLastViewedActivitySummaryAsRead(TrackedActivityRecord tar)
Refresh the LastViewed delta ActivitySummary for the specified
TrackedActivityRecord, marking it as completely viewed (matching the
current state of the ActivityRecord).
|
protected void |
postPrivateRecords(TrackedActivityRecord tar,
ActionAdapter action)
Deprecated.
9.2.3: include actions in other pre-Update overrides
|
protected void |
preUpdateDeltaTrackedActivityRecord(TrackedActivityRecord tar,
ActionAdapter lastAction,
ActivitySummary deltaSumm,
TrackedActivityRecordLevels levels)
Perform any pre-update operations before a TAR update,
that is triggered by an operation that marks activity
as fully or partially read by the tracking Actor.
|
protected void |
preUpdateInclusionTrackedActivityRecord(TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary lastDeltaSumm,
boolean prevExecuted,
TrackedActivityRecordLevels levels,
Object inclActorPayload)
Perform any pre-update operations before a TAR update,
that is triggered by a newly executed action or a previously
executed one.
|
protected void |
preUpdatePerformedActivityRecord(PerformedActivityRecord par,
ActionAdapter action,
ActivitySummary parSumm)
Perform any pre-update operations before a PAR update,
that is triggered by a newly executed action.
|
protected void |
preUpdatePerformingTrackedActivityRecord(PerformedActivityRecord par,
TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary lastDeltaSumm,
TrackedActivityRecordLevels levels)
Perform any pre-update operations before a TAR update,
that is triggered by a newly executed action.
|
protected void |
processCommittedAction(ActivityRecord ar,
ActionAdapter action)
Perform additional processing of a committed previously-executed Action.
|
TrackedActivityRecord |
refreshDeltaActivitySummary(TrackedActivityRecord tar)
Refresh the LastViewed delta ActivitySummary for the specified
TrackedActivityRecord.
|
void |
synchronizeOverallActivityLevel(ActivityRecord ar,
TrackedActivityRecord tar,
TrackedActivityRecordLevels levels)
Synchronize the overall activity setting in the ActivityRecord on the
specified TrackedActivityRecord if the values are different.
|
void |
updateActivityRecord(ActivityRecord ar,
ActivitySummary arSumm,
ActionAdapter action,
TrackedActivityRecordLevels levels)
Update the ActivityRecord to reflect updates that
were made to its ActivitySummary.
|
void |
updateInclusionTrackedActivityRecord(TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary arSumm,
boolean prevExecuted,
TrackedActivityRecordLevels levels,
Object inclActorPayload)
Update the TrackedActivityRecord specified, which
represents an Actor that is included in the specified Action or activity.
|
void |
updateInclusionTrackedActivityRecord(TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary arSumm,
TrackedActivityRecordLevels levels,
Object inclActorPayload)
Update the TrackedActivityRecord specified, which
represents an Actor that is included in the specified Action or activity.
|
void |
updatePerformedActivityRecord(PerformedActivityRecord par,
ActivitySummary asumm,
ActionAdapter action)
Update the PerformedActivityRecord to reflect updates that
were made to its ActivitySummary as a result of executing an Action.
|
void |
updatePerformingTrackedActivityRecord(PerformedActivityRecord par,
TrackedActivityRecord tar,
ActionAdapter action,
ActivitySummary arSumm,
TrackedActivityRecordLevels levels)
Update the TrackedActivityRecord specified, which
represents an Actor that is performing the action.
|
TrackedActivityRecord |
updateSpecifiedCompositeLevel(TrackedActivityRecord tar,
int compLevel,
boolean clearLevel)
Update the specified composite level for a TrackedActivityRecord.
|
void |
updateTrackedActivityRecordLevels(TrackedActivityRecord tar,
TrackedActivityRecordLevels levels)
Update the TrackedActivityRecordLevels.
|
void |
validate()
Validate this instance.
|
void |
verifyAllowableAction(ActionSpecification anSpec)
Verify that the specified ActionSpecification is allowed for this
Activity type.
|
public static final int SUMMARY_INDICATION_POSITION_CREATED
public static final int SUMMARY_INDICATION_POSITION_DELETED
public static final int SUMMARY_COUNT_POSITION_UPDATED
public void initialize(ActivitySpecification spec) throws IfsException
Called immediately after construction (via the default constructor) via reflection within ActivitySpecification.
spec
- The ActivitySpecification for a given implementation.IfsException
- if the operation fails.public LibrarySession getSession()
public ActivitySpecification getActivitySpecification()
public AttributeValueTable getPropertyTable()
public static ActivityProcessor getInstance(LibrarySession session, String specName) throws IfsException
session
- session contextspecName
- the name of the ActivitySpecification.IfsException
- if operation failspublic void verifyAllowableAction(ActionSpecification anSpec) throws IfsException
anSpec
- The ActionSpecification to checkIfsException
- if the ActionSpecification is not allowedpublic boolean isCreated(ActivitySummary asumm)
When accessed with an ActivitySummary for a single Actor, the returned value indicates whether that Actor executed the CreateAction.
asumm
- the ActivitySummarypublic boolean isDeleted(ActivitySummary asumm)
When accessed with an ActivitySummary for a single Actor, the returned value indicates whether that Actor executed the DeleteAction.
asumm
- the ActivitySummarypublic int getUpdateCount(ActivitySummary asumm)
asumm
- the ActivitySummarypublic void applyActionToActivitySummaryDelta(ActivitySummary deltaSumm, ActivitySummary parSumm, Action action) throws IfsException
deltaSumm
- the target ActivitySummary DeltaparSumm
- the target ActivitySummaryaction
- Action to add to the summaryIfsException
- if the operation fails.public void updatePerformedActivityRecord(PerformedActivityRecord par, ActivitySummary asumm, ActionAdapter action) throws IfsException
Also update the specified PerformedActivityRecord so that it reflects the LastAction and LastActionDate.
par
- the target PerformedActivityRecord to updateasumm
- the new ActivitySummaryaction
- the Action being executedIfsException
- if the operation fails.public void updateActivityRecord(ActivityRecord ar, ActivitySummary arSumm, ActionAdapter action, TrackedActivityRecordLevels levels) throws IfsException
ar
- the target ActivityRecord to updatearSumm
- the new ActivitySummaryaction
- the Action being executedlevels
- the TrackedActivityRecord Levels,
which holds the overall activity setting (if set)IfsException
- if the operation fails.public void updatePerformingTrackedActivityRecord(PerformedActivityRecord par, TrackedActivityRecord tar, ActionAdapter action, ActivitySummary arSumm, TrackedActivityRecordLevels levels) throws IfsException
par
- the PerformedActivityRecord for the Actor who
is executing the Actiontar
- the TrackedActivityRecord being updatedaction
- the Action being executedarSumm
- the new ActivitySummary reflecting the ActivityRecordlevels
- the TrackedActivityRecord LevelsIfsException
- if the operation fails.public void updateInclusionTrackedActivityRecord(TrackedActivityRecord tar, ActionAdapter action, ActivitySummary arSumm, TrackedActivityRecordLevels levels, Object inclActorPayload) throws IfsException
Implies that the specified Action was previously executed; use the other variant to imply that the Action is in the process of being executed.
tar
- the TrackedActivityRecord being updatedaction
- the Action being executedarSumm
- the new ActivitySummary reflecting the ActivityRecordlevels
- the TrackedActivityRecord LevelsinclActorPayload
- the Payload specified inthe included Actor map
for the included Actor being processed nowIfsException
- if the operation fails.public void updateInclusionTrackedActivityRecord(TrackedActivityRecord tar, ActionAdapter action, ActivitySummary arSumm, boolean prevExecuted, TrackedActivityRecordLevels levels, Object inclActorPayload) throws IfsException
tar
- the TrackedActivityRecord being updatedaction
- the Action being executedarSumm
- the new ActivitySummary reflecting the ActivityRecordprevExecuted
- whether the action was previously executed,
and being processed from the RetainedEventlevels
- the TrackedActivityRecord LevelsinclActorPayload
- the Payload specified inthe included Actor map
for the included Actor being processed nowIfsException
- if the operation fails.public TrackedActivityRecord refreshDeltaActivitySummary(TrackedActivityRecord tar) throws IfsException
tar
- the TrackedActivityRecord whose delta ActivitySummary
will be refreshedIfsException
- if the operation fails.public TrackedActivityRecord markLastViewedActivitySummaryAsRead(TrackedActivityRecord tar) throws IfsException
tar
- the TrackedActivityRecord whose delta ActivitySummary
will be refreshedIfsException
- if the operation fails.public TrackedActivityRecord markLastViewedActivitySummaryAsPartiallyRead(TrackedActivityRecord tar, ActionAdapter lastAction) throws IfsException
tar
- the TrackedActivityRecord whose delta ActivitySummary
will be refreshedlastAction
- the last action viewed; if null, mark as fully readIfsException
- if the operation fails.public TrackedActivityRecord updateSpecifiedCompositeLevel(TrackedActivityRecord tar, int compLevel, boolean clearLevel) throws IfsException
tar
- the TrackedActivityRecord to be updatedcompLevel
- the specified composite levelclearLevel
- whether the composite value should be marked
as not setIfsException
- if the operation fails.public void updateTrackedActivityRecordLevels(TrackedActivityRecord tar, TrackedActivityRecordLevels levels) throws IfsException
The TrackedActivityRecord specified must have been selected
with locking for update specified for this method to work
properly - using selectTrackedActivityRecord(true)
or equivalent.
tar
- the TrackedActivityRecord being updatedlevels
- the TrackedActivityRecord LevelsIfsException
- if the operation fails.public void deleteTrackedActivityRecord(TrackedActivityRecord tar) throws IfsException
tar
- the TrackedActivityRecord to be deletedIfsException
- if the operation fails.protected void processCommittedAction(ActivityRecord ar, ActionAdapter action) throws IfsException
ar
- the target ActivityRecordaction
- the previously-executed ActionIfsException
- if the operation failsprotected void getIncludedActors(PerformedActivityRecord par, Action action, LinkedHashMap map) throws IfsException
par
- the PerformedActivityRecord being updatedaction
- the Action being executedmap
- the included Actor map, to be added toIfsException
- if the operation fails.protected void getIncludedActors(Action action, LinkedHashMap map) throws IfsException
action
- the committed Action that was previously-executedmap
- the included Actor map, to be added toIfsException
- if the operation fails.protected void calculateOverallActivityLevel(ActivityRecord ar, ActivitySummary asumm, ActionAdapter action, TrackedActivityRecordLevels levels) throws IfsException
ar
- the target ActivityRecord to updateasumm
- the new ActivitySummary
(which includes the newly executed Action)action
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)levels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void calculatePerformedActivityLevel(PerformedActivityRecord par, TrackedActivityRecord tar, ActionAdapter action, TrackedActivityRecordLevels levels) throws IfsException
preUpdatePerformingTrackedActivityRecord
par
- the PerformedActivityRecord being updatedtar
- the TrackedActivityRecord for the performing Actoraction
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)levels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void calculateDeltaActivityLevel(TrackedActivityRecord tar, ActionAdapter action, ActivitySummary deltaSumm, TrackedActivityRecordLevels levels) throws IfsException
preUpdateDeltaTrackedActivityRecord
tar
- the TrackedActivityRecord being updatedaction
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)deltaSumm
- the new delta Summarylevels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void calculateInclusionActivityLevel(TrackedActivityRecord tar, ActionAdapter action, TrackedActivityRecordLevels levels) throws IfsException
preUpdateInclusionTrackedActivityRecord
tar
- the TrackedActivityRecord for the included Actoraction
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)levels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void calculateCompositeActivityLevel(TrackedActivityRecord tar, ActionAdapter action, TrackedActivityRecordLevels levels) throws IfsException
tar
- the TrackedActivityRecord being updatedaction
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)levels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void postPrivateRecords(TrackedActivityRecord tar, ActionAdapter action) throws IfsException
tar
- the TrackedActivityRecord being updatedaction
- the Action (executiung or committed)IfsException
- if the operation fails.protected void preUpdatePerformedActivityRecord(PerformedActivityRecord par, ActionAdapter action, ActivitySummary parSumm) throws IfsException
Typically this is overridden to add PrivatePerformedActivityRecords.
par
- the PerformedActivityRecord being updatedaction
- the Action being executedparSumm
- the new PAR SummaryIfsException
- if the operation failsprotected void preUpdatePerformingTrackedActivityRecord(PerformedActivityRecord par, TrackedActivityRecord tar, ActionAdapter action, ActivitySummary lastDeltaSumm, TrackedActivityRecordLevels levels) throws IfsException
Typically this is overridden to calculate a new Performed Activity Level that is set into the specified TrackedActivityRecordLevels. This entry point is called during the postExecution phase of executing the Action, and prior to it being committed.
par
- the PerformedActivityRecord being updatedtar
- the TrackedActivityRecord for the performing Actoraction
- the Action being executeddeltaSumm
- the new delta Summarylevels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected void preUpdateInclusionTrackedActivityRecord(TrackedActivityRecord tar, ActionAdapter action, ActivitySummary lastDeltaSumm, boolean prevExecuted, TrackedActivityRecordLevels levels, Object inclActorPayload) throws IfsException
Typically this is overridden to calculate a new Inclusion Activity Level that is set into the specified TrackedActivityRecordLevels. This entry point is called in two spots:
processCommittedAction
phase, where
an Action had been previously committed, and ExecutedActionRetainedEvent
processing has determined additional Actors that are included.
tar
- the TrackedActivityRecord for the included Actoraction
- the Action being executed, or null if no Action
is being executed (perform the calculation based upon
current activity only)deltaSumm
- the new delta SummaryprevExecuted
- whether the action was previously executed,
and being processed from the RetainedEventlevels
- the TrackedActivityRecordLevels to apply the settinginclActorPayload
- the Payload specified inthe included Actor map
for the included Actor being processed nowIfsException
- if the operation failsprotected void preUpdateDeltaTrackedActivityRecord(TrackedActivityRecord tar, ActionAdapter lastAction, ActivitySummary deltaSumm, TrackedActivityRecordLevels levels) throws IfsException
Typically this is overridden to calculate a new Delta Activity Level
that is set into the specified TrackedActivityRecordLevels.
This entry point is called when a tracking Actor indicates he
has fully or partially read the activity represented in the TAR.
If fully read, the specified lastAction
will be null;
otherwise it is a partial read up to and including the specified
lastAction
.
tar
- the TrackedActivityRecord being updatedlastAction
- the last action viewed;
set if being marked partially read, null otherwisedeltaSumm
- the new delta Summarylevels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failspublic final void synchronizeOverallActivityLevel(ActivityRecord ar, TrackedActivityRecord tar, TrackedActivityRecordLevels levels) throws IfsException
ar
- the target ActivityRecord that may have changedtar
- the TrackedActivityRecord being updatedlevels
- the TrackedActivityRecordLevels to apply the settingIfsException
- if the operation failsprotected boolean isCommittedActionProcessingRequired(ActivityRecord ar, ActionAdapter action) throws IfsException
If this method returns true, a RetainedEvent will be created which will later be processed by the ExecutedActionRetainedEventAgent. This agent will process the committed Action, using a set of extensibility points within the ActivityProcessor designated for committed action processing.
ar
- the target ActivityRecordaction
- the Action being executedIfsException
- if the operation failspublic final void validate() throws IfsException
IfsException
- if the Processor is not defined legallyprotected void getActivitySummaryCountPositions(List<Integer> countList)
countList
- the list that holds the set of Count Positionsprotected void getActivitySummaryIndicationPositions(List<Integer> indList)
indList
- the list that holds the set of Indication PositionsCopyright © 2023. All rights reserved.