com.vmware.vim.cf
Class CacheInstance

java.lang.Object
  extended by com.vmware.vim.cf.CacheInstance

public class CacheInstance
extends Object

Author:
Steve JIN (sjin@vmware.com)

Constructor Summary
CacheInstance(ServiceInstance si)
           
 
Method Summary
 void destroy()
          Destrory the caching service when no longer needed.
 Object get(ManagedObjectReference mor, String propName)
          Get the value of cached property whose name is propName.
 Object get(ManagedObject mo, String propName)
          Get the value of cached property whose name is propName.
 Object getCopy(ManagedObjectReference mor, String propName)
          Get a copy of the cached property.
 Object getCopy(ManagedObject mo, String propName)
          Get a copy of the cached property.
 ServiceInstance getServiceInstance()
          Get the corresponding ServiceInstance
 boolean isReady()
          Check if the CacheInstance is ready for retrieval
 void start()
          Start the caching service.
 void watch(ManagedObject[] mos, String[] props)
          Add the managed objects and their properties to be watched.
 void watch(PropertyFilterSpec pfs)
          Add PropertyFilterSpec for advanced settings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheInstance

public CacheInstance(ServiceInstance si)
Method Detail

watch

public void watch(ManagedObject[] mos,
                  String[] props)
Add the managed objects and their properties to be watched.

Parameters:
mos - array of managed objects.
props - array of properties to watch

watch

public void watch(PropertyFilterSpec pfs)
Add PropertyFilterSpec for advanced settings

Parameters:
pfs - the property filter spec which specifies the managed objects and properties to watch.

getCopy

public Object getCopy(ManagedObject mo,
                      String propName)
Get a copy of the cached property. You can change the returned object as you like

Parameters:
mo - Managed object
propName - property name
Returns:
the data object identified by the propName. NullObject.NULL if the data object is really null

getCopy

public Object getCopy(ManagedObjectReference mor,
                      String propName)
Get a copy of the cached property. You can change the returned object as you like

Parameters:
mor - Managed object reference
propName - property name
Returns:
the data object identified by the propName. NullObject.NULL if the data object is really null

get

public Object get(ManagedObject mo,
                  String propName)
Get the value of cached property whose name is propName. You should NEVER change the returned data object.

Parameters:
mo - Managed object on which the cached property is requested
propName - Property name, can include "."
Returns:
the data object identified by the propName. NullObject.NULL if the data object is really null

get

public Object get(ManagedObjectReference mor,
                  String propName)
Get the value of cached property whose name is propName. You should NEVER change the returned data object.

Parameters:
mor - Managed object reference pointing to the managed object
propName - Property name
Returns:
the data object identified by the propName. NullObject.NULL if the data object is really null

start

public void start()
Start the caching service. Called after specifying the managed objects and their properties to watch.


destroy

public void destroy()
Destrory the caching service when no longer needed.


getServiceInstance

public ServiceInstance getServiceInstance()
Get the corresponding ServiceInstance

Returns:
ServiceInstance object

isReady

public boolean isReady()
Check if the CacheInstance is ready for retrieval

Returns:
true if ready; false otherwise


Copyright © 2011-2012. All Rights Reserved.