Revision 2698

View differences:

org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceChanges.java
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.vcsgis.lib.workspace;
23

  
24
import java.util.Iterator;
25
import java.util.function.Predicate;
26
import org.gvsig.tools.swing.api.ChangeListenerSupport;
27
import org.gvsig.tools.util.GetItemWithSize64;
28

  
29
/**
30
 *
31
 * @author gvSIG Team
32
 * @param <CHANGE>
33
 */
34
public interface VCSGisWorkspaceChanges<CHANGE> extends GetItemWithSize64<CHANGE>, ChangeListenerSupport {
35

  
36
    public void addSelectionInterval(long start, long end);
37

  
38
    public void removeSelectionInterval(long start, long end);
39

  
40
    public void setSelectionInterval(long start, long end);
41

  
42
    public void clearSelection();
43

  
44
    public void process(Iterator<Long> rows, Predicate<CHANGE> action);
45

  
46
    public boolean isSelectedIndex(long index);
47

  
48
    public boolean isSelectionEmpty();
49

  
50
    public void setSelectionAll();
51
    
52
}
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceEntity.java
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.vcsgis.lib.workspace;
23

  
24
import org.gvsig.fmap.dal.feature.FeatureType;
25
import org.gvsig.vcsgis.lib.VCSGisEntityEditable;
26

  
27
/**
28
 *
29
 * @author gvSIG Team
30
 */
31
public interface VCSGisWorkspaceEntity extends VCSGisEntityEditable {
32

  
33
    public String getLocalRevisionCode();
34

  
35
    public VCSGisWorkspaceEntity setLocalRevisionCode(String revisionCode);
36

  
37
    public FeatureType getFeatureType();
38

  
39
    public long getCountLocalChanges();
40

  
41
    /**
42
     * Return the state of the entity.
43
     * This operation is an expensive operation.
44
     * @return the state
45
     */
46
    public int getState();
47
    
48
}
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceDescriptor.java
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.vcsgis.lib.workspace;
23

  
24
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
25
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
26
import org.gvsig.tools.persistence.Persistent;
27
import org.gvsig.tools.util.LabeledValue;
28
import org.gvsig.vcsgis.lib.workspace.VCSGisWorkspace;
29

  
30
/**
31
 *
32
 * @author gvSIG Team
33
 */
34
public interface VCSGisWorkspaceDescriptor 
35
        extends LabeledValue<VCSGisWorkspaceDescriptor>, Persistent
36
    {
37
    public String getCode();
38
    
39
    public boolean isWorkspaceInitialized();
40

  
41
    public VCSGisWorkspace getWorkspace();
42
    
43
    public JDBCServerExplorer getExplorer();
44
    
45
    public JDBCServerExplorerParameters getExplorerParameters();
46
    
47
}
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceRevision.java
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.vcsgis.lib.workspace;
23

  
24
import org.gvsig.vcsgis.lib.VCSGisRevision;
25

  
26
/**
27
 *
28
 * @author gvSIG Team
29
 */
30
public interface VCSGisWorkspaceRevision extends VCSGisRevision {}
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspace.java
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.vcsgis.lib.workspace;
23

  
24
import org.gvsig.vcsgis.lib.repository.VCSGisRepositoryChange;
25
import org.gvsig.vcsgis.lib.VCSGisChange;
26
import java.sql.Timestamp;
27
import java.util.Iterator;
28
import java.util.List;
29
import java.util.function.Predicate;
30
import javax.json.JsonObject;
31
import org.gvsig.fmap.dal.feature.Feature;
32
import org.gvsig.fmap.dal.feature.FeatureReference;
33
import org.gvsig.fmap.dal.feature.FeatureStore;
34
import org.gvsig.fmap.dal.feature.FeatureType;
35
import org.gvsig.fmap.dal.store.jdbc.JDBCServerExplorerParameters;
36
import org.gvsig.fmap.dal.store.jdbc2.JDBCServerExplorer;
37
import org.gvsig.tools.dispose.Disposable;
38
import org.gvsig.tools.swing.api.ChangeListenerSupport;
39
import org.gvsig.tools.util.GetItemWithSize64;
40
import org.gvsig.vcsgis.lib.VCSGisEntity;
41
import org.gvsig.vcsgis.lib.VCSGisRevision;
42
import org.gvsig.vcsgis.lib.repository.VCSGisRepository;
43

  
44
/**
45
 *
46
 * @author gvSIG Team
47
 */
