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

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

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

Quota.<init>介绍

[英]Default constructor of Quota, which initialize empty lists for specific limitations, and no user assigned.
[中]配额的默认构造函数,用于初始化特定限制的空列表,并且不分配任何用户。

代码示例

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

protected ListModel<Quota> mockQuotaListModel() {
  final Quota quota = new Quota();
  quota.setId(QUOTA_ID);
  final ListModel<Quota> model = mockListModel(quota);
  when(model.getIsAvailable()).thenReturn(true);
  return model;
}

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

protected org.ovirt.engine.core.common.businessentities.Quota getQuota() {
  org.ovirt.engine.core.common.businessentities.Quota quota =
      new org.ovirt.engine.core.common.businessentities.Quota();
  quota.setId(QUOTA_ID);
  quota.setStoragePoolId(DATACENTER_ID);
  return quota;
}

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

protected org.ovirt.engine.core.common.businessentities.Quota getQuota() {
  org.ovirt.engine.core.common.businessentities.Quota quota =
      new org.ovirt.engine.core.common.businessentities.Quota();
  quota.setId(QUOTA_ID);
  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.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);

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

@Mapping(from = QuotaStorageLimit.class, to = org.ovirt.engine.core.common.businessentities.Quota.class)
public static org.ovirt.engine.core.common.businessentities.Quota map(QuotaStorageLimit model,
    org.ovirt.engine.core.common.businessentities.Quota template) {
  org.ovirt.engine.core.common.businessentities.Quota entity =
      template != null ? template : new org.ovirt.engine.core.common.businessentities.Quota();
  QuotaStorage quotaStorage = new QuotaStorage();
  if (model.isSetLimit()) {
    quotaStorage.setStorageSizeGB(model.getLimit());
  }
  // specific SD
  if(model.isSetStorageDomain() && model.getStorageDomain().isSetId()) {
    quotaStorage.setStorageId(GuidUtils.asGuid(model.getStorageDomain().getId()));
    entity.getQuotaStorages().add(quotaStorage);
  } else { // global
    entity.setGlobalQuotaStorage(quotaStorage);
  }
  return entity;
}

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

Quota quota = new Quota();
quota.setId(diskQuota);
quota.setQuotaName(getDiskImage().getQuotaName());

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

qModel.setHelpTag(HelpTag.new_quota);
qModel.setHashName("new_quota"); //$NON-NLS-1$
Quota newQuota = new Quota();
qModel.setEntity(newQuota);
setWindow(qModel);

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

@Mapping(from = QuotaClusterLimit.class, to = org.ovirt.engine.core.common.businessentities.Quota.class)
  public static org.ovirt.engine.core.common.businessentities.Quota map(QuotaClusterLimit model,
      org.ovirt.engine.core.common.businessentities.Quota template) {
    org.ovirt.engine.core.common.businessentities.Quota entity =
        template != null ? template : new org.ovirt.engine.core.common.businessentities.Quota();
    QuotaCluster quotaCluster = new QuotaCluster();
    if (model.isSetVcpuLimit()) {
      quotaCluster.setVirtualCpu(model.getVcpuLimit());
    }

    if (model.isSetMemoryLimit()) {
      double limit = model.getMemoryLimit();
      quotaCluster.setMemSizeMB( (limit < 0) ? -1 : (long) (limit * 1024) );
    }

    // specific cluster
    if (model.isSetCluster() && model.getCluster().isSetId()) {
      quotaCluster.setClusterId(GuidUtils.asGuid(model.getCluster().getId()));
      entity.getQuotaClusters().add(quotaCluster);
    } else { // global
      entity.setGlobalQuotaCluster(quotaCluster);
    }
    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

@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;
}

相关文章