Statistics
| Revision:

svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / spi / AbstractFeatureStoreProvider.java @ 25587

History | View | Annotate | Download (3.06 KB)

1 24496 jmvivo
package org.gvsig.fmap.dal.feature.spi;
2 23772 jjdelcerro
3
import java.util.Iterator;
4
5 24496 jmvivo
import org.gvsig.fmap.dal.DALLocator;
6 24874 jmvivo
import org.gvsig.fmap.dal.DataServerExplorer;
7 25420 cordinyana
import org.gvsig.fmap.dal.exception.*;
8 25587 vcaballero
import org.gvsig.fmap.dal.feature.FeatureLocks;
9 24496 jmvivo
import org.gvsig.fmap.dal.feature.FeatureSelection;
10
import org.gvsig.fmap.dal.feature.FeatureType;
11 24505 jmvivo
import org.gvsig.fmap.dal.feature.exception.PerformEditingException;
12 24496 jmvivo
import org.gvsig.fmap.dal.feature.impl.expansionadapter.ExpansionAdapter;
13
import org.gvsig.fmap.dal.feature.impl.expansionadapter.MemoryExpansionAdapter;
14
import org.gvsig.fmap.dal.resource.spi.ResourceManagerProviderServices;
15
import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
16 23772 jjdelcerro
import org.gvsig.fmap.geom.primitive.Envelope;
17
import org.gvsig.metadata.Metadata;
18 25420 cordinyana
import org.gvsig.metadata.exceptions.MetadataNotFoundException;
19 23874 jjdelcerro
import org.slf4j.Logger;
20
import org.slf4j.LoggerFactory;
21 23772 jjdelcerro
22
23
public abstract class AbstractFeatureStoreProvider implements
24
                FeatureStoreProvider {
25
26 23820 jjdelcerro
        protected FeatureStoreProviderServices store;
27 23874 jjdelcerro
        protected Logger logger;
28 23772 jjdelcerro
29 23874 jjdelcerro
        public AbstractFeatureStoreProvider() {
30
                this.store = null;
31
                this.logger = null;
32 23772 jjdelcerro
        }
33
34 23874 jjdelcerro
35
        public FeatureStoreProvider initialize(FeatureStoreProviderServices store)
36 23820 jjdelcerro
                        throws InitializeException {
37 23772 jjdelcerro
                this.store = store;
38 23874 jjdelcerro
                this.logger = null;
39
                return this;
40 23772 jjdelcerro
        }
41
42 23894 jjdelcerro
        protected ResourceProvider createResource(String type, Object[] params)
43
                        throws InitializeException {
44
                ResourceManagerProviderServices manager = (ResourceManagerProviderServices) DALLocator
45
                                .getResourceManager();
46
                ResourceProvider resource = manager.createResource(type, params);
47
                return resource;
48
        }
49
50 23874 jjdelcerro
        public FeatureStoreProviderServices getStoreServices() {
51
                return this.store;
52
        }
53
54 23772 jjdelcerro
        public String getClassName() {
55
                return this.getClass().getName();
56
        }
57
58 23874 jjdelcerro
        public Logger getLogger() {
59
                if (this.logger == null) {
60
                        this.logger = LoggerFactory.getLogger(this.getClass());
61
                }
62
                return this.logger;
63
        }
64
65 23772 jjdelcerro
        public boolean allowWrite() {
66
                return false;
67
        }
68
69 23842 jjdelcerro
        public boolean isLocksSupported() {
70
                return false;
71
        }
72
73 24248 jjdelcerro
        public FeatureData createFeatureData(FeatureType type)
74 23995 jmvivo
                        throws DataException {
75 23772 jjdelcerro
                return this.store.createDefaultFeatureData(type);
76
        }
77
78
        public FeatureLocks createFeatureLocks() throws DataException {
79 23995 jmvivo
                return null;
80 23772 jjdelcerro
        }
81
82
        public FeatureSelection createFeatureSelection() throws DataException {
83
                return this.store.createDefaultFeatureSelection();
84
        }
85
86 23899 jjdelcerro
        public ExpansionAdapter createTemporaryContainer() {
87
                return new MemoryExpansionAdapter();
88
        }
89
90 23772 jjdelcerro
        public void refresh() throws OpenException {
91
                // Do nothing by default
92
        }
93
94
        public void close() throws CloseException {
95
                // Do nothing by default
96
        }
97
98
        public void dispose() throws CloseException {
99
                // Do nothing by default
100
        }
101
102
        public Iterator getChilds() {
103
                return null;
104
        }
105
106 25176 jmvivo
        public Envelope getEnvelope() throws DataException {
107 23772 jjdelcerro
                return null;
108
        }
109
110 25420 cordinyana
        public Metadata getMetadata() throws MetadataNotFoundException {
111 23772 jjdelcerro
                return null;
112
        }
113
114 24874 jmvivo
        public abstract DataServerExplorer getExplorer() throws ReadException;
115 23772 jjdelcerro
116 24144 vcaballero
        public abstract void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds) throws PerformEditingException;
117 23772 jjdelcerro
118
}