Package ucar.unidata.data
Class CacheDataSource
java.lang.Object
ucar.unidata.collab.SharableImpl
ucar.unidata.data.DataSourceImpl
ucar.unidata.data.CacheDataSource
- All Implemented Interfaces:
Sharable
,DataSource
,DataSourceFactory
,XmlPersistable
Used to cache a data choice and its data
- Version:
- $Revision: 1.12 $
- Author:
- IDV development team
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Class DataChoiceHolder holds a data chocie and a unique id and a name -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
data propertystatic final String
datachoice propertyFields inherited from class ucar.unidata.data.DataSourceImpl
changeDataPathsCbx, dataCacheKey, dataChoices, geoSelectionPanel, haveBeenUnPersisted, okToContinue, PARAM_SHOW_HIDE, PARAM_SHOW_NO, PARAM_SHOW_YES
Fields inherited from interface ucar.unidata.data.DataSource
DATAPATH_DATE_FORMAT, DATAPATH_DATE_PATTERN, MOST_RECENT, ordinalNames, PROP_AUTOCREATEDISPLAY, PROP_BASEDIRECTORY, PROP_CACHEABLE, PROP_DATACHOICENAME, PROP_DISPLAYPROPERTIES, PROP_DOCUMENTLINKS, PROP_FILEPATTERN, PROP_GEOLOCATION, PROP_ICON, PROP_NAME, PROP_POLLINFO, PROP_RESOLVERURL, PROP_SERVICE_HTTP, PROP_SUBPROPERTIES, PROP_TIMELABELS, PROP_TIMESTRIDE, PROP_TITLE
-
Constructor Summary
ConstructorsConstructorDescriptionDefault bean constructor; does nothingCacheDataSource
(DataSourceDescriptor descriptor, String name, Hashtable properties) Create a CacheDataSource -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addActions
(List actions) add menu actionsvoid
addDataChoice
(DataChoice dataChoice, String name, Data data) Add a data choice into the list with the given name.void
addDataChoice
(DataChoice dataChoice, String name, Data data, DataSelection dataSelection) add the data choicevoid
clear the cacheGet an Object from the cache.Get the DataChoices.protected Data
getDataInner
(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties) Actually get the data identified by the given DataChoce.Get the Holders property.void
Put the cachevoid
removeCache
(Object key) Remove an Object from the cache.void
setHolders
(List value) Set the Holders property.void
write out the iser fileMethods inherited from class ucar.unidata.data.DataSourceImpl
addDataChangeListener, addDataChoice, addPropertiesTabs, addReloadTab, applyFieldMask, applyProperties, beginWritingDataToLocalDisk, canAddCurrentName, canCacheDataToDisk, canChangeData, canDoAllLevels, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearFileCache, clearTimes, convertSourceFile, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDataChoices, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, doRemove, endWritingDataToLocalDisk, equals, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getAllTimesForTimeDriver, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataContext, getDataInner, getDataIsEditable, getDataPaths, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDefaultSave, getDescription, getDescriptor, getErrorMessage, getEverChangedName, getExtraGeoSelectionComponent, getExtraTimesComponent, getFileFilterForPolling, getFullDescription, getid, getIdv, getInError, getLocalDirectory, getLocationForPolling, getLocationsForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPartialDescription, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, getPropertiesComponents, getPropertiesHeader, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getProperty, getRelativePaths, getSampleDataProjection, getSaveDataFileLabel, getSelectedDateTimes, getSelectedDateTimes, getTimesFromDataSelection, getTmpPaths, getTypeName, getUserName, handlePropertiesAction, hasPollingInfo, holdsDateTimes, holdsIndices, identifiedBy, identifiedByName, incrOutstandingGetDataCalls, initAfter, initAfterCreation, initAfterUnpersistence, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFileFromPolling, newFilesFromPolling, notifyDataChange, propertiesChanged, putCache, reloadData, reloadData, reloadProperties, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, saveDataToLocalDisk, selectTimesFromList, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDefaultSave, setDescription, setDescriptor, setDirectory, setEverChangedName, setInError, setInError, setInError, setName, setNewFiles, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, shouldCache, shouldCache, showPasswordDialog, showPropertiesDialog, showPropertiesDialog, showPropertiesDialog, showWaitDialog, tick, toString, toStringTruncated, updateDetailsText, updateState, writeFieldMaskFile, writeFieldMaskFile
Methods inherited from class ucar.unidata.collab.SharableImpl
applySharableProperties, doShare, doShare, doShareExternal, doShareInternal, getReceiveShareTime, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setReceiveShareTime, setShareGroup, setSharing, setUniqueId, showSharableDialog
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ucar.unidata.data.DataSource
getUniqueId
-
Field Details
-
PROP_DATACHOICE
datachoice property- See Also:
-
PROP_DATA
data property- See Also:
-
-
Constructor Details
-
CacheDataSource
public CacheDataSource()Default bean constructor; does nothing -
CacheDataSource
Create a CacheDataSource- Parameters:
descriptor
- the datasource descriptorname
- my nameproperties
- my properties
-
-
Method Details
-
addActions
add menu actions- Overrides:
addActions
in classDataSourceImpl
- Parameters:
actions
- list of actions
-
writeIser
public void writeIser()write out the iser file -
addDataChoice
Add a data choice into the list with the given name. If data is non-null then cache it- Parameters:
dataChoice
- The datachoicename
- The namedata
- The data to cache
-
addDataChoice
public void addDataChoice(DataChoice dataChoice, String name, Data data, DataSelection dataSelection) add the data choice- Parameters:
dataChoice
- data choicename
- namedata
- the datadataSelection
- data selection
-
clearCachedData
public void clearCachedData()clear the cache- Specified by:
clearCachedData
in interfaceDataSource
- Overrides:
clearCachedData
in classDataSourceImpl
-
putCache
Put the cache- Overrides:
putCache
in classDataSourceImpl
- Parameters:
key
- keyvalue
- value
-
getCache
Get an Object from the cache.- Overrides:
getCache
in classDataSourceImpl
- Parameters:
key
- key for the object- Returns:
- the key value, or
null
-
removeCache
Remove an Object from the cache.- Overrides:
removeCache
in classDataSourceImpl
- 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 classDataSourceImpl
- 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 problemVisADException
- VisAD problem
-
getDataChoices
Get the DataChoices.- Specified by:
getDataChoices
in interfaceDataSource
- Overrides:
getDataChoices
in classDataSourceImpl
- Returns:
- List of DataChoices.
-
setHolders
Set the Holders property.- Parameters:
value
- The new value for Holders
-
getHolders
Get the Holders property.- Returns:
- The Holders
-