Exemple #1
0
  public static void checkAdminVdc(AdminVdc vdc) {
    // optional
    // NOTE isThinProvision cannot be checked
    // NOTE usesFastProvisioning cannot be checked
    if (vdc.getResourceGuaranteedMemory() != null) {
      // TODO: between 0 and 1 inc.
    }
    if (vdc.getResourceGuaranteedCpu() != null) {
      // TODO: between 0 and 1 inc.
    }
    if (vdc.getVCpuInMhz() != null) {
      assertTrue(
          vdc.getVCpuInMhz() >= 0,
          String.format(OBJ_FIELD_GTE_0, "Vdc", "cCpuInMhz", vdc.getVCpuInMhz()));
    }
    if (vdc.getNetworkPoolReference() != null) {
      checkReferenceType(vdc.getNetworkPoolReference());
    }
    if (vdc.getProviderVdcReference() != null) {
      checkReferenceType(vdc.getProviderVdcReference());
    }

    // parent type
    checkVdc(vdc);
  }
Exemple #2
0
 public T fromAdminVdc(AdminVdc in) {
   return fromVdc(in)
       .resourceGuaranteedMemory(in.getResourceGuaranteedMemory())
       .resourceGuaranteedCpu(in.getResourceGuaranteedCpu())
       .vCpuInMhz(in.getVCpuInMhz())
       .isThinProvision(in.isThinProvision())
       .networkPoolReference(in.getNetworkPoolReference())
       .providerVdcReference(in.getProviderVdcReference())
       .usesFastProvisioning(in.usesFastProvisioning());
 }