Package com.vmware.vim25

Examples of com.vmware.vim25.Permission


           else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri );

        }
        else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());
       
        Permission permission = grant.getPermission();
        String permissionValue = permission.getValue();
        if(permissionValue.equalsIgnoreCase("READ")) {
          engineGrant.setPermission(SAcl.PERMISSION_READ);
        } else if(permissionValue.equalsIgnoreCase("WRITE")) {
          engineGrant.setPermission(SAcl.PERMISSION_WRITE);
        } else if(permissionValue.equalsIgnoreCase("READ_ACP")) {
View Full Code Here


                        throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri);

                } else
                    throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());

                Permission permission = grant.getPermission();
                String permissionValue = permission.getValue();
                if (permissionValue.equalsIgnoreCase("READ")) {
                    engineGrant.setPermission(SAcl.PERMISSION_READ);
                } else if (permissionValue.equalsIgnoreCase("WRITE")) {
                    engineGrant.setPermission(SAcl.PERMISSION_WRITE);
                } else if (permissionValue.equalsIgnoreCase("READ_ACP")) {
View Full Code Here

           else throw new UnsupportedOperationException("Unsupported grantee group URI: " + uri );

        }
        else throw new UnsupportedOperationException("Unsupported grantee type: " + grantee.getClass().getCanonicalName());
       
        Permission permission = grant.getPermission();
        String permissionValue = permission.getValue();
        if(permissionValue.equalsIgnoreCase("READ")) {
          engineGrant.setPermission(SAcl.PERMISSION_READ);
        } else if(permissionValue.equalsIgnoreCase("WRITE")) {
          engineGrant.setPermission(SAcl.PERMISSION_WRITE);
        } else if(permissionValue.equalsIgnoreCase("READ_ACP")) {
View Full Code Here

    userRole.setSubnetworkId(subnetworkId);
    userRole.setParentUserRoleId(parentUserRoleId);

    // Create a permission object to represent each permission this user role
    // has.
    Permission permission1 = new Permission();
    permission1.setId(permission1Id);
    Permission permission2 = new Permission();
    permission2.setId(permission2Id);
    Permission[] permissions = new Permission[] {permission1, permission2};

    // Add the permissions to the user role.
    userRole.setPermissions(permissions);
View Full Code Here

    userRole.setSubnetworkId(subnetworkId);
    userRole.setParentUserRoleId(parentUserRoleId);

    // Create a permission object to represent each permission this user role
    // has.
    Permission permission1 = new Permission();
    permission1.setId(permission1Id);
    Permission permission2 = new Permission();
    permission2.setId(permission2Id);
    Permission[] permissions = new Permission[] {permission1, permission2};

    // Add the permissions to the user role.
    userRole.setPermissions(permissions);
View Full Code Here

    // When we break cluster hosts into individual hosts used in our resource allocator,
    // we will have to populate ComputeResourceSummary by ourselves here
    //
    HostHardwareSummary hardwareSummary = getHostHardwareSummary();
   
    ComputeResourceSummary resourceSummary = new ComputeResourceSummary();
   
    // TODO: not sure how hyper-threading is counted in VMware
    short totalCores = (short)(hardwareSummary.getNumCpuCores()*hardwareSummary.getNumCpuPkgs());
    resourceSummary.setNumCpuCores(totalCores);
   
    // Note: memory here is in Byte unit
    resourceSummary.setTotalMemory(hardwareSummary.getMemorySize());
   
    // Total CPU is based on socket x core x Mhz
    int totalCpu = hardwareSummary.getCpuMhz() * totalCores;
    resourceSummary.setTotalCpu(totalCpu);

    HostListSummaryQuickStats stats = getHostQuickStats();
    if(stats.getOverallCpuUsage() == null || stats.getOverallMemoryUsage() == null)
      throw new Exception("Unable to get valid overal CPU/Memory usage data, host may be disconnected");
   
    resourceSummary.setEffectiveCpu(totalCpu - stats.getOverallCpuUsage());
   
    // Note effective memory is in MB unit
    resourceSummary.setEffectiveMemory(hardwareSummary.getMemorySize()/(1024*1024) - stats.getOverallMemoryUsage());
   
      if(s_logger.isTraceEnabled())
      s_logger.trace("vCenter API trace - getHyperHostHardwareSummary() done");
     
    return resourceSummary;
View Full Code Here

    ManagedObjectReference[] datastores = (ManagedObjectReference[])serviceUtil.getDynamicProperty(
      _mor, "datastore");
    List<ManagedObjectReference> l = new ArrayList<ManagedObjectReference>();
    if(datastores != null) {
      for(ManagedObjectReference mor : datastores) {
        DatastoreSummary summary = (DatastoreSummary)serviceUtil.getDynamicProperty(mor, "summary");
        if(summary.getType().equalsIgnoreCase("VMFS") && !summary.getMultipleHostAccess())
          l.add(mor);
      }
    }
    return l.toArray(new ManagedObjectReference[1]);
  }
