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

History | View | Annotate | Download (6.99 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.TableIsEmptyOperation;
55
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdatePassThroughOperation;
56
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
    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
            String database,
74
            String schema,
75
            String table,
76
            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
            List<String> primaryKeys,
86
            String defaultGeometryField,
87
            IProjection crs
88
    );
89
    
90
    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
    public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
102
            FeatureReferenceProviderServices reference,
103
            FeatureType featureType,
104
            TableReference table
105
    );
106

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

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

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

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

    
137
    public TableIsEmptyOperation createTableIsEmpty(
138
            FeatureType featureType,
139
            TableReference table,
140
            String baseFilter,
141
            String filtersql
142
    );
143

    
144
    public ResultSetForSetProviderOperation createResultSetForSetProvider(
145
            TableReference table,
146
            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
            JDBCServerExplorerParameters baseParameters,
159
            boolean informationTables
160
    );
161

    
162
    public DropTableOperation createDropTable(
163
            TableReference table
164
    );
165

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

    
173
    public CanCreateTablesOperation createCanCreateTables();
174
    
175
    public UpdateTableStatisticsOperation createUpdateTableStatistics(
176
            TableReference table
177
    );
178

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

    
191
    public DeletePassThroughOperation createDeletePassThroughOperation(
192
            TableReference table,
193
            Expression filter
194
    );
195

    
196

    
197
}