Class ImportFromResourceTaskHandler
- java.lang.Object
-
- com.evolveum.midpoint.repo.common.task.AbstractTaskHandler<TH,TE>
-
- com.evolveum.midpoint.model.impl.tasks.AbstractModelTaskHandler<ImportFromResourceTaskHandler,ImportFromResourceTaskExecution>
-
- com.evolveum.midpoint.model.impl.sync.tasks.imp.ImportFromResourceTaskHandler
-
- All Implemented Interfaces:
TaskHandler
,WorkBucketAwareTaskHandler
@Component public class ImportFromResourceTaskHandler extends AbstractModelTaskHandler<ImportFromResourceTaskHandler,ImportFromResourceTaskExecution>
Task handler for "Import from resource" task. The import task will search for all the accounts on a specific resource. It will pretend that all the accounts were just created and notify other components (mode) using the ResourceObjectChangeListener interface. This will effectively result in importing all the accounts. Depending on the sync policy, appropriate user objects may be created, accounts may be linked to existing users, etc. The handler will execute the import in background. It is using Task Manager for that purpose, so the Task Manager instance needs to be injected. Most of the "import" action is actually done in the callbacks from provisioning searchObjectsIterative() operation. The import task may be executed on a different node (as usual for async tasks).- Author:
- Radovan Semancik
- See Also:
TaskHandler
,ResourceObjectChangeListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
HANDLER_URI
-
Fields inherited from class com.evolveum.midpoint.model.impl.tasks.AbstractModelTaskHandler
clock, clockwork, contextFactory, eventDispatcher, expressionFactory, model, modelObjectResolver, provisioningService, securityEnforcer, synchronizationService, syncTaskHelper, systemObjectCache, taskManager
-
Fields inherited from class com.evolveum.midpoint.repo.common.task.AbstractTaskHandler
globalReportingOptions, lightweightIdentifierGenerator, matchingRuleRegistry, operationExecutionRecorder, prismContext, repositoryService, schemaService, taskTypeName
-
-
Constructor Summary
Constructors Constructor Description ImportFromResourceTaskHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getArchetypeOid()
String
getCategoryName(Task task)
Returns a category name for a given task.String
getDefaultChannel()
ResourceObjectChangeListener
getObjectChangeListener()
boolean
importSingleShadow(String shadowOid, Task task, OperationResult parentResult)
Imports a single shadow.void
launch(ResourceType resource, QName objectclass, Task task, OperationResult parentResult)
Launch an import.-
Methods inherited from class com.evolveum.midpoint.model.impl.tasks.AbstractModelTaskHandler
getClock, getExpressionFactory, getProvisioningService, getSynchronizationService, getSyncTaskHelper, getSystemObjectsCache
-
Methods inherited from class com.evolveum.midpoint.repo.common.task.AbstractTaskHandler
createTaskExecution, getCacheConfigurationManager, getGlobalReportingOptions, getLogger, getMatchingRuleRegistry, getOperationExecutionRecorder, getPrismContext, getRepositoryService, getStatisticsCollectionStrategy, getTaskManager, getTaskTypeName, getTracer, heartbeat, refreshStatus, run
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.evolveum.midpoint.task.api.TaskHandler
getCategoryNames, run
-
Methods inherited from interface com.evolveum.midpoint.task.api.WorkBucketAwareTaskHandler
onNoMoreBuckets, run
-
-
-
-
Field Detail
-
HANDLER_URI
public static final String HANDLER_URI
- See Also:
- Constant Field Values
-
-
Method Detail
-
getCategoryName
public String getCategoryName(Task task)
Description copied from interface:TaskHandler
Returns a category name for a given task. In most cases, the name would be independent of concrete task.- Parameters:
task
- a task, whose category is to be determined; if getCategoryNames() returns null, this method has to accept null value as this parameter, and return the (one) category name that it gives to all tasks- Returns:
- a user-understandable name, like "LiveSync" or "Workflow"
-
importSingleShadow
public boolean importSingleShadow(String shadowOid, Task task, OperationResult parentResult) throws ObjectNotFoundException, CommunicationException, SchemaException, ConfigurationException, SecurityViolationException, ExpressionEvaluationException
Imports a single shadow. Synchronously. The task is NOT switched to background by default.
-
getArchetypeOid
public String getArchetypeOid()
- Returns:
- Archetype OID for tasks that are powered by this handler.
-
getDefaultChannel
public String getDefaultChannel()
- Returns:
- Channel URI for tasks managed by this handler, if applicable.
-
launch
public void launch(ResourceType resource, QName objectclass, Task task, OperationResult parentResult)
Launch an import. Calling this method will start import in a new thread, possibly on a different node.
-
getObjectChangeListener
public ResourceObjectChangeListener getObjectChangeListener()
-
-