use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaCRUDCommand method validate.
@Override
protected boolean validate() {
Quota quota = getParameters().getQuota();
// Cannot add or update a quota to be default using this command
if (quota.isDefault()) {
addValidationMessage(EngineMessage.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID);
return false;
}
QuotaValidator quotaValidator = QuotaValidator.createInstance(quota, false);
// Validate quota and check if the name already exists
return validate(quotaValidator.isValid()) && validateQuotaNameIsUnique(quota);
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class ImportVmFromExternalProviderPopupView method initListBoxEditors.
private void initListBoxEditors() {
destClusterEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Cluster>() {
@Override
public String renderNullSafe(Cluster object) {
return object.getName();
}
});
destClusterQuotaEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<Quota>() {
@Override
public String renderNullSafe(Quota object) {
return object.getQuotaName();
}
});
destStorageEditor = new ListModelListBoxEditor<>(new StorageDomainFreeSpaceRenderer());
cpuProfileEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<CpuProfile>() {
@Override
protected String renderNullSafe(CpuProfile object) {
return object.getName();
}
});
disksAllocationEditor = new ListModelListBoxEditor<>(new NullSafeRenderer<VolumeType>() {
@Override
protected String renderNullSafe(VolumeType object) {
return new EnumRenderer<VolumeType>().render(object);
}
});
attachDriversEditor = new EntityModelCheckBoxEditor(Align.LEFT);
cdImageEditor = new ListModelListBoxOnlyEditor<>(new NullSafeRenderer<RepoImage>() {
@Override
protected String renderNullSafe(RepoImage object) {
return object.getRepoImageId();
}
});
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class SubTabUserQuotaView method initTable.
void initTable() {
getTable().enableColumnResizing();
QuotaDcStatusColumn dcStatusColumn = new QuotaDcStatusColumn();
dcStatusColumn.setContextMenuTitle(constants.dcStatusQuota());
// $NON-NLS-1$
getTable().addColumn(dcStatusColumn, constants.empty(), "30px");
AbstractTextColumn<Quota> nameColumn = new AbstractTextColumn<Quota>() {
@Override
public String getValue(Quota object) {
// $NON-NLS-1$
return object.getQuotaName() == null ? "" : object.getQuotaName();
}
};
nameColumn.makeSortable(QuotaComparator.NAME);
// $NON-NLS-1$
getTable().addColumn(nameColumn, constants.nameQuota(), "300px");
AbstractTextColumn<Quota> descriptionColumn = new AbstractTextColumn<Quota>() {
@Override
public String getValue(Quota object) {
// $NON-NLS-1$
return object.getDescription() == null ? "" : object.getDescription();
}
};
descriptionColumn.makeSortable(QuotaComparator.DESCRIPTION);
// $NON-NLS-1$
getTable().addColumn(descriptionColumn, constants.descriptionQuota(), "300px");
AbstractTextColumn<Quota> datacenterColumn = new AbstractTextColumn<Quota>() {
@Override
public String getValue(Quota object) {
// $NON-NLS-1$
return object.getStoragePoolName() == null ? "" : object.getStoragePoolName();
}
};
datacenterColumn.makeSortable(QuotaComparator.DATA_CENTER);
// $NON-NLS-1$
getTable().addColumn(datacenterColumn, constants.dcQuota(), "300px");
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockVCPUQuotaGlobalNotExceeded.
// ///////////////////// VCPU global ////////////////////////////
/**
* Call by Guid: {@literal VCPU_QUOTA_GLOBAL_NOT_EXCEEDED}
*/
private Quota mockVCPUQuotaGlobalNotExceeded() {
Quota quota = mockBasicQuota();
quota.setId(VCPU_QUOTA_GLOBAL_NOT_EXCEEDED);
quota.setGlobalQuotaCluster(getQuotaCluster(100, 18, UNLIMITED_MEM, 0));
return quota;
}
use of org.ovirt.engine.core.common.businessentities.Quota in project ovirt-engine by oVirt.
the class QuotaManagerTest method mockMemQuotaGlobalOverGrace.
/**
* Call by Guid: {@literal MEM_QUOTA_GLOBAL_OVER_GRACE}
*/
private Quota mockMemQuotaGlobalOverGrace() {
Quota quota = mockBasicQuota();
quota.setId(MEM_QUOTA_GLOBAL_OVER_GRACE);
quota.setGlobalQuotaCluster(getQuotaCluster(UNLIMITED_VCPU, 0, 2048, 3000));
return quota;
}
Aggregations