org.geotools.data.complex
Class DataAccessRegistry

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>>
              extended by org.geotools.data.complex.DataAccessRegistry
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>>, java.util.Collection<DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>>, java.util.List<DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>>, java.util.RandomAccess
Direct Known Subclasses:
AppSchemaDataAccessRegistry

public class DataAccessRegistry
extends java.util.ArrayList<DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature>>

A registry that stores data access instances per application. This allows feature sources from different data accesses to be accessed globally.

Author:
Rini Angreani, Curtin University of Technology
See Also:
Serialized Form

Field Summary
protected static DataAccessRegistry registry
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected DataAccessRegistry()
          Sole constructor
 
Method Summary
static DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getDataAccess(org.opengis.feature.type.Name featureTypeName)
           
static FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getFeatureSource(org.opengis.feature.type.Name featureTypeName)
          Get a feature source for built features with supplied feature type name.
static boolean hasName(org.opengis.feature.type.Name featureTypeName)
           
static void register(DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> dataAccess)
          Registers a data access
protected static void throwDataSourceException(org.opengis.feature.type.Name featureTypeName)
          Throws data source exception if mapping is not found.
static void unregister(DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> dataAccess)
          Unregister a data access.
static void unregisterAll()
          Unregister all data accesses in the registry.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode
 

Field Detail

registry

protected static DataAccessRegistry registry
Constructor Detail

DataAccessRegistry

protected DataAccessRegistry()
Sole constructor

Method Detail

register

public static void register(DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> dataAccess)
Registers a data access

Parameters:
dataAccess - Data access to be registered

unregister

public static void unregister(DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> dataAccess)
Unregister a data access. This is important especially at the end of test cases, so that the mappings contained in the data access do not conflict with mappings of the same type used in other tests.

Parameters:
dataAccess - Data access to be unregistered

unregisterAll

public static void unregisterAll()
Unregister all data accesses in the registry. This is may be needed to prevent unit tests from conflicting with data accesses with the same type name registered for other tests.


hasName

public static boolean hasName(org.opengis.feature.type.Name featureTypeName)
                       throws java.io.IOException
Throws:
java.io.IOException

getFeatureSource

public static FeatureSource<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getFeatureSource(org.opengis.feature.type.Name featureTypeName)
                                                                                                        throws java.io.IOException
Get a feature source for built features with supplied feature type name.

Parameters:
featureTypeName -
Returns:
feature source
Throws:
java.io.IOException

getDataAccess

public static DataAccess<org.opengis.feature.type.FeatureType,org.opengis.feature.Feature> getDataAccess(org.opengis.feature.type.Name featureTypeName)
                                                                                                  throws java.io.IOException
Throws:
java.io.IOException

throwDataSourceException

protected static void throwDataSourceException(org.opengis.feature.type.Name featureTypeName)
                                        throws java.io.IOException
Throws data source exception if mapping is not found.

Parameters:
featureTypeName - Name of feature type
Throws:
java.io.IOException


Copyright © 1996-2010 Geotools. All Rights Reserved.