com.vmware.vim25.mo.util
Class PropertyCollectorUtil

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

public class PropertyCollectorUtil
extends Object

Utility class for the PropertyCollector API.

Author:
Steve JIN (sjin@vmware.com)

Field Summary
static Object NULL
           
 
Constructor Summary
PropertyCollectorUtil()
           
 
Method Summary
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.
static SelectionSpec[] buildFullTraversalV4()
          This method creates a SelectionSpec[] to traverses the entire inventory tree starting at a Folder
static PropertySpec[] buildPropertySpecArray(String[][] typeProplists)
          This code takes an array of [typename, property, property, ...] and converts it into a PropertySpec[].
static Object convertProperty(Object dynaPropVal)
           
static PropertySpec createPropertySpec(String type, boolean allProp, String[] pathSet)
           
static SelectionSpec[] createSelectionSpec(String[] names)
           
static TraversalSpec createTraversalSpec(String name, String type, String path, SelectionSpec[] selectSet)
           
static TraversalSpec createTraversalSpec(String name, String type, String path, String[] selectPath)
           
static ObjectSpec creatObjectSpec(ManagedObjectReference mor, boolean skip, SelectionSpec[] selSet)
           
static Hashtable[] retrieveProperties(ManagedObject[] mos, String moType, String[] propPaths)
          Retrieves properties from multiple managed objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final Object NULL
Constructor Detail

PropertyCollectorUtil

public PropertyCollectorUtil()
Method Detail

retrieveProperties

public static Hashtable[] 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

convertProperty

public static Object convertProperty(Object dynaPropVal)

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[]


Copyright © 2011-2012. All Rights Reserved.