本文整理了Java中org.ovirt.engine.core.common.businessentities.Quota.setQuotaName
方法的一些代码示例,展示了Quota.setQuotaName
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.setQuotaName
方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.Quota
类名称:Quota
方法名:setQuotaName
暂无
代码示例来源:origin: oVirt/ovirt-engine
private Quota getQuotaMetaDataFromResultSet(ResultSet rs) throws SQLException {
Quota entity = new Quota();
entity.setId(getGuidDefaultEmpty(rs, "quota_id"));
entity.setStoragePoolId(getGuidDefaultEmpty(rs, "storage_pool_id"));
entity.setStoragePoolName(rs.getString("storage_pool_name"));
entity.setQuotaName((String) rs.getObject("quota_name"));
entity.setDescription((String) rs.getObject("description"));
entity.setThresholdClusterPercentage((Integer) rs.getObject("threshold_cluster_percentage"));
entity.setThresholdStoragePercentage((Integer) rs.getObject("threshold_storage_percentage"));
entity.setGraceClusterPercentage((Integer) rs.getObject("grace_cluster_percentage"));
entity.setGraceStoragePercentage((Integer) rs.getObject("grace_storage_percentage"));
entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type")));
entity.setDefault(rs.getBoolean("is_default"));
return entity;
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
protected org.ovirt.engine.core.common.businessentities.Quota getEntity(int index) {
org.ovirt.engine.core.common.businessentities.Quota quota =
new org.ovirt.engine.core.common.businessentities.Quota();
quota.setId(GUIDS[index]);
quota.setQuotaName(NAMES[index]);
quota.setDescription(DESCRIPTIONS[index]);
quota.setStoragePoolId(DATACENTER_ID);
return quota;
}
}
代码示例来源:origin: oVirt/ovirt-engine
@Override
protected org.ovirt.engine.core.common.businessentities.Quota getEntity(int index) {
org.ovirt.engine.core.common.businessentities.Quota quota =
new org.ovirt.engine.core.common.businessentities.Quota();
quota.setId(GUIDS[index]);
quota.setDescription(DESCRIPTIONS[index]);
quota.setQuotaName(NAMES[index]);
quota.setStoragePoolId(GUIDS[index]);
return quota;
}
代码示例来源:origin: oVirt/ovirt-engine
Quota quota = new Quota();
quota.setId(defaultQuota);
quota.setQuotaName(quotaName);
quotaList.add(0, quota);
vmModel.getQuota().setItems(quotaList);
代码示例来源:origin: oVirt/ovirt-engine
Quota quota = new Quota();
quota.setId(diskQuota);
quota.setQuotaName(getDiskImage().getQuotaName());
代码示例来源:origin: oVirt/ovirt-engine
private static Quota createGeneralQuota() {
Quota quota = new Quota();
Guid quotaId = Guid.newGuid();
quota.setId(quotaId);
quota.setStoragePoolId(FixturesTool.STORAGE_POOL_NFS);
quota.setQuotaName("Watson");
quota.setDescription("General quota");
quota.setThresholdClusterPercentage(80);
quota.setThresholdStoragePercentage(80);
quota.setGraceClusterPercentage(20);
quota.setGraceStoragePercentage(20);
return quota;
}
}
代码示例来源:origin: oVirt/ovirt-engine
/**
* Make Quota specific to be the same as Quota general and specific.
*/
@Test
public void testUpdateQuota() {
Quota quotaGeneralToSpecific = dao.getById(FixturesTool.QUOTA_GENERAL);
// Save quotaName and cluster list for future check.
String quotaName = "New Temporary name";
List<QuotaCluster> quotaClusterList =
getQuotaCluster(getSpecificQuotaCluster(quotaGeneralToSpecific.getId()));
Long newStorageLimit = 2345L;
// Check before the update, that the fields are not equal.
assertNotEquals(quotaName, quotaGeneralToSpecific.getQuotaName());
assertNotEquals(quotaClusterList.size(), quotaGeneralToSpecific.getQuotaClusters().size());
assertNotEquals(newStorageLimit, quotaGeneralToSpecific.getGlobalQuotaStorage().getStorageSizeGB());
// Update
quotaGeneralToSpecific.setQuotaName(quotaName);
quotaGeneralToSpecific.getGlobalQuotaStorage().setStorageSizeGB(newStorageLimit);
quotaGeneralToSpecific.setQuotaClusters(quotaClusterList);
dao.update(quotaGeneralToSpecific);
quotaGeneralToSpecific = dao.getById(FixturesTool.QUOTA_GENERAL);
// Check after the update, that the fields are equal now.
assertEquals(quotaName, quotaGeneralToSpecific.getQuotaName());
assertEquals(quotaClusterList.size(), quotaGeneralToSpecific.getQuotaClusters().size());
assertEquals(newStorageLimit, quotaGeneralToSpecific.getGlobalQuotaStorage().getStorageSizeGB());
}
代码示例来源:origin: oVirt/ovirt-engine
quota.setQuotaName(model.getName().getEntity());
quota.setDescription(model.getDescription().getEntity());
quota.setStoragePoolId(model.getDataCenter().getSelectedItem().getId());
代码示例来源:origin: oVirt/ovirt-engine
@Mapping(from = Quota.class, to = org.ovirt.engine.core.common.businessentities.Quota.class)
public static org.ovirt.engine.core.common.businessentities.Quota map(Quota model, org.ovirt.engine.core.common.businessentities.Quota template) {
org.ovirt.engine.core.common.businessentities.Quota entity = (template==null) ? new org.ovirt.engine.core.common.businessentities.Quota() : template;
if (model.isSetId()) {
entity.setId(GuidUtils.asGuid(model.getId()));
}
if (model.isSetName()) {
entity.setQuotaName(model.getName());
}
if (model.isSetDescription()) {
entity.setDescription(model.getDescription());
}
if (model.isSetDataCenter()) {
entity.setStoragePoolId(GuidUtils.asGuid(model.getDataCenter().getId()));
}
if (model.isSetClusterHardLimitPct()) {
entity.setGraceClusterPercentage(model.getClusterHardLimitPct());
}
if (model.isSetStorageHardLimitPct()) {
entity.setGraceStoragePercentage(model.getStorageHardLimitPct());
}
if (model.isSetClusterSoftLimitPct()) {
entity.setThresholdClusterPercentage(model.getClusterSoftLimitPct());
}
if (model.isSetStorageSoftLimitPct()) {
entity.setThresholdStoragePercentage(model.getStorageSoftLimitPct());
}
return entity;
}
内容来源于网络,如有侵权,请联系作者删除!