[geotk] [JIRA] Created: (GEOTK-37) Factory.isAvailable() needs to report why a factory is not available

Martin Desruisseaux (JIRA) jira at geomatys.com
Thu Aug 20 07:13:16 EDT 2009


Factory.isAvailable() needs to report why a factory is not available
--------------------------------------------------------------------

                 Key: GEOTK-37
                 URL: http://jira.geotoolkit.org/browse/GEOTK-37
             Project: Geotoolkit
          Issue Type: Improvement
          Components: Referencing, Utilities
    Affects Versions: 3.03
            Reporter: Martin Desruisseaux
            Assignee: Martin Desruisseaux
             Fix For: 3.03


{{Factory.isAvailable()}} returns a boolean value indicating if the factory is ready for use or not. In the case of the EPSG factory, there is many raisons why the factory may not be available:

* The Derby or JavaDB JDBC driver is not on the classpath.
* The JDBC driver is presents on the classpath but is an older version than the one which created the local EPSG database.
* The EPSG database is installed on a remote server and we failed to connect to that server (wrong password, network problem, _etc_.)
* The EPSG database is not installed on the local directory and the scripts for creating it are not found.
* We don't have write permission in the local directory of the EPSG database.
* The database is currently in use by an other process.
* The database is corrupted.
* _etc_........

In current Geotk version, if we failed to fetch the EPSG factory, the message in the exception said only "_Authority "EPSG" is unknown or doesn't match the supplied hints. Maybe it is defined in an unreachable JAR file?_". The cause is actually logged at the {{FINE}} or {{CONFIG}} level, but when the user did not configured his logger to show those levels, it is very hard to guess from the exception alone why the factory is not available.

The raison why the exception message doesn't contain the cause is that the {{Factory.isAvailable()}} method returns only a boolean value. We need to replace that method by a new one, {{Factory.availability()}}, which returns a {{ConformanceResult}} object (from ISO 19115) instead. {{ConformanceResult}} contains a boolean {{pass}} attribute, together with an {{explanation}} one which allow us to pass more informations.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.geotoolkit.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

       


More information about the Geotoolkit mailing list