Class PropertyCollector


  • @Sample(name="property-collector",
            description="This sample illustrates the property collector features added in version 4.1")
    public class PropertyCollector
    extends ConnectedVimServiceBase
     PropertyCollector
    
     This sample illustrates the property collector features added in version 4.1
    
     Parameters:
     url            [required] : url of the web service.");
     username       [required] : username for the authentication");
     password       [required] : password for the authentication");
     extension      [required] : Extension to be demonstrated [retrieveproperties |
                                 updates | filterspec | propertycollector]
     vmname         [optional] : Name of the virtual machine
     maxobjects     [optional] : The maximum number of ObjectContent data objects
                                 that should be returned in a single result
     updatetype     [optional] : waitforupdates | checkforupdates| extension
     nooftasks      [optional] : Number of tasks to be created
    
     Command Line:
     Retrieve Properties Extension
     run.bat com.vmware.general.PropertyCollector --url [webserviceurl]
     --username [username] --password [password] --extension retrieveproperties
     --maxobjects  [maxobjects]
    
     Updates Extension
     run.bat com.vmware.general.PropertyCollector --url [webserviceurl]
     --username [username] --password [password] --extension updates
     --vmname [vm name] --updatetype  [waitforupdates | checkforupdates| extension]
    
     Filter Spec Extension
     run.bat com.vmware.general.PropertyCollector --url [webserviceurl]
     --username [username] --password [password] --extension filterspec
     --vmname [vm name] --noofTasks  [Number of tasks to be created]
    
     Property Collector Extension
     run.bat com.vmware.general.PropertyCollector --url [webserviceurl]
     --username [username] --password [password] --extension propertycollector
     
    • Constructor Detail

      • PropertyCollector

        public PropertyCollector()
    • Method Detail

      • setExtension

        @Option(name="extension",
                description="Extension to be demonstrated [retrieveproperties | updates | filterspec | propertycollector]")
        public void setExtension​(java.lang.String extension)
      • setVmName

        @Option(name="vmname",
                required=false,
                description="Name of the virtual machine")
        public void setVmName​(java.lang.String vmName)
      • setMaxObjects

        @Option(name="maxobjects",
                required=false,
                description="The maximum number of ObjectContent data objects that should be returned in a single result")
        public void setMaxObjects​(java.lang.String maxObjects)
      • setUpdateType

        @Option(name="updatetype",
                required=false,
                description="waitforupdates | checkforupdates| extension")
        public void setUpdateType​(java.lang.String updateType)
      • setNoofTasks

        @Option(name="nooftasks",
                required=false,
                description="Number of tasks to be created")
        public void setNoofTasks​(java.lang.String noofTasks)
      • getInputParameters

        public void getInputParameters​(java.lang.String[] args)
                                throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • validate

        public void validate()
      • doOperations

        public void doOperations()
                          throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                 com.vmware.vim25.InvalidPropertyFaultMsg,
                                 com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                                 com.vmware.vim25.DuplicateNameFaultMsg,
                                 com.vmware.vim25.TaskInProgressFaultMsg,
                                 com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
                                 com.vmware.vim25.VmConfigFaultFaultMsg,
                                 com.vmware.vim25.InvalidDatastoreFaultMsg,
                                 com.vmware.vim25.FileFaultFaultMsg,
                                 com.vmware.vim25.ConcurrentAccessFaultMsg,
                                 com.vmware.vim25.InvalidStateFaultMsg,
                                 com.vmware.vim25.InvalidNameFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.InvalidDatastoreFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        com.vmware.vim25.ConcurrentAccessFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg
      • callCreatePropertyCollectorEx

        public void callCreatePropertyCollectorEx()
                                           throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                                  com.vmware.vim25.InvalidPropertyFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
      • callCreateFilterSpecEx

        public void callCreateFilterSpecEx​(java.util.List<com.vmware.vim25.ManagedObjectReference> taskArr,
                                           java.util.List<java.lang.String> filterProps)
                                    throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                           com.vmware.vim25.InvalidPropertyFaultMsg,
                                           com.vmware.vim25.InvalidCollectorVersionFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
      • createTasks

        public java.util.List<com.vmware.vim25.ManagedObjectReference> createTasks​(int taskLength)
                                                                            throws com.vmware.vim25.DuplicateNameFaultMsg,
                                                                                   com.vmware.vim25.RuntimeFaultFaultMsg,
                                                                                   com.vmware.vim25.TaskInProgressFaultMsg,
                                                                                   com.vmware.vim25.VmConfigFaultFaultMsg,
                                                                                   com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
                                                                                   com.vmware.vim25.InvalidDatastoreFaultMsg,
                                                                                   com.vmware.vim25.FileFaultFaultMsg,
                                                                                   com.vmware.vim25.ConcurrentAccessFaultMsg,
                                                                                   com.vmware.vim25.InvalidStateFaultMsg,
                                                                                   com.vmware.vim25.InvalidNameFaultMsg,
                                                                                   com.vmware.vim25.InvalidPropertyFaultMsg,
                                                                                   com.vmware.vim25.InvalidCollectorVersionFaultMsg
        Throws:
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        com.vmware.vim25.InvalidDatastoreFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        com.vmware.vim25.ConcurrentAccessFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
      • callWaitForUpdatesEx

        public void callWaitForUpdatesEx​(java.lang.String maxWaitSeconds,
                                         java.lang.String maxOjectUpdates)
                                  throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                         com.vmware.vim25.InvalidPropertyFaultMsg,
                                         com.vmware.vim25.InvalidCollectorVersionFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
      • callRetrievePropertiesEx

        public void callRetrievePropertiesEx​(java.lang.String maxObjs)
                                      throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                             com.vmware.vim25.InvalidPropertyFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
      • callContinueRetrieveProperties

        public void callContinueRetrieveProperties​(java.lang.String token)
                                            throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                                   com.vmware.vim25.InvalidPropertyFaultMsg
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
      • handleUpdate

        public void handleUpdate​(com.vmware.vim25.UpdateSet update)
      • handleObjectUpdate

        public void handleObjectUpdate​(com.vmware.vim25.ObjectUpdate oUpdate)
      • handleChanges

        public void handleChanges​(java.util.List<com.vmware.vim25.PropertyChange> changes)
      • buildFullTraversal

        public java.util.List<com.vmware.vim25.SelectionSpec> buildFullTraversal()
      • getSelectionSpec

        public com.vmware.vim25.SelectionSpec getSelectionSpec​(java.lang.String name)
      • retrievePropertiesAllObjects

        public java.util.List<com.vmware.vim25.ObjectContent> retrievePropertiesAllObjects​(java.util.List<com.vmware.vim25.PropertyFilterSpec> listpfs)
                                                                                    throws com.vmware.vim25.RuntimeFaultFaultMsg,
                                                                                           com.vmware.vim25.InvalidPropertyFaultMsg
        Uses the new RetrievePropertiesEx method to emulate the now deprecated RetrieveProperties method.
        Parameters:
        listpfs -
        Returns:
        list of object content
        Throws:
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
      • buildPropertySpecArray

        public java.util.List<com.vmware.vim25.PropertySpec> buildPropertySpecArray​(java.lang.String[][] typeinfo)
      • getTaskResultAfterDone

        public boolean getTaskResultAfterDone​(com.vmware.vim25.ManagedObjectReference task)
                                       throws com.vmware.vim25.InvalidPropertyFaultMsg,
                                              com.vmware.vim25.RuntimeFaultFaultMsg,
                                              com.vmware.vim25.InvalidCollectorVersionFaultMsg
        This method returns a boolean value specifying whether the Task is succeeded or failed.
        Parameters:
        task - ManagedObjectReference representing the Task.
        Returns:
        boolean value representing the Task result.
        Throws:
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
      • main

        @Action
        public void main()
                  throws com.vmware.vim25.DuplicateNameFaultMsg,
                         com.vmware.vim25.RuntimeFaultFaultMsg,
                         com.vmware.vim25.TaskInProgressFaultMsg,
                         com.vmware.vim25.VmConfigFaultFaultMsg,
                         com.vmware.vim25.InsufficientResourcesFaultFaultMsg,
                         com.vmware.vim25.InvalidDatastoreFaultMsg,
                         com.vmware.vim25.InvalidPropertyFaultMsg,
                         com.vmware.vim25.FileFaultFaultMsg,
                         com.vmware.vim25.ConcurrentAccessFaultMsg,
                         com.vmware.vim25.InvalidStateFaultMsg,
                         com.vmware.vim25.InvalidCollectorVersionFaultMsg,
                         com.vmware.vim25.InvalidNameFaultMsg
        Throws:
        com.vmware.vim25.DuplicateNameFaultMsg
        com.vmware.vim25.RuntimeFaultFaultMsg
        com.vmware.vim25.TaskInProgressFaultMsg
        com.vmware.vim25.VmConfigFaultFaultMsg
        com.vmware.vim25.InsufficientResourcesFaultFaultMsg
        com.vmware.vim25.InvalidDatastoreFaultMsg
        com.vmware.vim25.InvalidPropertyFaultMsg
        com.vmware.vim25.FileFaultFaultMsg
        com.vmware.vim25.ConcurrentAccessFaultMsg
        com.vmware.vim25.InvalidStateFaultMsg
        com.vmware.vim25.InvalidCollectorVersionFaultMsg
        com.vmware.vim25.InvalidNameFaultMsg