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

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

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

Quota.getStoragePoolId介绍

暂无

代码示例

代码示例来源:origin: oVirt/ovirt-engine

@Test
public void testGetDefaultQuotaForStoragePool() {
  Quota quota = dao.getDefaultQuotaForStoragePool(FixturesTool.STORAGE_POOL_NFS);
  assertNotNull(quota);
  assertEquals(FixturesTool.STORAGE_POOL_NFS, quota.getStoragePoolId());
  assertTrue(quota.isDefault());
}

代码示例来源:origin: oVirt/ovirt-engine

@Mapping(from = org.ovirt.engine.core.common.businessentities.Quota.class, to = QuotaStorageLimit.class)
public static QuotaStorageLimit map(org.ovirt.engine.core.common.businessentities.Quota entity,
    QuotaStorageLimit template) {
  QuotaStorageLimit model = template != null ? template : new QuotaStorageLimit();
  Guid guid = GuidUtils.asGuid(model.getId());
  // global
  if (guid.equals(entity.getId())) {
    map(model, entity.getGlobalQuotaStorage(), null, entity.getStoragePoolId().toString(), entity.getId()
        .toString());
  } else { // specific
    if (entity.getQuotaStorages() != null) {
      for (QuotaStorage quotaStorage : entity.getQuotaStorages()) {
        if (quotaStorage.getStorageId() != null && quotaStorage.getStorageId().equals(guid)) {
          map(model, quotaStorage, quotaStorage.getStorageId().toString(), entity.getStoragePoolId()
              .toString(), entity.getId().toString());
        }
      }
    }
  }
  return model;
}

代码示例来源:origin: oVirt/ovirt-engine

@Mapping(from = org.ovirt.engine.core.common.businessentities.Quota.class, to = QuotaClusterLimit.class)
public static QuotaClusterLimit map(org.ovirt.engine.core.common.businessentities.Quota entity,
    QuotaClusterLimit template) {
  QuotaClusterLimit model = template != null ? template : new QuotaClusterLimit();
  Guid guid = GuidUtils.asGuid(model.getId());
  // global
  if (guid.equals(entity.getId())) {
    map(model, entity.getGlobalQuotaCluster(), null, entity.getStoragePoolId().toString(), entity.getId()
        .toString());
  } else { // specific
    if (entity.getQuotaClusters() != null) {
      for (QuotaCluster quotaCluster : entity.getQuotaClusters()) {
        if (quotaCluster.getClusterId() != null && quotaCluster.getClusterId().equals(guid)) {
          map(model, quotaCluster, quotaCluster.getClusterId().toString(), entity.getStoragePoolId()
              .toString(), entity.getId().toString());
        }
      }
    }
  }
  return model;
}

代码示例来源:origin: oVirt/ovirt-engine

private MapSqlParameterSource createQuotaMetaDataParameterMapper(Quota quota) {
  return createQuotaIdParameterMapper(quota.getId()).addValue("storage_pool_id", quota.getStoragePoolId())
      .addValue("quota_name", quota.getQuotaName())
      .addValue("description", quota.getDescription())
      .addValue("threshold_cluster_percentage", quota.getThresholdClusterPercentage())
      .addValue("threshold_storage_percentage", quota.getThresholdStoragePercentage())
      .addValue("grace_cluster_percentage", quota.getGraceClusterPercentage())
      .addValue("grace_storage_percentage", quota.getGraceStoragePercentage())
      .addValue("is_default", quota.isDefault());
}

代码示例来源:origin: oVirt/ovirt-engine

@Mapping(from = org.ovirt.engine.core.common.businessentities.Quota.class, to = Quota.class)
public static Quota map(org.ovirt.engine.core.common.businessentities.Quota template, Quota model) {
  Quota ret = (model==null) ? new Quota() : model;
  if (template.getId()!=null) {
    ret.setId(template.getId().toString());
  }
  if (template.getQuotaName()!=null) {
    ret.setName(template.getQuotaName());
  }
  if (template.getDescription()!=null) {
    ret.setDescription(template.getDescription());
  }
  if (template.getStoragePoolId()!=null) {
    if (ret.getDataCenter()==null) {
      ret.setDataCenter(new DataCenter());
    }
    ret.getDataCenter().setId(template.getStoragePoolId().toString());
  }
  ret.setClusterHardLimitPct(template.getGraceClusterPercentage());
  ret.setStorageHardLimitPct(template.getGraceStoragePercentage());
  ret.setClusterSoftLimitPct(template.getThresholdClusterPercentage());
  ret.setStorageSoftLimitPct(template.getThresholdStoragePercentage());
  return ret;
}

代码示例来源:origin: oVirt/ovirt-engine

dataCenter.setId(quota.getStoragePoolId());
dataCenter.setName(quota.getStoragePoolName());
dataCenterList.add(dataCenter);

相关文章