use of org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations 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();
}
use of org.ovirt.engine.core.utils.SynchronizeNumberOfAsyncOperations in project ovirt-engine by oVirt.
the class StorageHandlingCommandBase method runSynchronizeOperation.
protected void runSynchronizeOperation(ActivateDeactivateSingleAsyncOperationFactory factory, Object... addionalParams) {
List<VDS> allRunningVdsInPool = getAllRunningVdssInPool();
ArrayList<Object> parameters = initAsyncOperationParameters(allRunningVdsInPool);
if (addionalParams.length > 0) {
parameters.addAll(Arrays.asList(addionalParams));
}
SynchronizeNumberOfAsyncOperations sync = new SynchronizeNumberOfAsyncOperations(allRunningVdsInPool.size(), parameters, factory);
sync.execute();
}
Aggregations