Class CachedAuthorityDecorator
- Object
-
- AbstractFactory
-
- ReferencingFactory
-
- AbstractAuthorityFactory
-
- CachedAuthorityDecorator
-
- All Implemented Interfaces:
AuthorityFactory,CRSAuthorityFactory,CSAuthorityFactory,DatumAuthorityFactory,Factory,CoordinateOperationAuthorityFactory,BufferedFactory,Factory,RegistrableFactory
public final class CachedAuthorityDecorator extends AbstractAuthorityFactory implements AuthorityFactory, CRSAuthorityFactory, CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory, BufferedFactory
An authority factory that caches all objects created by delegate factories. This class is set up to cache the full complement of referencing objects: In many cases a single implementation will be used for several the authority factory interfaces - but this is not a requirement. The behaviour of thecreateFoo(String)methods first looks if a previously created object exists for the given code. If such an object exists, it is returned directly. The testing of the cache is synchronized and may block if the referencing object is under construction.If the object is not yet created, the definition is delegated to the appropriate the AuthorityFactory authority factory and the result is cached for next time.
This object is responsible for owning a {{ReferencingObjectCache}}; there are several implementations to choose from on construction.
- Since:
- 2.4
- Author:
- Jody Garnett
-
-
Field Summary
-
Fields inherited from class ReferencingFactory
LOGGER
-
Fields inherited from class AbstractFactory
hints, MAXIMUM_PRIORITY, MINIMUM_PRIORITY, NORMAL_PRIORITY, priority
-
-
Constructor Summary
Constructors Modifier Constructor Description CachedAuthorityDecorator(AuthorityFactory factory)Constructs an instance wrapping the specified factory with a default cache.protectedCachedAuthorityDecorator(AuthorityFactory factory, ObjectCache<Object,Object> cache)Constructs an instance wrapping the specified factory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static <K,V>
ObjectCache<K,V>createCache(Hints hints)Utility method used to produce cache based on hintCartesianCScreateCartesianCS(String code)Creates a cartesian coordinate system from a code.CompoundCRScreateCompoundCRS(String code)Creates a 3D coordinate reference system from a code.CoordinateOperationcreateCoordinateOperation(String code)Creates an operation from a single operation code.CoordinateReferenceSystemcreateCoordinateReferenceSystem(String code)Returns an arbitrary coordinate reference system from a code.CoordinateSystemcreateCoordinateSystem(String code)Returns an arbitrary coordinate system from a code.CoordinateSystemAxiscreateCoordinateSystemAxis(String code)Returns a coordinate system axis from a code.CylindricalCScreateCylindricalCS(String code)Creates a cylindrical coordinate system from a code.DatumcreateDatum(String code)Returns an arbitrary datum from a code.DerivedCRScreateDerivedCRS(String code)Creates a derived coordinate reference system from a code.EllipsoidcreateEllipsoid(String code)Returns an ellipsoid from a code.EllipsoidalCScreateEllipsoidalCS(String code)Creates an ellipsoidal coordinate system from a code.EngineeringCRScreateEngineeringCRS(String code)Creates a engineering coordinate reference system from a code.EngineeringDatumcreateEngineeringDatum(String code)Creates a engineering datum from a code.Set<CoordinateOperation>createFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode)Creates an operation from coordinate reference system codes.GeocentricCRScreateGeocentricCRS(String code)Returns a geocentric coordinate reference system from a code.GeodeticDatumcreateGeodeticDatum(String code)Returns a geodetic datum from a code.GeographicCRScreateGeographicCRS(String code)Returns a geographic coordinate reference system from a code.ImageCRScreateImageCRS(String code)Creates a image coordinate reference system from a code.ImageDatumcreateImageDatum(String code)Creates a image datum from a code.IdentifiedObjectcreateObject(String code)Returns an arbitrary object from a code.PolarCScreatePolarCS(String code)Creates a polar coordinate system from a code.PrimeMeridiancreatePrimeMeridian(String code)Returns a prime meridian from a code.ProjectedCRScreateProjectedCRS(String code)Returns a projected coordinate reference system from a code.SphericalCScreateSphericalCS(String code)Creates a spherical coordinate system from a code.TemporalCRScreateTemporalCRS(String code)Creates a temporal coordinate reference system from a code.TemporalDatumcreateTemporalDatum(String code)Creates a temporal datum from a code.TimeCScreateTimeCS(String code)Creates a temporal coordinate system from a code.Unit<?>createUnit(String code)Returns an unit from a code.VerticalCRScreateVerticalCRS(String code)Creates a vertical coordinate reference system from a code.VerticalCScreateVerticalCS(String code)Creates a vertical coordinate system from a code.VerticalDatumcreateVerticalDatum(String code)Creates a vertical datum from a code.voiddispose()Releases resources immediately instead of waiting for the garbage collector.CitationgetAuthority()Returns the organization or party responsible for definition and maintenance of the database.Set<String>getAuthorityCodes(Class<? extends IdentifiedObject> type)Returns the set of authority codes of the given type.StringgetBackingStoreDescription()Returns a description of the underlying backing store, ornullif unknown.InternationalStringgetDescriptionText(String code)Gets a description of the object corresponding to a code.IdentifiedObjectFindergetIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)Returns a finder which can be used for looking up unidentified objects.protected StringtoKey(String code)-
Methods inherited from class AbstractAuthorityFactory
createExtent, createOperationMethod, createParameterDescriptor, noSuchAuthorityCode, trimAuthority
-
Methods inherited from class ReferencingFactory
ensureNonNull, getVendor
-
Methods inherited from class AbstractFactory
addImplementationHints, equals, getImplementationHints, getPriority, hashCode, onDeregistration, onRegistration, toString
-
Methods inherited from interface Factory
getImplementationHints
-
-
-
-
Constructor Detail
-
CachedAuthorityDecorator
public CachedAuthorityDecorator(AuthorityFactory factory)
Constructs an instance wrapping the specified factory with a default cache.The provided authority factory must implement
DatumAuthorityFactory,CSAuthorityFactory,CRSAuthorityFactoryandCoordinateOperationAuthorityFactory.- Parameters:
factory- The factory to cache. Can not benull.
-
CachedAuthorityDecorator
protected CachedAuthorityDecorator(AuthorityFactory factory, ObjectCache<Object,Object> cache)
Constructs an instance wrapping the specified factory. ThemaxStrongReferencesargument specify the maximum number of objects to keep by strong reference. If a greater amount of objects are created, then the strong references for the oldest ones are replaced by weak references.This constructor is protected because subclasses must declare which of the
DatumAuthorityFactory,CSAuthorityFactory,CRSAuthorityFactorySearchableAuthorityFactoryandCoordinateOperationAuthorityFactoryinterfaces they choose to implement.- Parameters:
factory- The factory to cache. Can not benull.cache- The cache to use
-
-
Method Detail
-
createCache
protected static <K,V> ObjectCache<K,V> createCache(Hints hints) throws FactoryRegistryException
Utility method used to produce cache based on hint- Throws:
FactoryRegistryException
-
createObject
public IdentifiedObject createObject(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an arbitrary object from a code. The returned object will typically be an instance ofDatum,CoordinateSystem,CoordinateReferenceSystemorCoordinateOperation. The default implementation always throw an exception. Subclasses should override this method if they are capable to automatically detect the object type from its code.- Specified by:
createObjectin interfaceAuthorityFactory- Overrides:
createObjectin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The object for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createCoordinateReferenceSystem(java.lang.String),AbstractAuthorityFactory.createDatum(java.lang.String),AbstractAuthorityFactory.createEllipsoid(java.lang.String),AbstractAuthorityFactory.createUnit(java.lang.String)
-
getAuthority
public Citation getAuthority()
Description copied from class:AbstractAuthorityFactoryReturns the organization or party responsible for definition and maintenance of the database.- Specified by:
getAuthorityin interfaceAuthorityFactory- Specified by:
getAuthorityin classAbstractAuthorityFactory- Returns:
- The organization reponsible for definition of the database.
-
getAuthorityCodes
public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
Description copied from interface:AuthorityFactoryReturns the set of authority codes of the given type. Thetypeargument specify the base class. For example if this factory is an instance ofCRSAuthorityFactory, then:CoordinateReferenceSystem.classasks for all authority codes accepted by one ofcreateGeographicCRS,createProjectedCRS,createVerticalCRS,createTemporalCRSand their friends.ProjectedCRS.classasks only for authority codes accepted bycreateProjectedCRS.
- Specified by:
getAuthorityCodesin interfaceAuthorityFactory- Parameters:
type- The spatial reference objects type.- Returns:
- The set of authority codes for spatial reference objects of the given type. If this factory doesn't contains any object of the given type, then this method returns an empty set.
- Throws:
FactoryException- if access to the underlying database failed.
-
getDescriptionText
public InternationalString getDescriptionText(String code) throws FactoryException
Description copied from interface:AuthorityFactoryGets a description of the object corresponding to a code.- Specified by:
getDescriptionTextin interfaceAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- A description of the object, or
nullif the object corresponding to the specifiedcodehas no description. - Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the query failed for some other reason.
-
createCompoundCRS
public CompoundCRS createCompoundCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a 3D coordinate reference system from a code.- Specified by:
createCompoundCRSin interfaceCRSAuthorityFactory- Overrides:
createCompoundCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createCoordinateReferenceSystem
public CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an arbitrary coordinate reference system from a code. If the coordinate reference system type is know at compile time, it is recommended to invoke the most precise method instead of this one (for examplecreateGeographicCRS(code)instead ofcreateCoordinateReferenceSystem(code)if the caller know he is asking for a geographic coordinate reference system).- Specified by:
createCoordinateReferenceSystemin interfaceCRSAuthorityFactory- Overrides:
createCoordinateReferenceSystemin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeographicCRS(java.lang.String),AbstractAuthorityFactory.createProjectedCRS(java.lang.String),AbstractAuthorityFactory.createVerticalCRS(java.lang.String),AbstractAuthorityFactory.createTemporalCRS(java.lang.String),AbstractAuthorityFactory.createCompoundCRS(java.lang.String)
-
createDerivedCRS
public DerivedCRS createDerivedCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a derived coordinate reference system from a code.- Specified by:
createDerivedCRSin interfaceCRSAuthorityFactory- Overrides:
createDerivedCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createEngineeringCRS
public EngineeringCRS createEngineeringCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a engineering coordinate reference system from a code.- Specified by:
createEngineeringCRSin interfaceCRSAuthorityFactory- Overrides:
createEngineeringCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createGeocentricCRS
public GeocentricCRS createGeocentricCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a geocentric coordinate reference system from a code.- Specified by:
createGeocentricCRSin interfaceCRSAuthorityFactory- Overrides:
createGeocentricCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
-
createGeographicCRS
public GeographicCRS createGeographicCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a geographic coordinate reference system from a code.- Specified by:
createGeographicCRSin interfaceCRSAuthorityFactory- Overrides:
createGeographicCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
-
createImageCRS
public ImageCRS createImageCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a image coordinate reference system from a code.- Specified by:
createImageCRSin interfaceCRSAuthorityFactory- Overrides:
createImageCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createProjectedCRS
public ProjectedCRS createProjectedCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a projected coordinate reference system from a code.- Specified by:
createProjectedCRSin interfaceCRSAuthorityFactory- Overrides:
createProjectedCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
-
createTemporalCRS
public TemporalCRS createTemporalCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a temporal coordinate reference system from a code.- Specified by:
createTemporalCRSin interfaceCRSAuthorityFactory- Overrides:
createTemporalCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createTemporalDatum(java.lang.String)
-
createVerticalCRS
public VerticalCRS createVerticalCRS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a vertical coordinate reference system from a code.- Specified by:
createVerticalCRSin interfaceCRSAuthorityFactory- Overrides:
createVerticalCRSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate reference system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createVerticalDatum(java.lang.String)
-
createCartesianCS
public CartesianCS createCartesianCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a cartesian coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createCartesianCSin interfaceCSAuthorityFactory- Overrides:
createCartesianCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createCoordinateSystem
public CoordinateSystem createCoordinateSystem(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an arbitrary coordinate system from a code. The default implementation invokescreateObject(code).- Specified by:
createCoordinateSystemin interfaceCSAuthorityFactory- Overrides:
createCoordinateSystemin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createCoordinateSystemAxis
public CoordinateSystemAxis createCoordinateSystemAxis(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a coordinate system axis from a code. The default implementation invokescreateObject(code).- Specified by:
createCoordinateSystemAxisin interfaceCSAuthorityFactory- Overrides:
createCoordinateSystemAxisin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The axis for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createCylindricalCS
public CylindricalCS createCylindricalCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a cylindrical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createCylindricalCSin interfaceCSAuthorityFactory- Overrides:
createCylindricalCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createEllipsoidalCS
public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates an ellipsoidal coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createEllipsoidalCSin interfaceCSAuthorityFactory- Overrides:
createEllipsoidalCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createPolarCS
public PolarCS createPolarCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a polar coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createPolarCSin interfaceCSAuthorityFactory- Overrides:
createPolarCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createSphericalCS
public SphericalCS createSphericalCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a spherical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createSphericalCSin interfaceCSAuthorityFactory- Overrides:
createSphericalCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createTimeCS
public TimeCS createTimeCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a temporal coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createTimeCSin interfaceCSAuthorityFactory- Overrides:
createTimeCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createUnit
public Unit<?> createUnit(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an unit from a code. The default implementation invokescreateObject(code).- Specified by:
createUnitin interfaceCSAuthorityFactory- Overrides:
createUnitin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The unit for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createVerticalCS
public VerticalCS createVerticalCS(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a vertical coordinate system from a code. The default implementation invokescreateCoordinateSystem(code).- Specified by:
createVerticalCSin interfaceCSAuthorityFactory- Overrides:
createVerticalCSin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The coordinate system for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createDatum
public Datum createDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an arbitrary datum from a code. The default implementation invokescreateObject(code).- Specified by:
createDatumin interfaceDatumAuthorityFactory- Overrides:
createDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String),AbstractAuthorityFactory.createVerticalDatum(java.lang.String),AbstractAuthorityFactory.createTemporalDatum(java.lang.String)
-
createEllipsoid
public Ellipsoid createEllipsoid(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns an ellipsoid from a code. The default implementation invokescreateObject(code).- Specified by:
createEllipsoidin interfaceDatumAuthorityFactory- Overrides:
createEllipsoidin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The ellipsoid for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
-
createEngineeringDatum
public EngineeringDatum createEngineeringDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a engineering datum from a code. The default implementation invokescreateDatum(code).- Specified by:
createEngineeringDatumin interfaceDatumAuthorityFactory- Overrides:
createEngineeringDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createEngineeringCRS(java.lang.String)
-
createGeodeticDatum
public GeodeticDatum createGeodeticDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a geodetic datum from a code. The default implementation invokescreateDatum(code).- Specified by:
createGeodeticDatumin interfaceDatumAuthorityFactory- Overrides:
createGeodeticDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createEllipsoid(java.lang.String),AbstractAuthorityFactory.createPrimeMeridian(java.lang.String),AbstractAuthorityFactory.createGeographicCRS(java.lang.String),AbstractAuthorityFactory.createProjectedCRS(java.lang.String)
-
createImageDatum
public ImageDatum createImageDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a image datum from a code. The default implementation invokescreateDatum(code).- Specified by:
createImageDatumin interfaceDatumAuthorityFactory- Overrides:
createImageDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createImageCRS(java.lang.String)
-
createPrimeMeridian
public PrimeMeridian createPrimeMeridian(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a prime meridian from a code. The default implementation invokescreateObject(code).- Specified by:
createPrimeMeridianin interfaceDatumAuthorityFactory- Overrides:
createPrimeMeridianin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The prime meridian for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createGeodeticDatum(java.lang.String)
-
createTemporalDatum
public TemporalDatum createTemporalDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a temporal datum from a code. The default implementation invokescreateDatum(code).- Specified by:
createTemporalDatumin interfaceDatumAuthorityFactory- Overrides:
createTemporalDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createTemporalCRS(java.lang.String)
-
createVerticalDatum
public VerticalDatum createVerticalDatum(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates a vertical datum from a code. The default implementation invokescreateDatum(code).- Specified by:
createVerticalDatumin interfaceDatumAuthorityFactory- Overrides:
createVerticalDatumin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The datum for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.- See Also:
AbstractAuthorityFactory.createVerticalCRS(java.lang.String)
-
createCoordinateOperation
public CoordinateOperation createCoordinateOperation(String code) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates an operation from a single operation code.- Specified by:
createCoordinateOperationin interfaceCoordinateOperationAuthorityFactory- Overrides:
createCoordinateOperationin classAbstractAuthorityFactory- Parameters:
code- Value allocated by authority.- Returns:
- The operation for the given code.
- Throws:
NoSuchAuthorityCodeException- if the specifiedcodewas not found.FactoryException- if the object creation failed for some other reason.
-
createFromCoordinateReferenceSystemCodes
public Set<CoordinateOperation> createFromCoordinateReferenceSystemCodes(String sourceCode, String targetCode) throws FactoryException
Description copied from class:AbstractAuthorityFactoryCreates an operation from coordinate reference system codes. The default implementation returns an {@linkplain Collections.emptySet() empty set}. We do not delegate to some kind of coordinate operation factory method because the usual contract for this method is to extract the information from an authority database like EPSG, not to compute operations on-the-fly.Rational: Coordinate operation factory backed by an authority will invoke this method. If this method invoked the coordinate operation factory in turn, the application could be trapped in infinite recursive calls.
- Specified by:
createFromCoordinateReferenceSystemCodesin interfaceCoordinateOperationAuthorityFactory- Overrides:
createFromCoordinateReferenceSystemCodesin classAbstractAuthorityFactory- Parameters:
sourceCode- Coded value of source coordinate reference system.targetCode- Coded value of target coordinate reference system.- Returns:
- The operations from
sourceCRStotargetCRS. - Throws:
NoSuchAuthorityCodeException- if a specified code was not found.FactoryException- if the object creation failed for some other reason.
-
getIdentifiedObjectFinder
public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type) throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a finder which can be used for looking up unidentified objects. The finder fetchs a fully identified object from an incomplete one, for example from an object without identifier or "AUTHORITY[...]" element in Well Known Text terminology.- Overrides:
getIdentifiedObjectFinderin classAbstractAuthorityFactory- Parameters:
type- The type of objects to look for. Should be a GeoAPI interface likeGeographicCRS.class, but this method accepts also implementation class. If the type is unknown, useIdentifiedObject.class. A more accurate type may help to speed up the search, since it reduces the amount of tables to scan in some implementations like the factories backed by EPSG database.- Returns:
- A finder to use for looking up unidentified objects.
- Throws:
FactoryException- if the finder can not be created.
-
dispose
public void dispose() throws FactoryExceptionDescription copied from class:AbstractAuthorityFactoryReleases resources immediately instead of waiting for the garbage collector. Once a factory has been disposed, furthercreate(...)invocations may throw aFactoryException. Disposing a previously-disposed factory, however, has no effect.- Overrides:
disposein classAbstractAuthorityFactory- Throws:
FactoryException- if an error occured while disposing the factory.
-
getBackingStoreDescription
public String getBackingStoreDescription() throws FactoryException
Description copied from class:AbstractAuthorityFactoryReturns a description of the underlying backing store, ornullif unknown. This is for example the database software used for storing the data. The default implementation returns alwaysnull.- Overrides:
getBackingStoreDescriptionin classAbstractAuthorityFactory- Returns:
- The description of the underlying backing store, or
null. - Throws:
FactoryException- if a failure occurs while fetching the engine description.
-
-