Class PropertyCollectorUtil

java.lang.Object
com.vmware.vim25.mo.util.PropertyCollectorUtil

public class PropertyCollectorUtil extends Object
Utility class for the PropertyCollector API.
  • Field Details

    • NULL

      public static final Object NULL
  • Constructor Details

    • PropertyCollectorUtil

      public PropertyCollectorUtil()
  • Method Details

    • retrieveProperties

      public static Hashtable<String,Object>[] retrieveProperties(ManagedObject[] mos, String moType, String[] propPaths) throws InvalidProperty, RuntimeFault, RemoteException
      Retrieves properties from multiple managed objects.
      Parameters:
      mos - the array of managed objects which could be of single type or mixed types. When they are mix-typed, the moType must be super type of all these managed objects.
      moType - the type of the managed object. This managed object type must have all the properties defined as in propPaths.
      propPaths - the array of property path which has dot as separator, for example, "name", "guest.toolsStatus".
      Returns:
      an array of Hashtable whose order is the same as the mos array. Each Hashtable has the properties for one managed object. Note: some of the properties you want to retrieve might not be set, and therefore you don't have an entry in the Hashtable at all. In other words, it's possible for you to get null for a property from the resulted Hashtable.
      Throws:
      InvalidProperty
      RuntimeFault
      RemoteException
    • getPropertyCollector

      protected static PropertyCollector getPropertyCollector(ManagedObject mo)
    • convertProperty

      public static Object convertProperty(Object dynaPropVal)
      Method to convert an object to its type For example when ArrayOfManagedObject is passed in return a ManagedObject[]
      Parameters:
      dynaPropVal -
      Returns:
    • creatObjectSpec

      public static ObjectSpec creatObjectSpec(ManagedObjectReference mor, boolean skip, SelectionSpec[] selSet)
    • createPropertySpec

      public static PropertySpec createPropertySpec(String type, boolean allProp, String[] pathSet)
    • createSelectionSpec

      public static SelectionSpec[] createSelectionSpec(String[] names)
    • createTraversalSpec

      public static TraversalSpec createTraversalSpec(String name, String type, String path, String[] selectPath)
    • createTraversalSpec

      public static TraversalSpec createTraversalSpec(String name, String type, String path, SelectionSpec[] selectSet)
    • buildPropertySpecArray

      public static PropertySpec[] buildPropertySpecArray(String[][] typeProplists)
      This code takes an array of [typename, property, property, ...] and converts it into a PropertySpec[].
      Parameters:
      typeProplists - 2D array of type and properties to retrieve
      Returns:
      Array of container filter specs
    • buildFullTraversal

      public static SelectionSpec[] buildFullTraversal()
      This method creates a SelectionSpec[] to traverses the entire inventory tree starting at a Folder NOTE: This full traversal is based on VC2/ESX3 inventory structure. It does not search new ManagedEntities like Network, DVS, etc. If you want a full traversal with VC4/ESX4, use buildFullTraversalV4().
      Returns:
      The SelectionSpec[]
    • buildFullTraversalV4

      public static SelectionSpec[] buildFullTraversalV4()
      This method creates a SelectionSpec[] to traverses the entire inventory tree starting at a Folder
      Returns:
      The SelectionSpec[]