Class CacheDataSource

All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class CacheDataSource extends DataSourceImpl
Used to cache a data choice and its data
Version:
$Revision: 1.12 $
Author:
IDV development team
  • Field Details

  • Constructor Details

    • CacheDataSource

      public CacheDataSource()
      Default bean constructor; does nothing
    • CacheDataSource

      public CacheDataSource(DataSourceDescriptor descriptor, String name, Hashtable properties)
      Create a CacheDataSource
      Parameters:
      descriptor - the datasource descriptor
      name - my name
      properties - my properties
  • Method Details

    • addActions

      protected void addActions(List actions)
      add menu actions
      Overrides:
      addActions in class DataSourceImpl
      Parameters:
      actions - list of actions
    • writeIser

      public void writeIser()
      write out the iser file
    • addDataChoice

      public void addDataChoice(DataChoice dataChoice, String name, Data data)
      Add a data choice into the list with the given name. If data is non-null then cache it
      Parameters:
      dataChoice - The datachoice
      name - The name
      data - The data to cache
    • addDataChoice

      public void addDataChoice(DataChoice dataChoice, String name, Data data, DataSelection dataSelection)
      add the data choice
      Parameters:
      dataChoice - data choice
      name - name
      data - the data
      dataSelection - data selection
    • clearCachedData

      public void clearCachedData()
      clear the cache
      Specified by:
      clearCachedData in interface DataSource
      Overrides:
      clearCachedData in class DataSourceImpl
    • putCache

      public void putCache(Object key, Object value)
      Put the cache
      Overrides:
      putCache in class DataSourceImpl
      Parameters:
      key - key
      value - value
    • getCache

      public Object getCache(Object key)
      Get an Object from the cache.
      Overrides:
      getCache in class DataSourceImpl
      Parameters:
      key - key for the object
      Returns:
      the key value, or null
    • removeCache

      public void removeCache(Object key)
      Remove an Object from the cache.
      Overrides:
      removeCache in class DataSourceImpl
      Parameters:
      key - key for the object
    • getDataInner

      protected Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) throws VisADException, RemoteException
      Description copied from class: DataSourceImpl
      Actually get the data identified by the given DataChoce. The default is to call the getDataInner that does not take the requestProperties. This allows other, non unidata.data DataSource-s (that follow the old API) to work.
      Overrides:
      getDataInner in class DataSourceImpl
      Parameters:
      dataChoice - The data choice that identifies the requested data.
      category - The data category of the request.
      dataSelection - Identifies any subsetting of the data.
      requestProperties - Hashtable that holds any detailed request properties.
      Returns:
      The data
      Throws:
      RemoteException - Java RMI problem
      VisADException - VisAD problem
    • getDataChoices

      public List getDataChoices()
      Get the DataChoices.
      Specified by:
      getDataChoices in interface DataSource
      Overrides:
      getDataChoices in class DataSourceImpl
      Returns:
      List of DataChoices.
    • setHolders

      public void setHolders(List value)
      Set the Holders property.
      Parameters:
      value - The new value for Holders
    • getHolders

      public List getHolders()
      Get the Holders property.
      Returns:
      The Holders