use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class ClusterListModel method addMacPool.
private void addMacPool(final ClusterModel clusterModel) {
SharedMacPoolModel macPoolModel = new NewSharedMacPoolModel.ClosingWithSetConfirmWindow(this) {
@Override
protected void onActionSucceeded(Guid macPoolId) {
MacPool macPool = getEntity();
macPool.setId(macPoolId);
Collection<MacPool> macPools = new ArrayList<>(clusterModel.getMacPoolListModel().getItems());
macPools.add(macPool);
clusterModel.getMacPoolListModel().setItems(macPools);
clusterModel.getMacPoolListModel().setSelectedItem(macPool);
ClusterListModel.this.setConfirmWindow(null);
}
};
macPoolModel.setEntity(new MacPool());
setConfirmWindow(macPoolModel);
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class MacPoolValidatorTest method callHasUniqueName.
private ValidationResult callHasUniqueName(Guid macPool1Id, Guid macPool2Id, String macPool1Name, String macPool2Name) {
final MacPool existingMacPool = new MacPool();
existingMacPool.setId(macPool1Id);
existingMacPool.setName(macPool1Name);
when(macPoolDaoMock.getAll()).thenReturn(Collections.singletonList(existingMacPool));
macPool.setId(macPool2Id);
macPool.setName(macPool2Name);
return macPoolValidator.hasUniqueName();
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class SharedMacPoolListModel method newMacPool.
private void newMacPool() {
SharedMacPoolModel model = new NewSharedMacPoolModel(this);
model.setEntity(new MacPool());
setWindow(model);
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class SharedMacPoolListModel method onRemove.
private void onRemove() {
cancel();
ArrayList<ActionParametersBase> params = new ArrayList<>();
for (MacPool macPool : getSelectedItems()) {
params.add(new RemoveMacPoolByIdParameters(macPool.getId()));
}
Frontend.getInstance().runMultipleAction(ActionType.RemoveMacPool, params);
}
use of org.ovirt.engine.core.common.businessentities.MacPool in project ovirt-engine by oVirt.
the class SharedMacPoolModel method onSave.
private void onSave() {
if (getProgress() != null || !validate()) {
return;
}
startProgress();
MacPool macPool = flush();
Frontend.getInstance().runAction(actionType, new MacPoolParameters(macPool), result -> {
stopProgress();
if (result.getReturnValue() != null && result.getReturnValue().getSucceeded()) {
onActionSucceeded((Guid) result.getReturnValue().getActionReturnValue());
}
});
}
Aggregations