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

History | View | Annotate | Download (6.15 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.fmap.dal.exception.DataException;
31
import org.gvsig.fmap.dal.feature.EditableFeatureType;
32
import org.gvsig.fmap.dal.feature.FeatureQuery;
33
import org.gvsig.fmap.dal.feature.FeatureType;
34
import org.gvsig.fmap.dal.SQLBuilder;
35
import org.gvsig.fmap.dal.feature.spi.FeatureReferenceProviderServices;
36
import org.gvsig.fmap.dal.store.jdbc.JDBCNewStoreParameters;
37
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
38
import org.gvsig.fmap.dal.store.jdbc.JDBCStoreParameters;
39
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.AppendOperation;
40
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CalculateEnvelopeOfColumnOperation;
41
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanCreateTablesOperation;
42
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CanModifyTableOperation;
43
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CreateTableOperation;
44
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureProviderByReferenceOperation;
45
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.FetchFeatureTypeOperation;
46
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.TableIsEmptyOperation;
47
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ListTablesOperation;
48
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.PerformChangesOperation;
49
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.DropTableOperation;
50
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ResultSetForSetProviderOperation;
51
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.CountOperation;
52
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.ExecuteOperation;
53
import org.gvsig.fmap.dal.store.jdbc2.spi.operations.UpdateTableStatisticsOperation;
54
import org.gvsig.fmap.geom.primitive.Envelope;
55

    
56
public interface OperationsFactory {
57

    
58
    public interface TableReference {
59
        public String getDatabase();
60
        public String getSchema();
61
        public String getTable();
62
        public String getSubquery();
63
        public boolean hasDatabase();
64
        public boolean hasSchema();
65
        public boolean hasTable();
66
        public boolean hasSubquery();
67
    }
68
    
69
    public TableReference createTableReference(
70
            String database,
71
            String schema,
72
            String table,
73
            String subquery            
74
    );
75
    
76
    public TableReference createTableReference(JDBCStoreParameters params);
77
    public TableReference createTableReference(JDBCNewStoreParameters params);
78
    
79
    public FetchFeatureTypeOperation createFetchFeatureType(
80
            EditableFeatureType type,
81
            TableReference table,
82
            List<String> primaryKeys,
83
            String defaultGeometryField,
84
            IProjection crs
85
    );
86
    
87
    public FetchFeatureProviderByReferenceOperation createFetchFeatureProviderByReference(
88
            FeatureReferenceProviderServices reference,
89
            FeatureType featureType,
90
            TableReference table
91
    );
92

    
93
    public CalculateEnvelopeOfColumnOperation createCalculateEnvelopeOfColumn(
94
            FeatureType featureType,
95
            TableReference table,
96
            String columnName,
97
            String baseFilter,
98
            Envelope workingArea,
99
            IProjection crs
100
    );
101

    
102
    public PerformChangesOperation createPerformChanges(
103
            TableReference table,
104
            FeatureType type,
105
            Iterator deleteds,
106
            Iterator inserteds,
107
            Iterator updateds,
108
            Iterator featureTypesChanged
109
    );
110

    
111
    public AppendOperation createAppend(
112
            TableReference table,
113
            FeatureType type
114
    );
115

    
116
    public CountOperation createCount(
117
            FeatureType featureType,
118
            TableReference table,
119
            String baseFilter,
120
            FeatureQuery query
121
    );
122

    
123
    public TableIsEmptyOperation createTableIsEmpty(
124
            FeatureType featureType,
125
            TableReference table,
126
            String baseFilter,
127
            String filtersql
128
    );
129

    
130
    public ResultSetForSetProviderOperation createResultSetForSetProvider(
131
            TableReference table,
132
            String baseFilter,
133
            String baseOrder,
134
            FeatureQuery query,
135
            FeatureType storeType,
136
            FeatureType setType,
137
            long limit,
138
            long offset,
139
            int fetchSize
140
    );
141

    
142
    public ListTablesOperation createListTables(
143
            int mode,
144
            JDBCServerExplorerParameters baseParameters,
145
            boolean informationTables
146
    );
147

    
148
    public DropTableOperation createDropTable(
149
            TableReference table
150
    );
151

    
152
    public CreateTableOperation createTable(
153
            TableReference table,
154
            FeatureType type,
155
            List<Pair<String, SQLBuilder.Privilege>> userAndPrivileges,
156
            List<String> additionalSQLs
157
    ) throws DataException;
158

    
159
    public CanCreateTablesOperation createCanCreateTables();
160
    
161
    public UpdateTableStatisticsOperation createUpdateTableStatistics(
162
            TableReference table
163
    );
164

    
165
    public CanModifyTableOperation createCanModifyTableOperation(
166
            TableReference table
167
    );
168
    
169
    public ExecuteOperation createExecute(String sql);
170
    
171
}