View Full Code Here

    List<Pair<ManagedObjectReference, String>> dsList = new ArrayList<Pair<ManagedObjectReference, String>>();
   
    ObjectContent[] ocs = getDatastorePropertiesOnHyperHost(new String[] { "name", "summary" });
    if(ocs != null) {
      for(ObjectContent oc : ocs) {
        DatastoreSummary dsSummary = (DatastoreSummary)VmwareHelper.getPropValue(oc, "summary");
        if(dsSummary.getMultipleHostAccess() == false && dsSummary.isAccessible() && dsSummary.getType().equalsIgnoreCase("vmfs")) {
          ManagedObjectReference morDs = oc.getObj();
          String name = (String)VmwareHelper.getPropValue(oc, "name");
         
          dsList.add(new Pair<ManagedObjectReference, String>(morDs, name));
        }
View Full Code Here

        VirtualEthernetCard nic =  new VirtualE1000();
        VirtualEthernetCardNetworkBackingInfo nicBacking =
            new VirtualEthernetCardNetworkBackingInfo();
        nicBacking.setDeviceName(netName);

        Description info = new Description();
        info.setLabel(nicName);
        info.setSummary(netName);
        nic.setDeviceInfo(info);
   
        // type: "generated", "manual", "assigned" by VC
        nic.setAddressType("generated");
        nic.setBacking(nicBacking);
View Full Code Here

        VmdkBitmap bmp = new VmdkBitmap(capacityInBytes, 1024 * 1024);
       
        boolean isNotChangedAtAll = false;
        try {
            long offset = 0;
            DiskChangeInfo dci = null;
            do {
                dci = vm.queryChangedDiskAreas
                    (vmSnap, vmdkInfo.key_, offset, baseChangeId);

                if (offset == 0 && (dci.changedArea == null)) {
                    /*
                      ChangeId is not null and DiskChangeInfo.changedArea is null,
                       then the disk is not changed at all.
                     */
                    isNotChangedAtAll = true;
                    logger_.info("This vmdk is not changed at all " +
                                 "from previous backup.");
                    break;
                }
               
                for (int j = 0; j < dci.changedArea.length; j ++) {
                    long start = dci.getChangedArea()[j].getStart();
                    long len = dci.getChangedArea()[j].getLength();
                    logger_.info
                        (String.format
                         ("(%d,%d) %s \n", start, len,
                          (len % 1048576 == 0 ? "" : "not x MB")));

                    bmp.setRangeInBytes(start, len);
                }
                logger_.info
                    (String.format
                     ("offset %d, length %d\n",
                      dci.getStartOffset(), dci.getLength()));
                offset = dci.getStartOffset() + dci.getLength();
            } while (offset < capacityInBytes);
                   
        } catch (Exception e) {
            logger_.warning(Utility.toString(e));
            return null;
View Full Code Here

TOP

Related Classes of com.vmware.vim25.Permission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.