public static void save(VCenterForm vCenter) {
    if (!vCenter.canEditVcenter()) {
      VcenterRestRep dbVCenter = VCenterUtils.getVCenter(uri(vCenter.id));
      if (dbVCenter != null) {
        vCenter.name = dbVCenter.getName();
      }
      vCenter.save(false);
      flash.success(MessagesUtils.get(SAVED, vCenter.name));
      list();
      return;
    }

    vCenter.validate("vCenter");
    if (Validation.hasErrors()) {
      edit(vCenter);
    } else {
      Boolean validateConnectionParam = params.get("validateConnection", Boolean.class);
      boolean validateConnection =
          validateConnectionParam != null ? validateConnectionParam.booleanValue() : false;

      vCenter.save(validateConnection);

      flash.success(MessagesUtils.get(SAVED, vCenter.name));
      list();
    }
  }
 private static void addNoneTenantOption(String id, List<TenantOrgRestRep> vCenterTenantOptions) {
   VcenterRestRep vcenterRestRep = VCenterUtils.getVCenter(uri(id));
   if (vcenterRestRep != null && !vcenterRestRep.getCascadeTenancy()) {
     TenantOrgRestRep noneTenantOption = new TenantOrgRestRep();
     noneTenantOption.setName("None");
     noneTenantOption.setId(NullColumnValueGetter.getNullURI());
     vCenterTenantOptions.add(noneTenantOption);
   }
 }
 public void doReadFrom(VcenterRestRep vCenter) {
   this.id = vCenter.getId().toString();
   this.name = vCenter.getName();
   this.hostname = vCenter.getIpAddress();
   this.username = vCenter.getUsername();
   this.port = vCenter.getPortNumber();
   this.cascadeTenancy = vCenter.getCascadeTenancy();
   doReadAcls();
 }