gvsig-projects-pool / org.gvsig.online / trunk / org.gvsig.online / org.gvsig.online.lib / org.gvsig.online.lib.api / src / main / java / org / gvsig / online / lib / api / workingcopy / OnlineWorkingcopy.java @ 9515
History | View | Annotate | Download (7.26 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, see <https://www.gnu.org/licenses/>.
|
18 |
*
|
19 |
* For any additional information, do not hesitate to contact us
|
20 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
21 |
*/
|
22 |
package org.gvsig.online.lib.api.workingcopy; |
23 |
|
24 |
import java.util.List; |
25 |
import org.apache.commons.lang3.mutable.MutableLong; |
26 |
import org.apache.commons.lang3.mutable.MutableObject; |
27 |
import org.gvsig.fmap.dal.OpenDataStoreParameters; |
28 |
import org.gvsig.fmap.dal.feature.Feature; |
29 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
30 |
import org.gvsig.fmap.dal.feature.FeatureType; |
31 |
import org.gvsig.fmap.dal.feature.OpenFeatureStoreParameters; |
32 |
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters; |
33 |
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer; |
34 |
import org.gvsig.fmap.geom.primitive.Envelope; |
35 |
import org.gvsig.online.lib.api.OnlineProject; |
36 |
import org.gvsig.online.lib.api.OnlineSite; |
37 |
import org.gvsig.online.lib.api.OnlineUserIdentificationRequester; |
38 |
import org.gvsig.tools.dispose.Disposable; |
39 |
import org.gvsig.tools.task.SimpleTaskStatus; |
40 |
|
41 |
/**
|
42 |
*
|
43 |
* @author gvSIG Team
|
44 |
*/
|
45 |
public interface OnlineWorkingcopy extends Disposable { |
46 |
|
47 |
public static final String TABLE_NAME_ENTITIES = "ONLINE_ENTITIES"; |
48 |
|
49 |
public static final String AUTODETECT_FLAG = "@AUTODETECT"; |
50 |
public static final String CATEGORY_DETECT = AUTODETECT_FLAG; |
51 |
public static final String DATAMODEL_DETECT = AUTODETECT_FLAG; |
52 |
public static final String RESOURCES_DETECT = AUTODETECT_FLAG; |
53 |
public static final String FIELDFORLABEL_DETECT = AUTODETECT_FLAG; |
54 |
public static final String LABEL_DETECT = AUTODETECT_FLAG; |
55 |
|
56 |
public String getCode(); |
57 |
|
58 |
public String getLabel(); |
59 |
|
60 |
public String getErrorMessage(int errcode); |
61 |
|
62 |
public JDBCServerExplorer getExplorer();
|
63 |
|
64 |
public JDBCServerExplorerParameters getExplorerParameters();
|
65 |
|
66 |
/**
|
67 |
* Return the store associted to the tableName.
|
68 |
* The store don't by used to edit.
|
69 |
* The store don't load the associted resources.
|
70 |
* The store is chached, and next calls return the same instance.
|
71 |
*
|
72 |
* @param tableName
|
73 |
* @return
|
74 |
*/
|
75 |
public FeatureStore getFeatureStore(String tableName); |
76 |
|
77 |
/**
|
78 |
* Return the store associted to the tableName.
|
79 |
* The store is not cached, every call to this method create a new store.
|
80 |
*
|
81 |
* @param tableName
|
82 |
* @param ignoreDALResource
|
83 |
* @return
|
84 |
*/
|
85 |
public FeatureStore openFeatureStore(String tableName, boolean ignoreDALResource); |
86 |
|
87 |
public FeatureType getFeatureType(String tableName); |
88 |
|
89 |
public void forceReloadWorkspaceEntities(); |
90 |
|
91 |
public void reloadWorkspaceEntities(); |
92 |
|
93 |
public void create_table(String name); |
94 |
|
95 |
public void create_table(OnlineEntity entity); |
96 |
|
97 |
// public int add(String name, FeatureStore store, String fieldForLabel);
|
98 |
//
|
99 |
// public int add(String name, FeatureStore store, String fieldForLabel, String category, String label);
|
100 |
//
|
101 |
// public int add(String name, FeatureStore source, String fieldForLabel, String category, String label, String model, String resources, String pkName, boolean importData, SimpleTaskStatus status);
|
102 |
|
103 |
public int addEntity(FeatureType featureType, String name, String description, String fieldForLabel, String label, String pkName, int tileSize); |
104 |
|
105 |
public OnlineChanges<OnlineRemoteChange> getRemoteChanges();
|
106 |
|
107 |
public OnlineChanges<OnlineRemoteChange> getRemoteChangesByEntity(String... entityName); |
108 |
|
109 |
public OnlineChanges<OnlineWorkingcopyChange> getLocalChanges();
|
110 |
|
111 |
public OnlineChanges<OnlineWorkingcopyChange> getLocalChanges(List<OnlineEntity> entities); |
112 |
|
113 |
public boolean hasLocalChanges(List<OnlineEntity> entities); |
114 |
|
115 |
public List<OnlineEntity> getWorkspaceEntities(); |
116 |
|
117 |
public OnlineEntity getWorkspaceEntity(String entity); |
118 |
|
119 |
public OnlineEntity getWorkspaceEntityByName(String entityName); |
120 |
|
121 |
public OnlineEntity getWorkspaceEntityByCode(String entityCode); |
122 |
|
123 |
public boolean existsInWorkspace(OnlineEntity entity); |
124 |
|
125 |
public boolean existsInWorkspace(OpenFeatureStoreParameters parameters); |
126 |
|
127 |
public String createUniqueCode(); |
128 |
|
129 |
public OnlineEntity getEntity(String entityName); |
130 |
|
131 |
public OnlineSite getSite();
|
132 |
|
133 |
public OnlineProject getProject();
|
134 |
|
135 |
public List<OnlineEntity> getEntitiesOfRemoteChanges(); |
136 |
|
137 |
public List<OnlineEntity> getEntitiesOfLocalChanges(); |
138 |
|
139 |
public void addToConnectionPool(); |
140 |
|
141 |
public boolean isInMyDatabase(FeatureStore store); |
142 |
|
143 |
public boolean isInMyDatabase(OpenFeatureStoreParameters parameters); |
144 |
|
145 |
public boolean isInMyDatabase(String tableName); |
146 |
|
147 |
public Feature getRelatedFeature(OnlineEntity entity, long featureCode); |
148 |
|
149 |
public Feature getRelatedFeature(OnlineRemoteChange change);
|
150 |
|
151 |
public int removeEntity(OnlineEntity entity); |
152 |
|
153 |
public int removeEntities(List<String> namesOrCodes); |
154 |
|
155 |
public int revert(String nameOrCode); |
156 |
|
157 |
public int revert(String nameOrCode, SimpleTaskStatus status); |
158 |
|
159 |
public List<OnlineEntity> getEntitiesWithSelectedChanges(); |
160 |
|
161 |
public List<String> getDataModels(); |
162 |
|
163 |
public void logout(); |
164 |
|
165 |
public OpenDataStoreParameters createOpenStoreParameters(String tableName); |
166 |
|
167 |
public void registerDataModelRepository(String modelName); |
168 |
|
169 |
public void setOffline(boolean offline); |
170 |
|
171 |
public boolean isOffline(); |
172 |
|
173 |
public String getEntityLabelTemplate(); |
174 |
|
175 |
public String formatEntityLabel(OnlineEntity entity); |
176 |
|
177 |
public void setConfigValue(String name, String value); |
178 |
|
179 |
public void download_config(boolean overwrite, SimpleTaskStatus status); |
180 |
|
181 |
public void download_resources(boolean overwrite, SimpleTaskStatus status); |
182 |
|
183 |
public int download(String name, Envelope workingAream, SimpleTaskStatus status); |
184 |
|
185 |
public boolean canUpload(); |
186 |
|
187 |
public boolean canUpload(MutableObject<String> message); |
188 |
|
189 |
public boolean canUpload(MutableObject<String> message, List<String> entityCodes); |
190 |
|
191 |
public int removeRemoteChanges(String entityName); |
192 |
|
193 |
public int removeRemoteChanges(String entityCode, SimpleTaskStatus status); |
194 |
|
195 |
public boolean canUpdate(MutableObject<String> msg, String entityName); |
196 |
|
197 |
public boolean updateNeedMerge(String entityName); |
198 |
|
199 |
public int update(String entityName, SimpleTaskStatus taskStatus); |
200 |
|
201 |
public int merge(String tableName, MutableLong localChangesCreated, SimpleTaskStatus simpleTaskStatus); |
202 |
|
203 |
public int synchronize(OnlineEntity entity, Envelope workingArea, SimpleTaskStatus taskStatus); |
204 |
|
205 |
public WorkingArea getCurrentWorkingArea();
|
206 |
|
207 |
public void setCurrentWorkingArea(WorkingArea workingArea); |
208 |
|
209 |
} |