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

History | View | Annotate | Download (7.29 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.store.jdbc.JDBCNewStoreParameters;
38
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
39
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
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation;
45
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation;
46
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
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
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.RetrieveValueOperation;
55
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation;
56
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation;
57
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation;
58
import org.gvsig.fmap.geom.primitive.Envelope;
59

    
60
public interface OperationsFactory {
61

    
62
    public interface TableReference {
63
        public String getDatabase();
64
        public String getSchema();
65
        public String getTable();
66
        public String getSubquery();
67
        public boolean hasDatabase();
68
        public boolean hasSchema();
69
        public boolean hasTable();
70
        public boolean hasSubquery();
71
    }
72
    
73
    public TableReference createTableReference(
74
            String database,
75
            String schema,
76
            String table,
77
            String subquery            
78
    );
79
    
80
    public TableReference createTableReference(JDBCStoreParameters params);
81
    public TableReference createTableReference(JDBCNewStoreParameters params);
82
    
83
    public FetchFeatureTypeOperation createFetchFeatureType(
84
            EditableFeatureType type,
85
            TableReference table,
86
            List<String> primaryKeys,
87
            String defaultGeometryField,
88
            IProjection crs
89
    );
90
    
91
    public FetchFeatureTypeOperation createFetchFeatureType(
92
            EditableFeatureType type,
93
            TableReference table,
94
            List<String> primaryKeys,
95
            String defaultGeometryField,
96
            IProjection crs,
97
            int geometryType,
98
            int geometrySubtype
99
            
100
    );
101
    
102
    public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
103
            FeatureReferenceProviderServices reference,
104
            FeatureType featureType,
105
            TableReference table
106
    );
107

    
108
    public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
109
            FeatureType featureType,
110
            TableReference table,
111
            String columnName,
112
            String baseFilter,
113
            Envelope workingArea,
114
            IProjection crs
115
    );
116

    
117
    public PerformChangesOperation createPerformChanges(
118
            TableReference table,
119
            FeatureType type,
120
            Iterator deleteds,
121
            Iterator inserteds,
122
            Iterator updateds,
123
            Iterator featureTypesChanged
124
    );
125

    
126
    public AppendOperation createAppend(
127
            TableReference table,
128
            FeatureType type
129
    );
130

    
131
    public CountOperation createCount(
132
            FeatureType featureType,
133
            TableReference table,
134
            String baseFilter,
135
            FeatureQuery query
136
    );
137

    
138
    public TableIsEmptyOperation createTableIsEmpty(
139
            FeatureType featureType,
140
            TableReference table,
141
            String baseFilter,
142
            FeatureQuery query
143
    );
144

    
145
    public ResultSetForSetProviderOperation createResultSetForSetProvider(
146
            TableReference table,
147
            String baseFilter,
148
            String baseOrder,
149
            FeatureQuery query,
150
            FeatureType storeType,
151
            FeatureType setType,
152
            long limit,
153
            long offset,
154
            int fetchSize
155
    );
156

    
157
    public ListTablesOperation createListTables(
158
            int mode,
159
            JDBCServerExplorerParameters baseParameters,
160
            boolean informationTables,
161
            int tablesOrViews
162
    );
163

    
164
    public DropTableOperation createDropTable(
165
            TableReference table
166
    );
167

    
168
    public CreateTableOperation createTable(
169
            TableReference table,
170
            FeatureType type,
171
            List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges,
172
            List<String> additionalSQLs
173
    ) throws DataException;
174

    
175
    public CanCreateTablesOperation createCanCreateTables();
176
    
177
    public UpdateTableStatisticsOperation createUpdateTableStatistics(
178
            TableReference table
179
    );
180

    
181
    public CanModifyTableOperation createCanModifyTableOperation(
182
            TableReference table
183
    );
184
    
185
    public ExecuteOperation createExecute(String sql);
186
    
187
    public UpdatePassThroughOperation createUpdatePassThroughOperation(
188
            TableReference table,
189
            Object[] parameters, 
190
            Expression filter
191
    );
192

    
193
    public DeletePassThroughOperation createDeletePassThroughOperation(
194
            TableReference table,
195
            Expression filter
196
    );
197

    
198
    public RetrieveValueOperation createRetrieveValue(
199
            TableReference createTableReference, 
200
            String filter, 
201
            String order, 
202
            String fieldname
203
    );
204

    
205

    
206
}