01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2004-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: package org.geotools.data.jdbc.fidmapper;
17:
18: import org.geotools.feature.FeatureType;
19: import java.io.IOException;
20: import java.sql.Connection;
21:
22: /**
23: * Provides a way to plug in user defined policies for primary key to feature
24: * ID mapping. In particular, implementors of this interface will provide a
25: * FIDMapper given the FeatureType name and the database metadata
26: *
27: * @author aaime
28: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/fidmapper/FIDMapperFactory.java $
29: */
30: public interface FIDMapperFactory {
31: /**
32: * Returns a FIDMapper for the specified table
33: *
34: * @param catalog
35: * @param schema
36: * @param typeName DOCUMENT ME!
37: * @param connection DOCUMENT ME!
38: *
39: *
40: * @throws IOException
41: */
42: public FIDMapper getMapper(String catalog, String schema,
43: String typeName, Connection connection) throws IOException;
44:
45: /**
46: * Returns a FIDMapper for the specified feature type. This one is called
47: * when creating new tables if the user did not provide a FIDMapper
48: *
49: * @param featureType
50: *
51: */
52: FIDMapper getMapper(FeatureType featureType);
53: }
|