48
public interface VCSGisWorkspace extends Disposable {
49

  
50

  
51
    public static final int ERR_OK = 0;
52
    public static final int ERR_NO_ERROR = ERR_OK;
53
    public static final int ERR_DBFILE_IS_NULL = 1;
54
    public static final int ERR_WSEXPLORER_IS_NULL = 2;
55
    public static final int ERR_CANT_OPEN_WORKSPACE = 3;
56
    public static final int ERR_CANT_OPEN_WORKSPACE_SERVEREXPLORER = 4;
57
    public static final int ERR_STORE_NOT_IN_VERSION_CONTROL = 5;
58
    public static final int ERR_LABEL_IS_NULL = 6;
59

  
60
    public static final int ERR_CANT_CREATE_TABLE = 10;
61
    public static final int ERR_CANT_CREATE_TABLE_CONFIG = 11;
62
    public static final int ERR_CANT_CREATE_TABLE_ENTITIES = 12;
63
    public static final int ERR_CANT_CREATE_TABLE_CHANGES = 13;
64
    
65
    public static final int ERR_ENTITY_ALREADY_EXISTS = 20;
66
    public static final int ERR_ENTITY_NOT_HAS_VCSGISCODE = 21;
67
    public static final int ERR_CANT_OPEN_ENTITIES = 22;
68
    public static final int ERR_CANT_INSERT_ENTITIES = 23;
69
    public static final int ERR_ENTITY_NOT_EXISTS = 24;
70
    public static final int ERR_CANT_RETRIEVE_ENTITIES = 25;
71
    
72
    public static final int ERR_CANT_OPEN_CHANGES = 30;
73
    public static final int ERR_CANT_INSERT_CHANGE = 31;
74

  
75
    public static final int ERR_CANT_OPEN_STORE = 40;
76
    public static final int ERR_CANT_RETRIEVE_SOURCE_FEATURES = 41;
77
    public static final int ERR_CANT_INSERT_FEATURES = 42;
78

  
79
    public static final int ERR_CANT_COMMIT = 50;
80
    public static final int ERR_CANT_COMMIT_WORKSPACE_OUTDATED = 51;
81

  
82
    public static final int ERR_CANT_CHECKOUT = 60;
83
    
84
    public static final int ERR_CANT_UPDATE_ENTITIES = 70;
85

  
86
    public static final int ERR_CANT_UPDATE = 80;
87
    public static final int ERR_CANT_PREPARE_UPDATE = 81;
88
    
89
    public static final int STATE_UNMODIFIED = 0;
90
    public static final int STATE_NEW = 1;
91
    public static final int STATE_MODIFIED = 2;
92
    public static final int STATE_OUTDATED = 4;    
93
    public static final int STATE_OUTDATED_AND_MODIFIED = 6;    
94
    public static final int STATE_CONFLICT = 8;    
95

  
96
    
97

  
98
    
99
    
100
    
101
          
102
    public String getCode();
103
    
104
    public String getLabel();
105
    
106
    public String getErrorMessage(int errcode);
107
    
108
    public JDBCServerExplorer getExplorer();
109
    
110
    public JDBCServerExplorerParameters getExplorerParameters();
111
    
112
    public FeatureStore getFeatureStore(String tableName);
113
    
114
    public void create_table(String name);
115

  
116
    public int addEntity(FeatureType featureType, String name, String description, String fieldForLabel);
117

  
118
    public int add(String name, FeatureStore store, String fieldForLabel);
119

  
120
    public int addChange(int changeCode, FeatureStore store, Feature feature);
121

  
122
    public int addChanges(
123
            FeatureStore store, 
124
            Iterator<Feature> insertedsFeatures, 
125
            Iterator<Feature> updatedsFeatures, 
126
            Iterator<FeatureReference> deletedsFeatures
127
    );
128

  
129
    public int commit();
130
    
131
    public int commit(Timestamp date, String comment);
132

  
133
    public int checkout(String tableName);
134
    
135
    public int updatePrepare(String tableName);
136
    
137
    public int update(String tableName, boolean prepare);
138
    
139
    public int update(String tableName);
140

  
141
    public int updateClean(String tableName);
142
    
143
    public int updateEntities();
144
    
145
    public VCSGisWorkspaceChanges<VCSGisRepositoryChange> getRemoteChanges();
146
    
147
    public VCSGisWorkspaceChanges<VCSGisWorkspaceChange> getLocalChanges();
148

  
149
    public VCSGisWorkspaceChanges<VCSGisWorkspaceChange> getLocalChangesByEntityCode(String entityCode);
150

  
151
    public VCSGisWorkspaceChanges<VCSGisWorkspaceChange> getLocalChangesByEntityName(String entityName);
152
    
153
    public List<VCSGisEntity> getRepositoryEntities();
154

  
155
    public List<VCSGisWorkspaceEntity> getWorkspaceEntities();
156
        
157
    public VCSGisWorkspaceEntity getWorkspaceEntityByName(String entityName);
158

  
159
    public VCSGisWorkspaceEntity getWorkspaceEntityByCode(String entityCode);
160
    
161
    public String createUniqueFeatureCode();
162
    
163
    public VCSGisRepository getRepository();
164

  
165
    public List<VCSGisWorkspaceEntity> getEntitiesOfRemoteChanges();
166

  
167
    public int log(String tableName);
168

  
169
    public List<VCSGisWorkspaceRevision> getRemoteRevisions(String tableName);
170
}
org.gvsig.vcsgis/trunk/org.gvsig.vcsgis/org.gvsig.vcsgis.lib/org.gvsig.vcsgis.lib.api/src/main/java/org/gvsig/vcsgis/lib/workspace/VCSGisWorkspaceChange.java
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.vcsgis.lib.workspace;
23

  
24
import org.gvsig.fmap.dal.feature.Feature;
25
import org.gvsig.vcsgis.lib.VCSGisChange;
26

  
27
/**
28
 *
29
 * @author gvSIG Team
30
 */
31
public interface VCSGisWorkspaceChange extends VCSGisChange {
32

  
33
    public Feature getRelatedFeature();
34
    
35
}

Also available in: Unified diff