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 |
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.DataServerExplorer; |
7 |
import org.gvsig.fmap.dal.exception.*; |
8 |
import org.gvsig.fmap.dal.feature.FeatureLocks; |
9 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
10 |
import org.gvsig.fmap.dal.feature.FeatureType; |
11 |
import org.gvsig.fmap.dal.feature.exception.PerformEditingException; |
12 |
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 |
import org.gvsig.fmap.geom.primitive.Envelope; |
17 |
import org.gvsig.metadata.Metadata; |
18 |
import org.gvsig.metadata.exceptions.MetadataNotFoundException; |
19 |
import org.slf4j.Logger; |
20 |
import org.slf4j.LoggerFactory; |
21 |
|
22 |
|
23 |
public abstract class AbstractFeatureStoreProvider implements |
24 |
FeatureStoreProvider { |
25 |
|
26 |
protected FeatureStoreProviderServices store;
|
27 |
protected Logger logger; |
28 |
|
29 |
public AbstractFeatureStoreProvider() {
|
30 |
this.store = null; |
31 |
this.logger = null; |
32 |
} |
33 |
|
34 |
|
35 |
public FeatureStoreProvider initialize(FeatureStoreProviderServices store)
|
36 |
throws InitializeException {
|
37 |
this.store = store;
|
38 |
this.logger = null; |
39 |
return this; |
40 |
} |
41 |
|
42 |
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 |
public FeatureStoreProviderServices getStoreServices() {
|
51 |
return this.store; |
52 |
} |
53 |
|
54 |
public String getClassName() { |
55 |
return this.getClass().getName(); |
56 |
} |
57 |
|
58 |
public Logger getLogger() { |
59 |
if (this.logger == null) { |
60 |
this.logger = LoggerFactory.getLogger(this.getClass()); |
61 |
} |
62 |
return this.logger; |
63 |
} |
64 |
|
65 |
public boolean allowWrite() { |
66 |
return false; |
67 |
} |
68 |
|
69 |
public boolean isLocksSupported() { |
70 |
return false; |
71 |
} |
72 |
|
73 |
public FeatureData createFeatureData(FeatureType type)
|
74 |
throws DataException {
|
75 |
return this.store.createDefaultFeatureData(type); |
76 |
} |
77 |
|
78 |
public FeatureLocks createFeatureLocks() throws DataException { |
79 |
return null; |
80 |
} |
81 |
|
82 |
public FeatureSelection createFeatureSelection() throws DataException { |
83 |
return this.store.createDefaultFeatureSelection(); |
84 |
} |
85 |
|
86 |
public ExpansionAdapter createTemporaryContainer() {
|
87 |
return new MemoryExpansionAdapter(); |
88 |
} |
89 |
|
90 |
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 |
public Envelope getEnvelope() throws DataException { |
107 |
return null; |
108 |
} |
109 |
|
110 |
public Metadata getMetadata() throws MetadataNotFoundException { |
111 |
return null; |
112 |
} |
113 |
|
114 |
public abstract DataServerExplorer getExplorer() throws ReadException; |
115 |
|
116 |
public abstract void performEditing(Iterator deleteds, Iterator inserteds, Iterator updateds) throws PerformEditingException; |
117 |
|
118 |
} |