To use PropertyCollector, first build a PropertyFilterSpec to guide the collector's actions on the server.

You pass your PropertyFilterSpec to either the RetrievePropertiesEx method or the CreateFilter method. The latter establishes a persistent filter on the server side for use with the WaitForUpdatesEx method.

A PropertyFilterSpec contains:
  • The name of at least one managed object class from which you want to collect properties. (PropertySpec.type)
  • For each managed object class specified, at least one name of a property to return. (PropertySpec.pathSet).
  • If needed, one or more paths through the inventory hierarchy that the PropertyCollector can traverse to reach the managed objects from which you want to collect properties. (ObjectSpec.selectSet)
  • For each path, a starting managed object reference from which to traverse that path. (ObjectSpec.obj)

If you do not have a starting managed object reference from a prior API call, you can start with the root folder at the base of the inventory hierarchy. The rootFolder reference is available in the ServiceContent data object. For information about getting the ServiceContent, see Overview of a Java Sample Application for the Web Services SDK.