com.evolveum.midpoint.model.importer
Class ImportAccountsFromResourceTaskHandler

java.lang.Object
  extended by com.evolveum.midpoint.model.importer.ImportAccountsFromResourceTaskHandler
All Implemented Interfaces:
TaskHandler

@Component
public class ImportAccountsFromResourceTaskHandler
extends Object
implements TaskHandler

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 efficiently 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
static String HANDLER_URI
           
 
Constructor Summary
ImportAccountsFromResourceTaskHandler()
           
 
Method Summary
 String getCategoryName(Task task)
          Returns a category name for a given task.
 List<String> getCategoryNames()
          Returns names of task categories provided by this handler.
 Long heartbeat(Task task)
           
 void launch(ResourceType resource, QName objectclass, Task task, OperationResult parentResult)
          Launch an import.
 void refreshStatus(Task task)
           
 TaskRunResult run(Task task)
          The body of the task.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HANDLER_URI

public static final String HANDLER_URI
See Also:
Constant Field Values
Constructor Detail

ImportAccountsFromResourceTaskHandler

public ImportAccountsFromResourceTaskHandler()
Method Detail

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.

Parameters:
resource -
task -
parentResult -

run

public TaskRunResult run(Task task)
The body of the task. This will start the import "loop".

Specified by:
run in interface TaskHandler

heartbeat

public Long heartbeat(Task task)
Specified by:
heartbeat in interface TaskHandler

refreshStatus

public void refreshStatus(Task task)
Specified by:
refreshStatus in interface TaskHandler

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.

Specified by:
getCategoryName in interface TaskHandler
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"

getCategoryNames

public List<String> getCategoryNames()
Description copied from interface: TaskHandler
Returns names of task categories provided by this handler. Usually it will be one-item list.

Specified by:
getCategoryNames in interface TaskHandler
Returns:
a list of category names; may be null - in that case the category info is given by getCategoryName(null)


Copyright © 2013 evolveum. All Rights Reserved.