Search in sources :

Example 1 with ISingleAsyncOperation

use of org.ovirt.engine.core.utils.ISingleAsyncOperation in project ovirt-engine by oVirt.

the class RemoveStoragePoolCommand method connectAllHostToPoolAndDomain.

/**
 * @param masterDomain
 *            Connect all hosts to the pool and to the domains
 */
protected void connectAllHostToPoolAndDomain(final StorageDomain masterDomain) {
    final List<VDS> vdsList = getAllRunningVdssInPool();
    final StoragePool storagePool = getStoragePool();
    SynchronizeNumberOfAsyncOperations sync = new SynchronizeNumberOfAsyncOperations(vdsList.size(), null, new ActivateDeactivateSingleAsyncOperationFactory() {

        @Override
        public ISingleAsyncOperation createSingleAsyncOperation() {
            return Injector.injectMembers(new ConnectVDSToPoolAndDomains(vdsList, masterDomain, storagePool));
        }

        @Override
        public void initialize(List parameters) {
        // no need to initilalize params
        }
    });
    sync.execute();
}
Also used : StoragePool(org.ovirt.engine.core.common.businessentities.StoragePool) VDS(org.ovirt.engine.core.common.businessentities.VDS) SynchronizeNumberOfAsyncOperations(org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations) ISingleAsyncOperation(org.ovirt.engine.core.utils.ISingleAsyncOperation) List(java.util.List)

Aggregations

List (java.util.List)1 StoragePool (org.ovirt.engine.core.common.businessentities.StoragePool)1 VDS (org.ovirt.engine.core.common.businessentities.VDS)1 ISingleAsyncOperation (org.ovirt.engine.core.utils.ISingleAsyncOperation)1 SynchronizeNumberOfAsyncOperations (org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations)1