org.ovirt.engine.core.common.businessentities.Quota.setGraceStoragePercentage()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(66)

本文整理了Java中org.ovirt.engine.core.common.businessentities.Quota.setGraceStoragePercentage方法的一些代码示例,展示了Quota.setGraceStoragePercentage的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Quota.setGraceStoragePercentage方法的具体详情如下:
包路径:org.ovirt.engine.core.common.businessentities.Quota
类名称:Quota
方法名:setGraceStoragePercentage

Quota.setGraceStoragePercentage介绍

暂无

代码示例

代码示例来源: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

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

quota.setGraceStoragePercentage(model.getGraceStorageAsInteger());
quota.setThresholdClusterPercentage(model.getThresholdClusterAsInteger());
quota.setThresholdStoragePercentage(model.getThresholdStorageAsInteger());

代码示例来源: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;
}

相关文章