Package com.vmware.vim25

Examples of com.vmware.vim25.DynamicProperty


            for (ObjectContent oc : ocs) {
                if (oc.getPropSet().get(0).getVal().equals(name))
                    return oc.getObj();

                if (oc.getPropSet().size() > 1) {
                    DynamicProperty prop = oc.getPropSet().get(1);
                    if (prop != null && prop.getVal() != null) {
                        if (prop.getVal() instanceof CustomFieldStringValue) {
                            String val = ((CustomFieldStringValue)prop.getVal()).getValue();
                            if (val.equalsIgnoreCase(name))
                                return oc.getObj();
                        }
                    }
                }
View Full Code Here


        _context.getPropertyCollector(), pfSpecArr);


      if(ocs != null) {
        for(ObjectContent oc : ocs) {
          DynamicProperty prop = oc.getPropSet().get(0);
          if(prop.getVal().toString().equals(dsName)) {
            return new Pair<DatastoreMO, String>(new DatastoreMO(_context, oc.getObj()), dsName);
          }
        }
      }
View Full Code Here

        Object propertyValue = null;
        if (objContent != null && objContent.size() > 0) {
            List<DynamicProperty> dynamicProperty = objContent.get(0).getPropSet();
            if (dynamicProperty != null && dynamicProperty.size() > 0) {
                DynamicProperty dp = dynamicProperty.get(0);
                propertyValue = dp.getVal();
                /*
                 * If object is ArrayOfXXX object, then get the XXX[] by
                 * invoking getXXX() on the object.
                 * For Ex:
                 * ArrayOfManagedObjectReference.getManagedObjectReference()
 
View Full Code Here

      for(ObjectContent oc : ocs) {
        if(oc.getPropSet(0).getVal().equals(name))
          return oc.getObj();
       
        if(oc.getPropSet().length > 1) {
          DynamicProperty prop = oc.getPropSet(1);
          if(prop != null && prop.getVal() != null) {
            if(prop.getVal() instanceof CustomFieldStringValue) {
              String val = ((CustomFieldStringValue)prop.getVal()).getValue();
              if(val.equalsIgnoreCase(name))
                return oc.getObj();
            }
          }
        }
View Full Code Here

      // If we get contents back. print them out.
      if (ocary != null) {
         ObjectContent oc = null;
         ManagedObjectReference mor = null;
         DynamicProperty[] pcary = null;
         DynamicProperty pc = null;
         for (int oci = 0; oci < ocary.length; oci++) {
            oc = ocary[oci];
            mor = oc.getObj();
            pcary = oc.getPropSet();

            System.out.println("Object Type : " + mor.getType());
            System.out.println("Reference Value : " + mor.get_value());

            if (pcary != null) {
               for (int pci = 0; pci < pcary.length; pci++) {
                  pc = pcary[pci];
                  System.out.println("   Property Name : " + pc.getName());
                  if (pc != null) {
                     if (!pc.getVal().getClass().isArray()) {
                        System.out.println("   Property Value : " + pc.getVal());
                     }
                     else {
                        Object[] ipcary = (Object[])pc.getVal();
                        System.out.println("Val : " + pc.getVal());
                        for (int ii = 0; ii < ipcary.length; ii++) {
                           Object oval = ipcary[ii];
                           if (oval.getClass().getName().indexOf("ManagedObjectReference") >= 0) {
                              ManagedObjectReference imor = (ManagedObjectReference)oval;
View Full Code Here

      for(int i = 0; i< ocs.length; ++i) {
        ObjectContent oc = ocs[i];
        DynamicProperty[] dps = oc.getPropSet();
        if(dps != null) {
          for(int j = 0; j < dps.length; ++j) {
            DynamicProperty dp = dps[j];
            for(int p = 0; p < ret.length; ++p) {
              if(properties[p].equals(dp.getName())) {
                ret[p] = dp.getVal();
              }
            }
          }
        }
      }
View Full Code Here

        _context.getPropertyCollector(), pfSpecArr);


      if(ocs != null) {
        for(ObjectContent oc : ocs) {
          DynamicProperty prop = oc.getPropSet().get(0);
          if(prop.getVal().toString().equals(dsName)) {
            return new Pair<DatastoreMO, String>(new DatastoreMO(_context, oc.getObj()), dsName);
          }
        }
      }
View Full Code Here

        Object propertyValue = null;
        if (objContent != null && objContent.size() > 0) {
            List<DynamicProperty> dynamicProperty = objContent.get(0).getPropSet();
            if (dynamicProperty != null && dynamicProperty.size() > 0) {
                DynamicProperty dp = dynamicProperty.get(0);
                propertyValue = dp.getVal();
                /*
                 * If object is ArrayOfXXX object, then get the XXX[] by
                 * invoking getXXX() on the object.
                 * For Ex:
                 * ArrayOfManagedObjectReference.getManagedObjectReference()
 
View Full Code Here

      for(ObjectContent oc : ocs) {
        if(oc.getPropSet().get(0).getVal().equals(poolUuid))
          return oc.getObj();

        if(oc.getPropSet().size() > 1) {
          DynamicProperty prop = oc.getPropSet().get(1);
          if(prop != null && prop.getVal() != null) {
            if(prop.getVal() instanceof CustomFieldStringValue) {
              String val = ((CustomFieldStringValue)prop.getVal()).getValue();
              if(val.equalsIgnoreCase(poolUuid)) {

                  if(s_logger.isTraceEnabled())
                  s_logger.trace("vCenter API trace - findDatastore() done(successfully)");
                return oc.getObj();
View Full Code Here

  public static VirtualMachineMO findVmFromObjectContent(VmwareContext context,
    ObjectContent[] ocs, String name) {
   
    if(ocs != null && ocs.length > 0) {
      for(ObjectContent oc : ocs) {
        DynamicProperty prop = oc.getPropSet(0);
        assert(prop != null);
        if(prop.getVal().toString().equals(name))
          return new VirtualMachineMO(context, oc.getObj());
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of com.vmware.vim25.DynamicProperty

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.