ucar.unidata.data.profiler
Class EOLProfilerDataSource

java.lang.Object
  extended by ucar.unidata.collab.SharableImpl
      extended by ucar.unidata.data.DataSourceImpl
          extended by ucar.unidata.data.profiler.EOLProfilerDataSource
All Implemented Interfaces:
Sharable, DataSource, DataSourceFactory, XmlPersistable

public class EOLProfilerDataSource
extends DataSourceImpl

A data source for EOL profiler data

Version:
$Revision: 1.4 $
Author:
Unidata Development Team

Field Summary
 
Fields 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
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_TITLE
 
Constructor Summary
EOLProfilerDataSource()
          No argument XML persistence constructor
EOLProfilerDataSource(DataSourceDescriptor descriptor, String source, Hashtable properties)
          Create a new EOLProfilerDataSource
 
Method Summary
 boolean applyProperties()
          Apply properties components
 void doMakeDataChoices()
          Called by DataSourceImpl to make the actual DataChoice(s) and add them to a list of Datachoices; the DataSourceImpl then checks to see if any derived datachoices are possible to derive from these, and shows them if so.
 boolean equals(Object o)
          Check to see if this EOLProfilerDataSource is equal to the object in question.
protected  Data getDataInner(DataChoice dataChoice, DataCategory category, DataSelection dataSelection, Hashtable requestProperties)
          Actually get the data identified by the given DataChoce.
 String getFileNameOrUrl()
          Get the FileNameOrUrl property.
protected  List getLocationsForPolling()
          Get the location where we poll.
 void getPropertiesComponents(List comps)
          Add the gui components into the list for the properties dialog
 int hashCode()
          Return the hashcode for this object
 void initAfterUnpersistence()
          Extends method in DataSourceImpl to call local initProfiler ()
static void main(String[] args)
          Test by running "java ucar.unidata.data.profiler.EOLProfilerDataSource "
 void newFileFromPolling(File f)
          If we are polling some directory this method gets called when there is a new file.
 void setFileNameOrUrl(String value)
          Set the FileNameOrUrl property.
 
Methods inherited from class ucar.unidata.data.DataSourceImpl
addActions, addDataChangeListener, addDataChoice, addPropertiesTabs, applyFieldMask, beginWritingDataToLocalDisk, canCacheDataToDisk, canChangeData, canDoFieldMask, canDoGeoSelection, canDoGeoSelectionMap, canDoGeoSelectionStride, canPoll, canSaveDataToLocalDisk, canShowParameter, checkForInitAfterUnPersistence, clearCachedData, clearFileCache, clearTimes, convertToFilesIfDirectory, createAutoDisplay, createCacheKey, createElement, decrOutstandingGetDataCalls, doDirectory, doMakeDateTimes, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSelectionPanel, doMakeGeoSubsetPropertiesComponent, doRemove, endWritingDataToLocalDisk, expandIfNeeded, findDataChoice, findDataChoices, flushCache, getAbsoluteDateTimes, getActions, getAlias, getAllDateTimes, getAllDateTimes, getAllLevels, getAllLevels, getCache, getCacheClearDelay, getCacheDataToDisk, getCompositeDataChoices, getData, getData, getDataCachePath, getDataChangeListeners, getDataChoices, getDataContext, getDataInner, getDataIsEditable, getDataPaths, getDataPrefix, getDataSelection, getDataSelectionComponents, getDataSource, getDateTimes, getDateTimeSelection, getDescription, getDescriptor, getErrorMessage, getExtraGeoSelectionComponent, getFileFilterForPolling, getFullDescription, getid, getInError, getLocalDirectory, getLocationForPolling, getMostRecentFiles, getName, getNameForDataSource, getNeedToShowErrorToUser, getNextId, getOutstandingGetDataCalls, getPartialDescription, getPassword, getPathsThatCanBeRelative, getPollingInfo, getProperties, 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, initDataChoice, initDataSelectionComponents, initFromXml, isPolling, loadFieldMask, loadFieldMask, loadLatestFile, logException, logException, makeDerivedDataChoices, makeSaveLocalActions, newFilesFromPolling, notifyDataChange, propertiesChanged, putCache, reloadData, removeCache, removeDataChangeListener, removeDataChoice, removeProperty, replaceDataChoice, resetTmpState, saveDataToLocalDisk, saveDataToLocalDisk, saveDataToLocalDisk, setAlias, setAskToUpdate, setCacheClearDelay, setCacheDataToDisk, setDataEditableStrings, setDataIsEditable, setDataIsRelative, setDataRelativeStrings, setDataSelection, setDateTimeSelection, setDescription, setDescriptor, setDirectory, setInError, setInError, setInError, setName, setNewFiles, setObjectProperties, setObjectProperty, setPassword, setPollingInfo, setPollLocation, setProperties, setProperty, setProperty, setRelativePaths, setTemplateName, setTmpPaths, setUserName, 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, getSharablePropertiesComponent, getShareGroup, getSharing, getUniqueId, initSharable, receiveShareData, removeSharable, setShareGroup, setSharing, setUniqueId, showSharableDialog
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.unidata.data.DataSource
getUniqueId
 

