Search in sources :

Example 1 with DataCollectionArrayAffinityJob

use of com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionArrayAffinityJob in project coprhd-controller by CoprHD.

the class ControllerServiceImpl method createDiscoverJobsForTasks.

private static ArrayList<DataCollectionJob> createDiscoverJobsForTasks(AsyncTask[] tasks, String jobType) {
    ArrayList<DataCollectionJob> jobs = new ArrayList<DataCollectionJob>();
    for (AsyncTask task : tasks) {
        if (task instanceof ArrayAffinityAsyncTask) {
            List<URI> hostIds = ((ArrayAffinityAsyncTask) task).getHostIds();
            List<URI> systemIds = ((ArrayAffinityAsyncTask) task).getSystemIds();
            ArrayAffinityDataCollectionTaskCompleter completer = new ArrayAffinityDataCollectionTaskCompleter(task._clazz, systemIds, task._opId, jobType);
            DataCollectionJob job = new DataCollectionArrayAffinityJob(hostIds, systemIds, completer, task._namespace);
            jobs.add(job);
        } else {
            DiscoverTaskCompleter completer = new DiscoverTaskCompleter(task, jobType);
            if (null == task._namespace) {
                task._namespace = Discovery_Namespaces.ALL.toString();
            }
            DataCollectionJob job = new DataCollectionDiscoverJob(completer, task._namespace);
            jobs.add(job);
        }
    }
    return jobs;
}
Also used : DataCollectionJob(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJob) DataCollectionDiscoverJob(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionDiscoverJob) ArrayAffinityAsyncTask(com.emc.storageos.volumecontroller.ArrayAffinityAsyncTask) DataCollectionArrayAffinityJob(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionArrayAffinityJob) DiscoverTaskCompleter(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DiscoverTaskCompleter) ArrayList(java.util.ArrayList) AsyncTask(com.emc.storageos.volumecontroller.AsyncTask) ArrayAffinityAsyncTask(com.emc.storageos.volumecontroller.ArrayAffinityAsyncTask) ArrayAffinityDataCollectionTaskCompleter(com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.ArrayAffinityDataCollectionTaskCompleter) URI(java.net.URI)

Aggregations

ArrayAffinityAsyncTask (com.emc.storageos.volumecontroller.ArrayAffinityAsyncTask)1 AsyncTask (com.emc.storageos.volumecontroller.AsyncTask)1 ArrayAffinityDataCollectionTaskCompleter (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.ArrayAffinityDataCollectionTaskCompleter)1 DataCollectionArrayAffinityJob (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionArrayAffinityJob)1 DataCollectionDiscoverJob (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionDiscoverJob)1 DataCollectionJob (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DataCollectionJob)1 DiscoverTaskCompleter (com.emc.storageos.volumecontroller.impl.plugins.discovery.smis.DiscoverTaskCompleter)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1