Statistics
| Revision:

gvsig-projects-pool / org.gvsig.vcsgis / trunk / org.gvsig.vcsgis / org.gvsig.vcsgis.lib / org.gvsig.vcsgis.lib.api / src / main / java / org / gvsig / vcsgis / lib / VCSGisRepository.java @ 2381

History | View | Annotate | Download (4.1 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.vcsgis.lib;
23

    
24
import java.sql.Timestamp;
25
import java.util.Collection;
26
import java.util.Iterator;
27
import java.util.List;
28
import javax.json.JsonObject;
29
import org.gvsig.json.SupportJson;
30
import org.gvsig.tools.dispose.DisposableIterable;
31
import org.gvsig.tools.dispose.DisposableIterator;
32
import org.gvsig.tools.util.GetItemWithSize64;
33

    
34
/**
35
 *
36
 * @author gvSIG Team
37
 */
38
public interface VCSGisRepository extends SupportJson {
39

    
40
    public interface RepoEntity {
41
        public String getCode();
42
        public String getBranchCode();
43
        public String getLastRevisionCode();
44
        public String getUserCode();
45
        public String getTopologyPlanCode();
46
        public String getBranchName();
47
        public String getEntityName();
48
        public String getDataTableName();
49
        public String getGeometryFieldName();
50
        public String getFeatureIdFieldName();
51
        public String getDescription();
52
        public String getDefaultBranchName();
53
        public String getFeatureTypeAsJson();
54
    }
55
    
56
    public interface CommitRequest {
57
        
58
        public void add_entity(
59
                String name, 
60
                String entityCode, 
61
                String revisionCode, 
62
                String featureIdFieldName, 
63
                String geometryFieldName, 
64
                String featureType,
65
                String userCode
66
        );
67

    
68
        public void add_used_entity(
69
                String entityCode, 
70
                String revisionCode, 
71
                String branchName,
72
                String userCode, 
73
                Timestamp date
74
        );
75

    
76
        public void change_data(
77
                int operation, 
78
                String entityCode, 
79
                String featureCode, 
80
                String data
81
        );
82
        
83
        public void check_versions() throws VCSGIsOutOfDateException;
84

    
85
        public void process() throws VCSGIsOutOfDateException;
86
        
87
        public List<RepoEntity> getEntities();
88
        
89
        public RepoEntity getUsedEntity(String name);
90
        
91
        public Collection<RepoEntity> getUsedEntities();
92
        
93
        public void abort();
94

    
95
    }
96
    
97
    public interface CheckoutRequest {
98
        public GetItemWithSize64<JsonObject> getFeatures();
99

    
100
        public RepoEntity getEntity();        
101

    
102
        public void abort();
103
    }
104
    
105
    public interface UpdateRequest {
106
        
107
        public interface Data {
108

    
109
            public String getCode();
110

    
111
            public String getData();
112

    
113
            public String getEntityCode();
114

    
115
            public String getDataCode();
116

    
117
            public int getOperation();
118

    
119
            public String getRevisionCode();
120

    
121
            public int getRevisionNumber();
122
            
123
        }
124
        
125
        public DisposableIterable<Data> getUpdates();
126
        public DisposableIterable<Data> getDeleteds();
127
        public DisposableIterable<Data> getInserteds();
128

    
129
        public RepoEntity getEntity();        
130

    
131
        public void abort();
132
    }
133
    
134
    public CommitRequest createCommitRequest();
135

    
136
    public CheckoutRequest createCheckoutRequest(String entityName, String brachName);
137
    
138
    public UpdateRequest createUpdateRequest(String entityName, String brachName, String fromRevisionCode);
139
    
140
    public List<RepoEntity> getEntities();
141
    
142
}