public class AggregatingDataSourceFactory extends java.lang.Object implements DataSourceFactory
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROB_NO_TIMERANGE_PROVIDED |
static java.lang.String |
PROB_PARSE_ERROR_IN_TIMERANGE |
| Constructor and Description |
|---|
AggregatingDataSourceFactory()
Creates a new instance of AggregatingDataSourceFactory
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getCapability(java.lang.Class<T> clazz)
return additional tools for creating valid URIs, such as TimeSeriesBrowse.
|
java.util.List<CompletionContext> |
getCompletions(CompletionContext cc,
ProgressMonitor mon)
return a list of context-sensitive completions.
|
DataSource |
getDataSource(java.net.URI uri)
return a dataSource for the url
|
static DataSourceFactory |
getDelegateDataSourceFactory(java.lang.String surl) |
static java.lang.String |
getDelegateDataSourceFactoryUri(java.lang.String suri,
ProgressMonitor mon) |
java.lang.String |
getDescription()
return a short description of the factory, or empty string.
|
static FileStorageModel |
getFileStorageModel(java.lang.String suri)
return the FileStorageModel for the URI.
|
static java.lang.String |
getRepresentativeFile(java.net.URI uri,
ProgressMonitor monitor)
return a file from the aggregation, so that it can be inspected externally.
|
protected static boolean |
hasTimeFields(java.lang.String surl) |
boolean |
isFileResource()
true if the data source is based on files.
|
boolean |
reject(java.lang.String surl,
java.util.List<java.lang.String> problems,
ProgressMonitor mon)
quick check to see that an uri looks acceptable.
|
void |
setDelegateDataSourceFactory(DataSourceFactory delegateFactory) |
static int |
splitIndex(java.lang.String surl)
return the index of the agg part of the uri.
|
boolean |
supportsDiscovery()
mark that this source has an editor that allows discovery of data,
and the GUI can be entered with "vap+ext:" This must be consistent
with the reject method of the editor.
|
public static final java.lang.String PROB_NO_TIMERANGE_PROVIDED
public static final java.lang.String PROB_PARSE_ERROR_IN_TIMERANGE
public AggregatingDataSourceFactory()
public static java.lang.String getRepresentativeFile(java.net.URI uri,
ProgressMonitor monitor)
throws java.io.IOException
uri - monitor - java.io.IOExceptionsetDelegateDataSourceFactorypublic DataSource getDataSource(java.net.URI uri) throws java.lang.Exception
DataSourceFactorygetDataSource in interface DataSourceFactoryuri - the URIjava.lang.Exception - any exception may occur.public static int splitIndex(java.lang.String surl)
surl - the URI as a string.public static FileStorageModel getFileStorageModel(java.lang.String suri) throws java.io.IOException
suri - eg. file:/tmp/foo/$Y/$Y$m.datjava.io.IOExceptionwhich splits the static part from the agg part.public static java.lang.String getDelegateDataSourceFactoryUri(java.lang.String suri,
ProgressMonitor mon)
throws java.io.IOException,
java.lang.IllegalArgumentException
suri - the aggregation, containing the template and the timerange parameter.mon - a progress monitor.java.io.IOExceptionjava.lang.IllegalArgumentException - if it is not able to find any data files.public static DataSourceFactory getDelegateDataSourceFactory(java.lang.String surl) throws java.io.IOException, java.lang.IllegalArgumentException, java.net.URISyntaxException
java.io.IOExceptionjava.lang.IllegalArgumentExceptionjava.net.URISyntaxExceptionpublic java.util.List<CompletionContext> getCompletions(CompletionContext cc, ProgressMonitor mon) throws java.lang.Exception
DataSourceFactorygetCompletions in interface DataSourceFactorycc - the context for the completion.mon - a progress monitor, for example to monitor a file download.java.lang.Exceptionprotected static boolean hasTimeFields(java.lang.String surl)
public boolean reject(java.lang.String surl,
java.util.List<java.lang.String> problems,
ProgressMonitor mon)
DataSourceFactoryreject in interface DataSourceFactorysurl - the uri.problems - list to which problems should be added. TODO: human readable or PROB_TIMERANGE?mon - a progress monitor, for example to monitor a file download.public void setDelegateDataSourceFactory(DataSourceFactory delegateFactory)
public <T> T getCapability(java.lang.Class<T> clazz)
DataSourceFactorygetCapability in interface DataSourceFactoryclazz - the class, such as org.autoplot.datasource.capability.TimeSeriesBrowsepublic boolean supportsDiscovery()
DataSourceFactorysupportsDiscovery in interface DataSourceFactorypublic boolean isFileResource()
DataSourceFactoryisFileResource in interface DataSourceFactorypublic java.lang.String getDescription()
DataSourceFactorygetDescription in interface DataSourceFactory