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