Statistics
| Revision:

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 @ 46064

History | View | Annotate | Download (7.02 KB)

1 45065 jjdelcerro
/**
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 43020 jjdelcerro
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 45473 fdiaz
import org.gvsig.expressionevaluator.Expression;
31
import org.gvsig.fmap.dal.SQLBuilder;
32 43020 jjdelcerro
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 44058 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters;
38 45165 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
39 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
40
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation;
41
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CalculateEnvelopeOfColumnOperation;
42
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanCreateTablesOperation;
43
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanModifyTableOperation;
44 45473 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation;
45 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation;
46 45473 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DeletePassThroughOperation;
47
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DropTableOperation;
48
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ExecuteOperation;
49 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureProviderByReferenceOperation;
50
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation;
51
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ListTablesOperation;
52
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation;
53
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation;
54 45473 fdiaz
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation;
55
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation;
56 43020 jjdelcerro
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation;
57
import org.gvsig.fmap.geom.primitive.Envelope;
58
59
public interface OperationsFactory {
60
61 44058 jjdelcerro
    public interface TableReference {
62
        public String getDatabase();
63
        public String getSchema();
64
        public String getTable();
65
        public String getSubquery();
66
        public boolean hasDatabase();
67
        public boolean hasSchema();
68
        public boolean hasTable();
69
        public boolean hasSubquery();
70
    }
71
72
    public TableReference createTableReference(
73 43020 jjdelcerro
            String database,
74
            String schema,
75
            String table,
76 44058 jjdelcerro
            String subquery
77
    );
78
79
    public TableReference createTableReference(JDBCStoreParameters params);
80
    public TableReference createTableReference(JDBCNewStoreParameters params);
81
82
    public FetchFeatureTypeOperation createFetchFeatureType(
83
            EditableFeatureType type,
84
            TableReference table,
85 43020 jjdelcerro
            List<String> primaryKeys,
86
            String defaultGeometryField,
87
            IProjection crs
88
    );
89 43377 jjdelcerro
90 45626 fdiaz
    public FetchFeatureTypeOperation createFetchFeatureType(
91
            EditableFeatureType type,
92
            TableReference table,
93
            List<String> primaryKeys,
94
            String defaultGeometryField,
95
            IProjection crs,
96
            int geometryType,
97
            int geometrySubtype
98
99
    );
100
101 43020 jjdelcerro
    public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
102
            FeatureReferenceProviderServices reference,
103
            FeatureType featureType,
104 44058 jjdelcerro
            TableReference table
105 43020 jjdelcerro
    );
106
107
    public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
108 44376 jjdelcerro
            FeatureType featureType,
109 44058 jjdelcerro
            TableReference table,
110 43020 jjdelcerro
            String columnName,
111
            String baseFilter,
112
            Envelope workingArea,
113
            IProjection crs
114
    );
115
116
    public PerformChangesOperation createPerformChanges(
117 44058 jjdelcerro
            TableReference table,
118 43020 jjdelcerro
            FeatureType type,
119
            Iterator deleteds,
120
            Iterator inserteds,
121
            Iterator updateds,
122
            Iterator featureTypesChanged
123
    );
124
125
    public AppendOperation createAppend(
126 44058 jjdelcerro
            TableReference table,
127 43020 jjdelcerro
            FeatureType type
128
    );
129
130
    public CountOperation createCount(
131 44376 jjdelcerro
            FeatureType featureType,
132 44058 jjdelcerro
            TableReference table,
133 43020 jjdelcerro
            String baseFilter,
134 44727 jjdelcerro
            FeatureQuery query
135 43020 jjdelcerro
    );
136
137
    public TableIsEmptyOperation createTableIsEmpty(
138 44376 jjdelcerro
            FeatureType featureType,
139 44058 jjdelcerro
            TableReference table,
140 43020 jjdelcerro
            String baseFilter,
141 46010 jjdelcerro
            FeatureQuery query
142 43020 jjdelcerro
    );
143
144
    public ResultSetForSetProviderOperation createResultSetForSetProvider(
145 44058 jjdelcerro
            TableReference table,
146 43020 jjdelcerro
            String baseFilter,
147
            String baseOrder,
148
            FeatureQuery query,
149
            FeatureType storeType,
150
            FeatureType setType,
151
            long limit,
152
            long offset,
153
            int fetchSize
154
    );
155
156
    public ListTablesOperation createListTables(
157
            int mode,
158 45165 jjdelcerro
            JDBCServerExplorerParameters baseParameters,
159 45627 fdiaz
            boolean informationTables,
160
            int tablesOrViews
161 43020 jjdelcerro
    );
162
163
    public DropTableOperation createDropTable(
164 44058 jjdelcerro
            TableReference table
165 43020 jjdelcerro
    );
166
167
    public CreateTableOperation createTable(
168 44058 jjdelcerro
            TableReference table,
169 43020 jjdelcerro
            FeatureType type,
170
            List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges,
171
            List<String> additionalSQLs
172
    ) throws DataException;
173
174
    public CanCreateTablesOperation createCanCreateTables();
175
176
    public UpdateTableStatisticsOperation createUpdateTableStatistics(
177 44058 jjdelcerro
            TableReference table
178 43020 jjdelcerro
    );
179
180
    public CanModifyTableOperation createCanModifyTableOperation(
181 44058 jjdelcerro
            TableReference table
182 43020 jjdelcerro
    );
183 43377 jjdelcerro
184
    public ExecuteOperation createExecute(String sql);
185
186 45473 fdiaz
    public UpdatePassThroughOperation createUpdatePassThroughOperation(
187
            TableReference table,
188
            Object[] parameters,
189
            Expression filter
190
    );
191
192
    public DeletePassThroughOperation createDeletePassThroughOperation(
193
            TableReference table,
194
            Expression filter
195
    );
196
197
198 43020 jjdelcerro
}