本文整理了Java中org.ovirt.engine.core.common.businessentities.Quota.setQuotaStorages
方法的一些代码示例,展示了Quota.setQuotaStorages
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.setQuotaStorages
方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.Quota
类名称:Quota
方法名:setQuotaStorages
暂无
代码示例来源:origin: oVirt/ovirt-engine
/**
* Default constructor of Quota, which initialize empty lists for specific limitations, and no user assigned.
*/
public Quota() {
setQuotaStorages(new ArrayList<QuotaStorage>());
setQuotaClusters(new ArrayList<QuotaCluster>());
id = Guid.Empty;
description = "";
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Get full {@code Quota} entity.
*/
@Override
public Quota getById(Guid quotaId) {
MapSqlParameterSource parameterSource = createQuotaIdParameterMapper(quotaId);
Quota quotaEntity =
getCallsHandler().executeRead("GetQuotaByQuotaGuid", getQuotaFromResultSet(), parameterSource);
if (quotaEntity != null) {
quotaEntity.setQuotaClusters(getQuotaClusterByQuotaGuid(quotaId));
quotaEntity.setQuotaStorages(getQuotaStorageByQuotaGuid(quotaId));
}
return quotaEntity;
}
代码示例来源:origin: oVirt/ovirt-engine
} else {
if (quota.getQuotaStorages() == null) {
quota.setQuotaStorages(new ArrayList<>());
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testListNonGlobalLimit() {
Quota quota = getQuota();
List<QuotaStorage> storageLimits = new LinkedList<>();
QuotaStorage storageLimit1 = new QuotaStorage();
storageLimit1.setStorageSizeGB(STORAGE_SIZE_GB);
storageLimit1.setStorageId(STORAGE_ID_1);
QuotaStorage storageLimit2 = new QuotaStorage();
storageLimit2.setStorageSizeGBUsage(STORAGE_SIZE_GB_USAGE);
storageLimit2.setStorageId(STORAGE_ID_2);
storageLimits.add(storageLimit1);
storageLimits.add(storageLimit2);
quota.setQuotaStorages(storageLimits);
setUpGetEntityExpectations(quota);
QuotaStorageLimits list = collection.list();
assertStorageLimitsFound(list, 2);
for (QuotaStorageLimit storageLimit : list.getQuotaStorageLimits()) {
if (storageLimit.getStorageDomain().getId().equals(STORAGE_ID_1.toString())) {
assertEquals(STORAGE_SIZE_GB, storageLimit.getLimit());
}
if (storageLimit.getStorageDomain().getId().equals(STORAGE_ID_2.toString())) {
assertEquals(STORAGE_SIZE_GB_USAGE, storageLimit.getUsage(), 0.0001);
}
}
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testSpecificQuotaLimitations() {
// Set new Quota definition.
Quota quota = createGeneralQuota();
quota.setQuotaClusters(getQuotaCluster(getSpecificQuotaCluster(quota.getId())));
quota.setQuotaStorages(getQuotaStorage(getSpecificQuotaStorage(quota.getId())));
dao.save(quota);
Quota quotaEntity = dao.getById(quota.getId());
assertNotNull(quotaEntity);
assertEquals(quota, quotaEntity);
}
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testSpecificAndGeneralQuotaLimitations() {
// Set new Quota definition.
Quota quota = createGeneralQuota();
quota.setQuotaClusters(getQuotaCluster(getSpecificQuotaCluster(quota.getId())));
quota.setQuotaStorages(getQuotaStorage(null));
quota.setGlobalQuotaStorage(new QuotaStorage(null, null, null, 10000L, 0d));
dao.save(quota);
Quota quotaEntity = dao.getById(quota.getId());
assertNotNull(quotaEntity);
assertEquals(quota, quotaEntity);
}
代码示例来源:origin: oVirt/ovirt-engine
quota.setQuotaStorages(quotaStorageList);
代码示例来源:origin: oVirt/ovirt-engine
@Test
public void testGeneralQuotaLimitations() {
// Set new Quota definition.
Quota quota = createGeneralQuota();
setQuotaGlobalLimitations(quota);
quota.setQuotaClusters(getQuotaCluster(null));
quota.setQuotaStorages(getQuotaStorage(null));
dao.save(quota);
Quota quotaEntity = dao.getById(quota.getId());
assertNotNull(quotaEntity);
assertEquals(quota, quotaEntity);
assertEquals("rhel6.NFS", quotaEntity.getStoragePoolName());
assertEquals(QuotaEnforcementTypeEnum.DISABLED, quotaEntity.getQuotaEnforcementType());
}
内容来源于网络,如有侵权,请联系作者删除!