01: /*
02: * Copyright 2004-2006 the original author or authors.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.compass.gps.device.jdbc;
18:
19: import javax.sql.DataSource;
20: import org.compass.gps.CompassGpsDevice;
21: import org.compass.gps.device.jdbc.dialect.JdbcDialect;
22:
23: /**
24: * A general contract for a Jdbc Gps device. The Jdbc Gps Device must be able to
25: * reindex a jdbc enabled database.
26: *
27: * @author kimchy
28: */
29: public interface JdbcGpsDevice extends CompassGpsDevice {
30:
31: /**
32: * Returns the Jdbc data source that will be used to connect to the
33: * database.
34: *
35: * @return The data source used with the device
36: */
37: DataSource getDataSource();
38:
39: /**
40: * Sets the Jdbc data source that will be used to connect to the database.
41: * Note that it must be set before calling the <code>start</code> method.
42: *
43: * @param dataSource
44: */
45: void setDataSource(DataSource dataSource);
46:
47: /**
48: * Returns the fetch size that will be used when executing select queries
49: * against the database. See <code>PreparedStatement#setFetchSize</code>.
50: *
51: * @return The fetch size for indexing and mirroring
52: */
53: int getFetchSize();
54:
55: /**
56: * Sets the fetch size that will be used when executing select queries
57: * against the database. See <code>PreparedStatement#setFetchSize</code>.
58: *
59: * @param fetchSize
60: */
61: void setFetchSize(int fetchSize);
62:
63: /**
64: * Returns the {@link JdbcDialect} that will be used when executing
65: * operations that might have different implementations based on the target
66: * database.
67: *
68: * @return The dialect used by the device
69: */
70: JdbcDialect getDialect();
71:
72: /**
73: * Sets the {@link JdbcDialect} that will be used when executing operations
74: * that might have different implementations based on the target database.
75: *
76: * @param dialect
77: */
78: void setDialect(JdbcDialect dialect);
79: }
|