Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / feature / spi / AbstractFeatureStoreProvider.java @ 23874

History | View | Annotate | Download (2.92 KB)

1
package org.gvsig.fmap.data.feature.spi;
2

    
3
import java.util.Iterator;
4

    
5
import org.gvsig.fmap.data.DataExplorer;
6
import org.gvsig.fmap.data.exceptions.CloseException;
7
import org.gvsig.fmap.data.exceptions.DataException;
8
import org.gvsig.fmap.data.exceptions.InitializeException;
9
import org.gvsig.fmap.data.exceptions.OpenException;
10
import org.gvsig.fmap.data.exceptions.ReadException;
11
import org.gvsig.fmap.data.feature.FeatureReference;
12
import org.gvsig.fmap.data.feature.FeatureType;
13
import org.gvsig.fmap.data.feature.exceptions.PerformEditingException;
14
import org.gvsig.fmap.geom.primitive.Envelope;
15
import org.gvsig.metadata.Metadata;
16
import org.gvsig.tools.exception.BaseException;
17
import org.slf4j.Logger;
18
import org.slf4j.LoggerFactory;
19

    
20
import com.iver.utiles.XMLEntity;
21
import com.iver.utiles.XMLException;
22

    
23

    
24
public abstract class AbstractFeatureStoreProvider implements
25
                FeatureStoreProvider {
26

    
27
        protected FeatureStoreProviderServices store;
28
        protected Logger logger;
29

    
30
        public AbstractFeatureStoreProvider() {
31
                this.store = null;
32
                this.logger = null;
33
        }
34

    
35

    
36
        public FeatureStoreProvider initialize(FeatureStoreProviderServices store)
37
                        throws InitializeException {
38
                this.store = store;
39
                this.logger = null;
40
                return this;
41
        }
42

    
43
        public FeatureStoreProviderServices getStoreServices() {
44
                return this.store;
45
        }
46

    
47
        public String getClassName() {
48
                return this.getClass().getName();
49
        }
50

    
51
        public Logger getLogger() {
52
                if (this.logger == null) {
53
                        this.logger = LoggerFactory.getLogger(this.getClass());
54
                }
55
                return this.logger;
56
        }
57

    
58
        public boolean allowWrite() {
59
                return false;
60
        }
61

    
62
        public boolean isLocksSupported() {
63
                return false;
64
        }
65

    
66
        public FeatureData createFeatureData(FeatureType type) throws DataException {
67
                return this.store.createDefaultFeatureData(type);
68
        }
69

    
70
        public FeatureLocks createFeatureLocks() throws DataException {
71
                return this.store.createDefaultFeatureLocks();
72
        }
73

    
74
        public FeatureSelection createFeatureSelection() throws DataException {
75
                return this.store.createDefaultFeatureSelection();
76
        }
77

    
78
        public TemporaryContainer createTemporaryContainer() throws DataException {
79
                return this.store.createDefaultTemporaryContainer();
80
        }
81

    
82
        public void refresh() throws OpenException {
83
                // Do nothing by default
84
        }
85

    
86
        public void close() throws CloseException {
87
                // Do nothing by default
88
        }
89

    
90
        public void dispose() throws CloseException {
91
                // Do nothing by default
92
        }
93

    
94
        public Iterator getChilds() {
95
                return null;
96
        }
97

    
98
        public Envelope getEnvelope() {
99
                return null;
100
        }
101

    
102
        public Metadata getMetadata() throws BaseException {
103
                return null;
104
        }
105

    
106
        public XMLEntity getXMLEntity() throws XMLException {
107
                return null;
108
        }
109

    
110
        public void setXMLEntity(XMLEntity arg0) throws XMLException {
111

    
112
        }
113

    
114
        public abstract DataExplorer getExplorer() throws ReadException;
115

    
116
        public abstract FeatureData getFeatureDataByReference(FeatureReference reference, FeatureType featureType)
117
                        throws DataException;
118

    
119
        public abstract void performEditing() throws PerformEditingException;
120

    
121

    
122
}