public class DataAccessRegistry extends Object implements Repository
Modifier and Type | Field and Description |
---|---|
protected InterpolationProperties |
properties
Properties for interpolation / configuration settings
|
protected List<DataAccess<FeatureType,Feature>> |
registry
Data Access Resources
|
protected static DataAccessRegistry |
theRegistry
Singleton instance
|
Modifier | Constructor and Description |
---|---|
protected |
DataAccessRegistry()
Sole constructor
|
Modifier and Type | Method and Description |
---|---|
DataAccess<FeatureType,Feature> |
access(Name name)
Search for the DataAccess (may be a DataStore) by name.
|
void |
clearProperties()
Clean-up properties, mainly used for cleaning up after tests
|
DataStore |
dataStore(Name name)
Search for the DataStore by name.
|
void |
disposeAndUnregisterAll()
Dispose and unregister all data accesses in the registry.
|
FeatureSource<FeatureType,Feature> |
featureSource(Name name)
Get a feature source for built features with supplied feature type name.
|
Feature |
findFeature(FeatureId id,
Hints hints) |
static DataAccess<FeatureType,Feature> |
getDataAccess(Name featureTypeName) |
List<DataStore> |
getDataStores()
List of available DataStore instances; these are considered to be live/connected datastores
under the management of the application and should not be closed or otherwise harmed by
client code.
|
static FeatureSource<FeatureType,Feature> |
getFeatureSource(Name featureTypeName)
Get a feature source for built features with supplied feature type name.
|
static DataAccessRegistry |
getInstance()
Public method to get singleton instance to registry.
|
InterpolationProperties |
getProperties()
Get properties
|
boolean |
hasAccessName(Name name)
Return true if a type name is mapped in one of the registered data accesses.
|
boolean |
hasAppSchemaAccessName(Name name)
Return true if a type name is mapped in one of the registered app-schema data accesses.
|
boolean |
hasAppSchemaTargetElement(Name name)
Return true if a type name is mapped in one of the registered app-schema data accesses as
targetElementName, regardless whether or not mappingName exists.
|
static boolean |
hasName(Name featureTypeName)
Return true if a type name is mapped in one of the registered data accesses.
|
FeatureTypeMapping |
mappingByElement(Name name) |
FeatureTypeMapping |
mappingByName(Name name)
Get a feature type mapping from a registered app-schema data access.
|
static void |
register(DataAccess<FeatureType,Feature> dataAccess)
Registers a data access
|
void |
registerAccess(DataAccess<FeatureType,Feature> dataAccess)
Registers a data access
|
protected void |
throwDataSourceException(Name featureTypeName)
Throws data source exception if mapping is not found.
|
static void |
unregister(DataAccess<FeatureType,Feature> dataAccess)
Unregister a data access.
|
void |
unregisterAccess(DataAccess<FeatureType,Feature> dataAccess)
Unregister a data access.
|
static void |
unregisterAndDisposeAll()
Unregister * and dispose * all data accesses in the registry.
|
protected static volatile DataAccessRegistry theRegistry
protected InterpolationProperties properties
protected List<DataAccess<FeatureType,Feature>> registry
public static DataAccessRegistry getInstance()
public FeatureSource<FeatureType,Feature> featureSource(Name name) throws IOException
IOException
public DataAccess<FeatureType,Feature> access(Name name)
Repository
access
in interface Repository
name
- The Name (namespace and name) to search forpublic DataStore dataStore(Name name)
Repository
dataStore
in interface Repository
name
- The typeName (namespace and name) to search forpublic List<DataStore> getDataStores()
Repository
getDataStores
in interface Repository
public void registerAccess(DataAccess<FeatureType,Feature> dataAccess)
dataAccess
- Data access to be registeredpublic void unregisterAccess(DataAccess<FeatureType,Feature> dataAccess)
dataAccess
- Data access to be unregisteredpublic void disposeAndUnregisterAll()
public boolean hasAccessName(Name name) throws IOException
name
- Feature type nameIOException
public boolean hasAppSchemaAccessName(Name name) throws IOException
name
- Feature type nameIOException
public FeatureTypeMapping mappingByName(Name name) throws IOException
IOException
public FeatureTypeMapping mappingByElement(Name name) throws IOException
IOException
public boolean hasAppSchemaTargetElement(Name name) throws IOException
IOException
public InterpolationProperties getProperties()
public void clearProperties()
public static FeatureSource<FeatureType,Feature> getFeatureSource(Name featureTypeName) throws IOException
IOException
public static DataAccess<FeatureType,Feature> getDataAccess(Name featureTypeName) throws IOException
IOException
public static void register(DataAccess<FeatureType,Feature> dataAccess)
dataAccess
- Data access to be registeredpublic static void unregister(DataAccess<FeatureType,Feature> dataAccess)
dataAccess
- Data access to be unregisteredpublic static void unregisterAndDisposeAll()
public static boolean hasName(Name featureTypeName) throws IOException
featureTypeName
- Feature type nameIOException
protected void throwDataSourceException(Name featureTypeName) throws IOException
featureTypeName
- Name of feature typeIOException
public Feature findFeature(FeatureId id, Hints hints) throws IOException
IOException
Copyright © 1996–2023 Geotools. All rights reserved.