Constructor Detail

EOLProfilerDataSource

public EOLProfilerDataSource()
                      throws VisADException
No argument XML persistence constructor

Throws:
VisADException - problem in VisAD

EOLProfilerDataSource

public EOLProfilerDataSource(DataSourceDescriptor descriptor,
                             String source,
                             Hashtable properties)
                      throws VisADException
Create a new EOLProfilerDataSource

Parameters:
descriptor - description of source
source - source of the data
properties - extra properties
Throws:
VisADException - problem accessing data
Method Detail

initAfterUnpersistence

public void initAfterUnpersistence()
Extends method in DataSourceImpl to call local initProfiler ()

Specified by:
initAfterUnpersistence in interface DataSource
Overrides:
initAfterUnpersistence in class DataSourceImpl

newFileFromPolling

public void newFileFromPolling(File f)
If we are polling some directory this method gets called when there is a new file. We set the file name, clear our state, reload the metadata and tell listeners of the change.

Overrides:
newFileFromPolling in class DataSourceImpl
Parameters:
f - new File to use.

getLocationsForPolling

protected List getLocationsForPolling()
Get the location where we poll.

Overrides:
getLocationsForPolling in class DataSourceImpl
Returns:
File to poll on.

doMakeDataChoices

public void doMakeDataChoices()
Called by DataSourceImpl to make the actual DataChoice(s) and add them to a list of Datachoices; the DataSourceImpl then checks to see if any derived datachoices are possible to derive from these, and shows them if so. Used data supplied in the constructor.

Overrides:
doMakeDataChoices in class DataSourceImpl

getDataInner

protected Data getDataInner(DataChoice dataChoice,
                            DataCategory category,
                            DataSelection dataSelection,
                            Hashtable requestProperties)
                     throws VisADException,
                            RemoteException
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 visad.Data object
Throws:
RemoteException - Java RMI problem
VisADException - VisAD problem

equals

public boolean equals(Object o)
Check to see if this EOLProfilerDataSource is equal to the object in question.

Overrides:
equals in class DataSourceImpl
Parameters:
o - object in question
Returns:
true if they are the same or equivalent objects

hashCode

public int hashCode()
Return the hashcode for this object

Overrides:
hashCode in class Object
Returns:
hashCode

main

public static void main(String[] args)
                 throws Exception
Test by running "java ucar.unidata.data.profiler.EOLProfilerDataSource "

Parameters:
args - filename
Throws:
Exception - problem running this

setFileNameOrUrl

public void setFileNameOrUrl(String value)
Set the FileNameOrUrl property.

Parameters:
value - The new value for FileNameOrUrl

getFileNameOrUrl

public String getFileNameOrUrl()
Get the FileNameOrUrl property.

Returns:
The FileNameOrUrl

getPropertiesComponents

public void getPropertiesComponents(List comps)
Add the gui components into the list for the properties dialog

Overrides:
getPropertiesComponents in class DataSourceImpl
Parameters:
comps - List of components

applyProperties

public boolean applyProperties()
Apply properties components

Overrides:
applyProperties in class DataSourceImpl
Returns:
false if something failed and we need to keep showing the dialog