svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.db / org.gvsig.fmap.dal.db.jdbc / src / main / java / org / gvsig / fmap / dal / store / jdbc2 / OperationsFactory.java @ 46724
History | View | Annotate | Download (7.67 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2020 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program 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
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.dal.store.jdbc2; |
25 |
|
26 |
import java.util.Iterator; |
27 |
import java.util.List; |
28 |
import org.apache.commons.lang3.tuple.Pair; |
29 |
import org.cresques.cts.IProjection; |
30 |
import org.gvsig.expressionevaluator.Expression; |
31 |
import org.gvsig.fmap.dal.SQLBuilder; |
32 |
import org.gvsig.fmap.dal.exception.DataException; |
33 |
import org.gvsig.fmap.dal.feature.EditableFeatureType; |
34 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
35 |
import org.gvsig.fmap.dal.feature.FeatureType; |
36 |
import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices; |
37 |
import org.gvsig.fmap.dal.feature.spi.FeatureStoreProviderServices; |
38 |
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters; |
39 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
40 |
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters; |
41 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation; |
42 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CalculateEnvelopeOfColumnOperation; |
43 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanCreateTablesOperation; |
44 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanModifyTableOperation; |
45 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation; |
46 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation; |
47 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DeletePassThroughOperation; |
48 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DropTableOperation; |
49 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ExecuteOperation; |
50 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureProviderByReferenceOperation; |
51 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation; |
52 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ListTablesOperation; |
53 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation; |
54 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation; |
55 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.RetrieveValueOperation; |
56 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation; |
57 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation; |
58 |
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation; |
59 |
import org.gvsig.fmap.geom.primitive.Envelope; |
60 |
|
61 |
public interface OperationsFactory { |
62 |
|
63 |
public interface TableReference { |
64 |
public String getDatabase(); |
65 |
public String getSchema(); |
66 |
public String getTable(); |
67 |
public String getSubquery(); |
68 |
public boolean hasDatabase(); |
69 |
public boolean hasSchema(); |
70 |
public boolean hasTable(); |
71 |
public boolean hasSubquery(); |
72 |
} |
73 |
|
74 |
public TableReference createTableReference(
|
75 |
String database,
|
76 |
String schema,
|
77 |
String table,
|
78 |
String subquery
|
79 |
); |
80 |
|
81 |
public TableReference createTableReference(JDBCStoreParameters params);
|
82 |
public TableReference createTableReference(JDBCNewStoreParameters params);
|
83 |
|
84 |
public FetchFeatureTypeOperation createFetchFeatureType(
|
85 |
EditableFeatureType type, |
86 |
TableReference table, |
87 |
List<String> primaryKeys, |
88 |
String defaultGeometryField,
|
89 |
IProjection crs |
90 |
); |
91 |
|
92 |
public FetchFeatureTypeOperation createFetchFeatureType(
|
93 |
EditableFeatureType type, |
94 |
TableReference table, |
95 |
List<String> primaryKeys, |
96 |
String defaultGeometryField,
|
97 |
IProjection crs, |
98 |
int geometryType,
|
99 |
int geometrySubtype
|
100 |
|
101 |
); |
102 |
|
103 |
public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
|
104 |
FeatureReferenceProviderServices reference, |
105 |
FeatureType featureType, |
106 |
TableReference table |
107 |
); |
108 |
|
109 |
public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
|
110 |
FeatureType featureType, |
111 |
TableReference table, |
112 |
String columnName,
|
113 |
String baseFilter,
|
114 |
Envelope workingArea, |
115 |
IProjection crs |
116 |
); |
117 |
|
118 |
public PerformChangesOperation createPerformChanges(
|
119 |
TableReference table, |
120 |
FeatureType type, |
121 |
Iterator deleteds,
|
122 |
Iterator inserteds,
|
123 |
Iterator updateds,
|
124 |
Iterator featureTypesChanged
|
125 |
); |
126 |
|
127 |
public PerformChangesOperation createPerformChanges(
|
128 |
TableReference table, |
129 |
FeatureType type, |
130 |
Iterator deleteds,
|
131 |
Iterator inserteds,
|
132 |
Iterator updateds,
|
133 |
Iterator featureTypesChanged,
|
134 |
FeatureStoreProviderServices storeServices |
135 |
); |
136 |
|
137 |
public AppendOperation createAppend(
|
138 |
TableReference table, |
139 |
FeatureType type |
140 |
); |
141 |
|
142 |
public CountOperation createCount(
|
143 |
FeatureType featureType, |
144 |
TableReference table, |
145 |
String baseFilter,
|
146 |
FeatureQuery query |
147 |
); |
148 |
|
149 |
public TableIsEmptyOperation createTableIsEmpty(
|
150 |
FeatureType featureType, |
151 |
TableReference table, |
152 |
String baseFilter,
|
153 |
FeatureQuery query |
154 |
); |
155 |
|
156 |
public ResultSetForSetProviderOperation createResultSetForSetProvider(
|
157 |
TableReference table, |
158 |
String baseFilter,
|
159 |
String baseOrder,
|
160 |
FeatureQuery query, |
161 |
FeatureType storeType, |
162 |
FeatureType setType, |
163 |
long limit,
|
164 |
long offset,
|
165 |
int fetchSize
|
166 |
); |
167 |
|
168 |
public ListTablesOperation createListTables(
|
169 |
int mode,
|
170 |
JDBCServerExplorerParameters baseParameters, |
171 |
boolean informationTables,
|
172 |
int tablesOrViews
|
173 |
); |
174 |
|
175 |
public DropTableOperation createDropTable(
|
176 |
TableReference table |
177 |
); |
178 |
|
179 |
public CreateTableOperation createTable(
|
180 |
TableReference table, |
181 |
FeatureType type, |
182 |
List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges, |
183 |
List<String> additionalSQLs |
184 |
) throws DataException;
|
185 |
|
186 |
public CanCreateTablesOperation createCanCreateTables();
|
187 |
|
188 |
public UpdateTableStatisticsOperation createUpdateTableStatistics(
|
189 |
TableReference table |
190 |
); |
191 |
|
192 |
public CanModifyTableOperation createCanModifyTableOperation(
|
193 |
TableReference table |
194 |
); |
195 |
|
196 |
public ExecuteOperation createExecute(String sql); |
197 |
|
198 |
public UpdatePassThroughOperation createUpdatePassThroughOperation(
|
199 |
TableReference table, |
200 |
Object[] parameters, |
201 |
Expression filter
|
202 |
); |
203 |
|
204 |
public DeletePassThroughOperation createDeletePassThroughOperation(
|
205 |
TableReference table, |
206 |
Expression filter
|
207 |
); |
208 |
|
209 |
public RetrieveValueOperation createRetrieveValue(
|
210 |
TableReference createTableReference, |
211 |
String filter,
|
212 |
String order,
|
213 |
String fieldname
|
214 |
); |
215 |
|
216 |
|
217 |
} |