org.geotoolkit.referencing.factory.web
Class HTTP_AuthorityFactory

Object
  extended by Factory
      extended by ReferencingFactory
          extended by AbstractAuthorityFactory
              extended by AuthorityFactoryAdapter
                  extended by HTTP_AuthorityFactory
All Implemented Interfaces:
AuthorityFactory, CRSAuthorityFactory, CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory, Factory

@ThreadSafe
public class HTTP_AuthorityFactory
extends AuthorityFactoryAdapter
implements CRSAuthorityFactory, CSAuthorityFactory, DatumAuthorityFactory, CoordinateOperationAuthorityFactory

Wraps all factories in a "http://www.opengis.net/" name space. Example of complete URL:

http://www.opengis.net/gml/srs/epsg.xml#4326
Users don't need to create an instance of this class, since one is automatically registered for use in ReferencingFactoryFinder.

Since:
2.4
Version:
3.07
Author:
Martin Desruisseaux (IRD, Geomatys)
Module:
referencing/geotk-referencing (download)    View source code for this class

Nested Class Summary
 
Nested classes/interfaces inherited from class Factory
Factory.Availability, Factory.Organizer
 
Field Summary
static String BASE_URL
          The base URL, which is "http://www.opengis.net/gml/srs/".
 
Fields inherited from class AbstractAuthorityFactory
nameFactory
 
Fields inherited from class ReferencingFactory
LOGGER
 
Fields inherited from class Factory
EMPTY_HINTS, hints
 
Constructor Summary
HTTP_AuthorityFactory()
          Creates a default wrapper.
HTTP_AuthorityFactory(AllAuthoritiesFactory factory)
          Creates a wrapper around the specified factory.
HTTP_AuthorityFactory(Hints userHints)
          Creates a wrapper using the specified hints.
 
Method Summary
 Citation getAuthority()
          Returns the authority, which contains the "http://www.opengis.net" identifier.
 IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
          Returns a finder which can be used for looking up unidentified objects.
protected  boolean hasCompatibleHints(Hints hints)
          Returns true if this factory meets the requirements specified by a map of hints.
protected  void setOrdering(Factory.Organizer organizer)
          Sets the ordering of this factory relative to other factories.
protected  String toBackingFactoryCode(String code)
          Removes the URL base ("http://www.opengis.net/gml/srs/") from the specified code before to pass it to the wrapped factories.
 
Methods inherited from class AuthorityFactoryAdapter
availability, createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateReferenceSystem, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createObject, createOperationMethod, createParameterDescriptor, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getAuthorityCodes, getAuthorityFactory, getAuthorityFactory, getBackingStoreDescription, getCoordinateOperationAuthorityFactory, getCRSAuthorityFactory, getCSAuthorityFactory, getDatumAuthorityFactory, getDescriptionText, getImplementationHints, getVendor
 
Methods inherited from class AbstractAuthorityFactory
dispose, noSuchAuthorityCode, trimAuthority
 
Methods inherited from class ReferencingFactory
ensureNonNull
 
Methods inherited from class Factory
equals, hashCode, toString
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface CRSAuthorityFactory
createCompoundCRS, createCoordinateReferenceSystem, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRS
 
Methods inherited from interface CSAuthorityFactory
createCartesianCS, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createEllipsoidalCS, createPolarCS, createSphericalCS, createTimeCS, createUnit, createVerticalCS
 
Methods inherited from interface DatumAuthorityFactory
createDatum, createEllipsoid, createEngineeringDatum, createGeodeticDatum, createImageDatum, createPrimeMeridian, createTemporalDatum, createVerticalDatum
 
Methods inherited from interface CoordinateOperationAuthorityFactory
createCoordinateOperation, createFromCoordinateReferenceSystemCodes, createOperationMethod
 
Methods inherited from interface AuthorityFactory
createObject, getAuthorityCodes, getDescriptionText
 
Methods inherited from interface Factory
getVendor
 

Field Detail

BASE_URL

public static final String BASE_URL
The base URL, which is "http://www.opengis.net/gml/srs/".

See Also:
Constant Field Values
Constructor Detail

HTTP_AuthorityFactory

public HTTP_AuthorityFactory()
Creates a default wrapper.


HTTP_AuthorityFactory

public HTTP_AuthorityFactory(Hints userHints)
Creates a wrapper using the specified hints. For strict compliance with OGC definition of CRS defined by URL, the supplied hints should contains at least the FORCE_LONGITUDE_FIRST_AXIS_ORDER hint with value FALSE.

Parameters:
userHints - The hints to be given to backing factories.

HTTP_AuthorityFactory

public HTTP_AuthorityFactory(AllAuthoritiesFactory factory)
Creates a wrapper around the specified factory. The supplied factory is given unchanged to the super class constructor.

Parameters:
factory - The factory on which to delegate object creation.
Method Detail

getAuthority

public Citation getAuthority()
Returns the authority, which contains the "http://www.opengis.net" identifier.

Specified by:
getAuthority in interface AuthorityFactory
Overrides:
getAuthority in class AuthorityFactoryAdapter

toBackingFactoryCode

protected String toBackingFactoryCode(String code)
                               throws FactoryException
Removes the URL base ("http://www.opengis.net/gml/srs/") from the specified code before to pass it to the wrapped factories.

Overrides:
toBackingFactoryCode in class AuthorityFactoryAdapter
Parameters:
code - The code given to this factory.
Returns:
The code to give to the underlying factories.
Throws:
FactoryException - if the code can't be converted.

getIdentifiedObjectFinder

public IdentifiedObjectFinder getIdentifiedObjectFinder(Class<? extends IdentifiedObject> type)
                                                 throws FactoryException
Returns a finder which can be used for looking up unidentified objects. The default implementation forwards all method calls to the finder of the underlying AllAuthoritiesFactory. No additional work is performed, except in the case of the findIdentifier method which format the code in a "http://www.opengis.net/gml/srs/" syntax.

Overrides:
getIdentifiedObjectFinder in class AuthorityFactoryAdapter
Parameters:
type - The type of objects to look for. Should be a GeoAPI interface like GeographicCRS.class, but this method accepts also implementation class. If the type is unknown, use IdentifiedObject.class. A more accurate type may help to speed up the search, since it reduces the amount of tables to scan in some implementations (for example the factories backed by EPSG databases).
Returns:
A finder to use for looking up unidentified objects.
Throws:
FactoryException - if the finder can not be created.
Since:
3.07

hasCompatibleHints

protected boolean hasCompatibleHints(Hints hints)
Returns true if this factory meets the requirements specified by a map of hints. This information is for FactoryRegistry usage only.

Overrides:
hasCompatibleHints in class Factory
Since:
3.00

setOrdering

protected void setOrdering(Factory.Organizer organizer)
Sets the ordering of this factory relative to other factories. By default HTTP_AuthorityFactory is selected only if there is no suitable instance of AbstractAuthorityFactory for user request.

Overrides:
setOrdering in class Factory
Since:
3.00


Copyright © 2009-2011 Geotoolkit.org. All Rights Reserved.