Class AsyncUpdateActivityRun
- java.lang.Object
-
- com.evolveum.midpoint.repo.common.activity.run.AbstractActivityRun<WD,AH,BS>
-
- com.evolveum.midpoint.repo.common.activity.run.LocalActivityRun<WD,AH,WS>
-
- com.evolveum.midpoint.repo.common.activity.run.IterativeActivityRun<I,WD,AH,WS>
-
- com.evolveum.midpoint.repo.common.activity.run.PlainIterativeActivityRun<AsyncUpdateEvent,AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
-
- com.evolveum.midpoint.model.impl.sync.tasks.async.AsyncUpdateActivityRun
-
- All Implemented Interfaces:
ImplicitSegmentationResolver
,IterativeActivityRunSpecifics
,PlainIterativeActivityRunSpecifics<AsyncUpdateEvent>
,ItemProcessor<AsyncUpdateEvent>
,ExecutionSupport
,DebugDumpable
public final class AsyncUpdateActivityRun extends PlainIterativeActivityRun<AsyncUpdateEvent,AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.evolveum.midpoint.task.api.ExecutionSupport
ExecutionSupport.CountersGroup
-
-
Field Summary
-
Fields inherited from class com.evolveum.midpoint.repo.common.activity.run.IterativeActivityRun
beans, bucket, coordinator, errorState, transientRunStatistics
-
Fields inherited from class com.evolveum.midpoint.repo.common.activity.run.AbstractActivityRun
activity, activityState, activityStateDefinition, endTimestamp, reportingCharacteristics, startTimestamp, taskRun
-
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeRun(OperationResult result)
Called before the run.protected boolean
canUpdateThreadLocalStatistics()
Returns true if it's safe to update TL statistics in coordinator.@NotNull ActivityReportingCharacteristics
createReportingCharacteristics()
This method should be called only after the concrete instance is fully initialized.protected String
getChannelOverride()
Channel URI that should be set into the task during this activity run.ErrorHandlingStrategyExecutor.FollowUpAction
getDefaultErrorAction()
protected @NotNull ObjectReferenceType
getDesiredTaskObjectRef()
Returns the value that should be put into task.objectRef.boolean
isExcludedFromStalenessChecking()
True if the task is excluded from staleness checking while running this activity.void
iterateOverItemsInBucket(OperationResult opResult)
Starts the item source (e.g.boolean
processItem(@NotNull ItemProcessingRequest<AsyncUpdateEvent> request, @NotNull RunningTask workerTask, OperationResult result)
Does the "pure" processing, free of any reporting, error handling, tracing, and similar issues.-
Methods inherited from class com.evolveum.midpoint.repo.common.activity.run.PlainIterativeActivityRun
isInRepository, prepareItemSourceForCurrentBucket
-
Methods inherited from class com.evolveum.midpoint.repo.common.activity.run.IterativeActivityRun
determineActivityStateForCounters, determineCurrentBucketSize, determineOverallSize, disableGlobalConnIdOperationsListener, enableGlobalConnIdOperationsListener, ensureNoParallelism, ensureNoWorkerThreads, getBucket, getConnIdOperationsReport, getContextDescription, getContextDescriptionSpaced, getErrorState, getItemsReport, getRootTask, getRootTaskOid, getShortName, getShortNameUncapitalized, getStartTimeMillis, getTransientRunStatistics, handleError, isMultithreaded, runLocally, setContextDescription, shouldReportConnIdOperations, shouldReportInternalOperations, shouldReportItems, updateStatistics
-
Methods inherited from class com.evolveum.midpoint.repo.common.activity.run.LocalActivityRun
getCurrentResultStatusBean, runInternal, shouldUpdateProgressInStateOverview, updateItemProgressInTreeOverviewIfTimePassed
-
Methods inherited from class com.evolveum.midpoint.repo.common.activity.run.AbstractActivityRun
areActionsExecutedStatisticsSupported, areRunRecordsSupported, areStatisticsSupported, areSynchronizationStatisticsSupported, autoComputeRunResult, canRun, debugDump, debugDumpExtra, determineActivityStateDefinition, getActivity, getActivityDefinition, getActivityHandler, getActivityLocalPath, getActivityPath, getActivityState, getActivityStateDefinition, getBeans, getDiagName, getEndTimestamp, getExecutionMode, getItemsProcessed, getLocalParentRun, getPersistenceType, getPrismContext, getReportingCharacteristics, getReportingDefinition, getRunningTask, getStartTimestamp, getStartTimestampRequired, getTaskRun, getTreeStateOverview, getWorkDefinition, getWorkStateTypeName, incrementCounters, incrementProgress, isBucketAnalysis, isDryRun, isFullExecution, isNoExecution, isNonScavengingWorker, isPreview, isProgressSupported, isWorker, recordIterativeOperationStart, run, setInstanceReady, shouldCreateWorkStateOnInitialization, standardRunResult, standardRunResult, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Methods inherited from interface com.evolveum.midpoint.task.api.ExecutionSupport
getActivityPath, getExecutionMode, incrementCounters, recordIterativeOperationStart
-
Methods inherited from interface com.evolveum.midpoint.repo.common.activity.run.IterativeActivityRunSpecifics
afterBucketProcessing, afterRun, beforeBucketProcessing, resolveImplicitSegmentation, useOtherActivityStateForCounters
-
Methods inherited from interface com.evolveum.midpoint.repo.common.activity.run.PlainIterativeActivityRunSpecifics
determineCurrentBucketSize, determineOverallSize
-
-
-
-
Method Detail
-
createReportingCharacteristics
@NotNull public @NotNull ActivityReportingCharacteristics createReportingCharacteristics()
Description copied from class:AbstractActivityRun
This method should be called only after the concrete instance is fully initialized.- Specified by:
createReportingCharacteristics
in interfaceIterativeActivityRunSpecifics
- Overrides:
createReportingCharacteristics
in classLocalActivityRun<AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
- Returns:
- Reporting characteristics of the activity run. They e.g. provide default values
for
ActivityReportingDefinition
.
-
beforeRun
public void beforeRun(OperationResult result) throws ActivityRunException, CommonException
Description copied from interface:IterativeActivityRunSpecifics
Called before the run. Note that e.g. for search-based activities the search specification is *not* known at this moment.- Throws:
ActivityRunException
CommonException
-
getDesiredTaskObjectRef
@NotNull protected @NotNull ObjectReferenceType getDesiredTaskObjectRef()
Description copied from class:LocalActivityRun
Returns the value that should be put into task.objectRef. Should be overridden by subclasses. It should be called _after_IterativeActivityRunSpecifics.beforeRun(OperationResult)
method, in order to give the execution a chance to prepare data for this method.
-
iterateOverItemsInBucket
public void iterateOverItemsInBucket(OperationResult opResult) throws CommunicationException, ObjectNotFoundException, SchemaException, ConfigurationException, ExpressionEvaluationException
Description copied from class:IterativeActivityRun
Starts the item source (e.g. `searchObjectsIterative` call or `synchronize` call) and begins processing items generated by it. Returns when the source finishes. For example: - for search-based tasks, this call returns immediately after the iterative search is over; - for live sync task, this returns after all changes were fetched and acknowledged, and the resulting token was written; - for async update task, this returns also after all changes were fetched and acknowledged and confirmed to the source.- Specified by:
iterateOverItemsInBucket
in interfacePlainIterativeActivityRunSpecifics<AsyncUpdateEvent>
- Specified by:
iterateOverItemsInBucket
in classIterativeActivityRun<AsyncUpdateEvent,AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
- Throws:
CommunicationException
ObjectNotFoundException
SchemaException
ConfigurationException
ExpressionEvaluationException
-
processItem
public boolean processItem(@NotNull @NotNull ItemProcessingRequest<AsyncUpdateEvent> request, @NotNull @NotNull RunningTask workerTask, OperationResult result) throws CommonException, ActivityRunException
Description copied from interface:ItemProcessor
Does the "pure" processing, free of any reporting, error handling, tracing, and similar issues.- Specified by:
processItem
in interfaceItemProcessor<AsyncUpdateEvent>
- Specified by:
processItem
in classIterativeActivityRun<AsyncUpdateEvent,AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
- Throws:
CommonException
ActivityRunException
-
getDefaultErrorAction
@NotNull public ErrorHandlingStrategyExecutor.FollowUpAction getDefaultErrorAction()
- Specified by:
getDefaultErrorAction
in interfacePlainIterativeActivityRunSpecifics<AsyncUpdateEvent>
- Specified by:
getDefaultErrorAction
in classIterativeActivityRun<AsyncUpdateEvent,AsyncUpdateWorkDefinition,AsyncUpdateActivityHandler,AbstractActivityWorkStateType>
- Returns:
- Default error action if no policy is specified or if no policy entry matches.
-
isExcludedFromStalenessChecking
public boolean isExcludedFromStalenessChecking()
Description copied from class:LocalActivityRun
True if the task is excluded from staleness checking while running this activity.
-
getChannelOverride
protected String getChannelOverride()
Description copied from class:IterativeActivityRun
Channel URI that should be set into the task during this activity run. (If not null.)
-
canUpdateThreadLocalStatistics
protected boolean canUpdateThreadLocalStatistics()
Description copied from class:IterativeActivityRun
Returns true if it's safe to update TL statistics in coordinator. Normally, it is so. A notable exception is asynchronous update using AMQP (an experimental feature for now). The reason is that the message handling occurs in a thread different from the task thread. See MID-7464.
-
-