Class ManagedObject

java.lang.Object
com.vmware.vim25.mo.ManagedObject
Direct Known Subclasses:
AlarmManager, AuthorizationManager, CertificateManager, CryptoManager, CustomFieldsManager, CustomizationSpecManager, DatastoreNamespaceManager, DiagnosticManager, DirectPathProfileManager, DistributedVirtualSwitchManager, EnvironmentBrowser, EventManager, ExtensibleManagedObject, ExtensionManager, FailoverClusterConfigurator, FailoverClusterManager, FileManager, GuestAliasManager, GuestAuthManager, GuestFileManager, GuestOperationsManager, GuestProcessManager, GuestWindowsRegistryManager, HealthUpdateManager, HistoryCollector, HostAccessManager, HostAssignableHardwareManager, HostAuthenticationManager, HostAuthenticationStore, HostAutoStartManager, HostBootDeviceSystem, HostCacheConfigurationManager, HostCertificateManager, HostDatastoreBrowser, HostDatastoreSystem, HostDateTimeSystem, HostDiagnosticSystem, HostEsxAgentHostManager, HostFirmwareSystem, HostHealthStatusSystem, HostImageConfigManager, HostKernelModuleSystem, HostLocalAccountManager, HostNvdimmSystem, HostPatchManager, HostPowerSystem, HostSnmpSystem, HostSpecificationManager, HostVFlashManager, HostVsanInternalSystem, HostVsanSystem, HttpNfcLease, IoFilterManager, IpPoolManager, IscsiManager, LicenseAssignmentManager, LicenseManager, LocalizationManager, MessageBusProxy, OptionManager, OverheadMemoryManager, OvfManager, PerformanceManager, Profile, ProfileComplianceManager, ProfileManager, PropertyCollector, PropertyFilter, ResourcePlanningManager, ScheduledTaskManager, SearchIndex, ServiceInstance, ServiceManager, SessionManager, SimpleCommand, SiteInfoManager, StorageQueryManager, StorageResourceManager, TaskManager, TenantTenantManager, UserDirectory, View, ViewManager, VirtualDiskManager, VirtualizationManager, VirtualMachineCompatibilityChecker, VirtualMachineGuestCustomizationManager, VirtualMachineProvisioningChecker, VsanUpgradeSystem, VStorageObjectManagerBase

public abstract class ManagedObject extends Object
This class is intended to provide a wrapper around a managed object class. The abstraction will hide the web service details and make the managed objects OO style in the client side programming. Every managed object class can inherit from this and take advantage of this abstraction.
  • Constructor Details

    • ManagedObject

      protected ManagedObject()
    • ManagedObject

      public ManagedObject(ServerConnection serverConnection, ManagedObjectReference mor)
      Constructor that reuse exiting web service connection Use this constructor when you can re-use existing web service connection.
      Parameters:
      serverConnection -
      mor -
  • Method Details

    • setMOR

      protected void setMOR(ManagedObjectReference mor)
      Set the ManagedObjectReference object pointing to the managed object
    • getMOR

      public ManagedObjectReference getMOR()
      get the ManagedObjectReference object pointing to the managed object
      Returns:
    • getVimService

      protected VimPortType getVimService()
      Get the web service
      Returns:
    • getServerConnection

      public ServerConnection getServerConnection()
    • setServerConnection

      protected void setServerConnection(ServerConnection sc)
      Set up the ServerConnection, only when it hasn't been set yet.
      Parameters:
      sc -
    • retrieveObjectProperties

      protected ObjectContent retrieveObjectProperties(String[] properties)
    • setCachedProperty

      public void setCachedProperty(String propertyName, Object value)
      Pre-populate this object's property cache with a value the caller already fetched (for example, from an InventoryNavigator bulk read). A subsequent getCurrentProperty(String) for the same name returns the cached value without contacting the server. The cache is opt-in: callers who never call this method incur no overhead and see the original always-round-trip behavior. Cached values do not expire — long-lived entities will return stale data if the underlying property changes on the server.
    • getCurrentProperty

      protected Object getCurrentProperty(String propertyName)
    • getPropertyByPath

      public Object getPropertyByPath(String propPath)
    • getPropertiesByPaths

      public Hashtable<String,Object> getPropertiesByPaths(String[] propPaths) throws InvalidProperty, RuntimeFault, RemoteException
      Get multiple properties by their paths
      Parameters:
      propPaths - an array of strings for property path
      Returns:
      a Hashtable holding with the property path as key, and the value.
      Throws:
      InvalidProperty
      RuntimeFault
      RemoteException
    • getManagedObjects

      protected ManagedObject[] getManagedObjects(String propName, boolean mixedType)
    • getManagedObjects

      protected ManagedObject[] getManagedObjects(String propName)
    • getDatastores

      protected Datastore[] getDatastores(String propName)
    • getNetworks

      protected Network[] getNetworks(String propName)
    • getVms

      protected VirtualMachine[] getVms(String propName)
    • getFilter

      protected PropertyFilter[] getFilter(String propName)
    • getResourcePools

      protected ResourcePool[] getResourcePools(String propName)
    • getTasks

      protected Task[] getTasks(String propName)
    • getScheduledTasks

      protected ScheduledTask[] getScheduledTasks(String propName)
    • getViews

      protected View[] getViews(String propName)
    • getHosts

      protected HostSystem[] getHosts(String propName)
    • getManagedObject

      protected ManagedObject getManagedObject(String propName)
    • waitForValues

      protected Object[] waitForValues(String[] filterProps, String[] endWaitProps, Object[][] expectedVals) throws InvalidProperty, RuntimeFault, RemoteException
      Handle Updates for a single object. waits till expected values of properties to check are reached Destroys the ObjectFilter when done.
      Parameters:
      filterProps - Properties list to filter
      endWaitProps - Properties list to check for expected values these be properties of a property in the filter properties list
      expectedVals - values for properties to end the wait
      Returns:
      true indicating expected values were met, and false otherwise
      Throws:
      RemoteException
      RuntimeFault
      InvalidProperty
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • convertMors

      protected ManagedObjectReference[] convertMors(ManagedObject[] mos)