use of org.ovirt.engine.core.common.action.IdParameters in project ovirt-engine by oVirt.
the class UserListModel method onRemove.
public void onRemove() {
List<DbUser> selectedItems = getSelectedItems();
ArrayList<ActionParametersBase> userPrms = new ArrayList<>();
ArrayList<ActionParametersBase> groupPrms = new ArrayList<>();
for (DbUser item : selectedItems) {
if (!item.isGroup()) {
userPrms.add(new IdParameters(item.getId()));
} else {
groupPrms.add(new IdParameters(item.getId()));
}
}
IFrontendMultipleActionAsyncCallback lastCallback = result -> Scheduler.get().scheduleDeferred(() -> {
// Refresh user list.
syncSearch();
cancel();
});
if (getUserOrGroup() == UserOrGroup.User) {
if (userPrms.size() > 0) {
Frontend.getInstance().runMultipleAction(ActionType.RemoveUser, userPrms, lastCallback);
}
} else if (getUserOrGroup() == UserOrGroup.Group) {
if (groupPrms.size() > 0) {
Frontend.getInstance().runMultipleAction(ActionType.RemoveGroup, groupPrms, lastCallback);
}
}
}
use of org.ovirt.engine.core.common.action.IdParameters in project ovirt-engine by oVirt.
the class BackendQuotaResource method remove.
@Override
public Response remove() {
get();
IdParameters prms = new IdParameters(asGuid(id));
return performAction(ActionType.RemoveQuota, prms);
}
use of org.ovirt.engine.core.common.action.IdParameters in project ovirt-engine by oVirt.
the class RemoveAdGroupCommandTest method initializeCommand.
@Before
public void initializeCommand() {
IdParameters parameters = createParameters();
command = spy(new RemoveGroupCommand<>(parameters, null));
}
use of org.ovirt.engine.core.common.action.IdParameters in project ovirt-engine by oVirt.
the class QuotaListModel method onRemove.
public void onRemove() {
ConfirmationModel model = (ConfirmationModel) getWindow();
if (model.getProgress() != null) {
return;
}
ArrayList<ActionParametersBase> prms = new ArrayList<>();
for (Quota a : getSelectedItems()) {
IdParameters idParameters = new IdParameters(a.getId());
prms.add(idParameters);
}
model.startProgress();
Frontend.getInstance().runMultipleAction(ActionType.RemoveQuota, prms, result -> {
ConfirmationModel localModel = (ConfirmationModel) result.getState();
localModel.stopProgress();
cancel();
}, model);
}
use of org.ovirt.engine.core.common.action.IdParameters in project ovirt-engine by oVirt.
the class ExternalNetworkSyncService method synchronize.
private void synchronize() {
List<Provider<?>> networkProviders = providerDao.getAllByTypes(ProviderType.EXTERNAL_NETWORK, ProviderType.OPENSTACK_NETWORK);
networkProviders.stream().filter(provider -> {
OpenstackNetworkProviderProperties networkProperties = (OpenstackNetworkProviderProperties) provider.getAdditionalProperties();
return networkProperties.getAutoSync();
}).map(Provider::getId).distinct().forEach(providerId -> {
backendInternal.runInternalAction(ActionType.SyncNetworkProvider, new IdParameters(providerId));
});
}
Aggregations