01: /*
02: * Geotools2 - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: */
17: package org.geotools.arcsde;
18:
19: import java.util.Collections;
20: import java.util.Map;
21: import java.util.logging.Level;
22: import java.util.logging.Logger;
23:
24: import org.geotools.arcsde.gce.ArcSDERasterFormat;
25: import org.geotools.coverage.grid.io.GridFormatFactorySpi;
26: import org.opengis.coverage.grid.Format;
27:
28: import com.esri.sde.sdk.client.SeConnection;
29: import com.esri.sde.sdk.pe.PeCoordinateSystem;
30:
31: /**
32: * Implementation of the GridCoverageFormat service provider interface for ArcSDE Databases. Based on the Arc
33: * Grid implementation.
34: *
35: *
36: *
37: * @author Saul Farber (saul.farber)
38: * @author aaime
39: * @author Simone Giannecchini (simboss)
40: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/unsupported/arcsde/datastore/src/main/java/org/geotools/arcsde/ArcSDERasterFormatFactory.java $
41: */
42: public class ArcSDERasterFormatFactory implements GridFormatFactorySpi {
43:
44: /** package's logger */
45: protected static final Logger LOGGER = org.geotools.util.logging.Logging
46: .getLogger(ArcSDERasterFormatFactory.class.getPackage()
47: .getName());
48:
49: /** friendly factory description */
50: private static final String FACTORY_DESCRIPTION = "ESRI(tm) ArcSDE 9.x Raster Support via GridCoverageExchange Interface";
51:
52: /**
53: * DOCUMENT ME!
54: *
55: * @return DOCUMENT ME!
56: */
57: public boolean isAvailable() {
58: LOGGER.fine("Checking availability of ArcSDE Jars.");
59: try {
60: LOGGER.fine(SeConnection.class.getName() + " is in place.");
61: LOGGER.fine(PeCoordinateSystem.class.getName()
62: + " is in place.");
63: } catch (Throwable t) {
64: LOGGER
65: .log(
66: Level.WARNING,
67: "ArcSDE Java API seems to not be on your classpath. Please"
68: + " verify that all needed jars are. ArcSDE data stores"
69: + " will not be available.", t);
70: return false;
71: }
72:
73: return true;
74: }
75:
76: public Format createFormat() {
77: return new ArcSDERasterFormat();
78: }
79:
80: /**
81: * Returns the implementation hints. The default implementation returns en
82: * empty map.
83: *
84: * @return DOCUMENT ME!
85: */
86: public Map getImplementationHints() {
87: return Collections.EMPTY_MAP;
88: }
89: }
|