Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / DataTransaction.java @ 46723

History | View | Annotate | Download (2.59 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.fmap.dal;
23

    
24
import org.gvsig.fmap.dal.exception.DataException;
25
import org.gvsig.fmap.dal.feature.FeatureStore;
26
import org.gvsig.tools.dispose.Disposable;
27
import org.gvsig.tools.observer.Observable;
28

    
29
/**
30
 *
31
 * @author gvSIG Team
32
 */
33
public interface DataTransaction extends Disposable, AutoCloseable, Observable {
34

    
35
    public static void rollbackQuietly(DataTransaction transaction) {
36
        if( transaction == null ) {
37
            return;
38
        }
39
        transaction.rollbackQuietly();
40
    }
41
    
42
    public String getCode();
43
    
44
    public void begin() throws DataException;
45
    
46
    public void commit() throws DataException;
47
    
48
    public void rollback() throws DataException;
49

    
50
    public void rollbackQuietly();
51
    
52
    public void add(DataStore store) throws DataException;
53
    
54
    public void add(DataStore store, boolean local) throws DataException;
55

    
56
    public void add(DataServerExplorer explorer) throws DataException;
57
    
58
    public void add(DataServerExplorer explorer, boolean local) throws DataException;
59

    
60
    public void add(Disposable resource) throws DataException;
61
    
62
    public void add(DataServerExplorer explorer, String id);
63

    
64
    public void add(DataServerExplorer explorer, String id, boolean local);
65

    
66
    public void add(DataStore store, String id);
67

    
68
    public void add(DataStore store, String id, boolean local);
69

    
70
    public void remove(DataStore store) throws DataException;
71
    
72
    public void remove(DataServerExplorer serverExplorer);
73
    
74
    public boolean isInProgress();
75
    
76
    public boolean contains(DataServerExplorer explorer);
77
    
78
    public boolean contains(DataStore store);
79

    
80
    public FeatureStore getFeatureStore(String id);
81

    
82
    public DataServerExplorer getServerExplorer(String id);
83
}