Example #1
0
  /**
   * Limits user access ONLY to the virtual datacenters in the list. If the list is empty, user will
   * get access to all virtual datacenters.
   *
   * @param vdc List of virtual datacenters from the user's enterprise.
   */
  public void setPermittedVirtualDatacenters(final List<VirtualDatacenter> vdcs) {
    List<Integer> ids = Lists.newArrayList();

    for (VirtualDatacenter vdc : vdcs) {
      checkNotNull(
          vdc.getId(),
          ValidationErrors.MISSING_REQUIRED_FIELD + " id in " + VirtualDatacenter.class);
      ids.add(vdc.getId());
    }

    setAvailableVirtualDatacenters(ids);
  }
Example #2
0
 /** Give access to all virtualdatacenters in the enterprise (requires update). */
 public void permitAllVirtualDatacenters() {
   setAvailableVirtualDatacenters(null);
 }