svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.spi / src / main / java / org / gvsig / fmap / dal / spi / AbstractDataServerExplorer.java @ 47737
History | View | Annotate | Download (3.65 KB)
1 |
package org.gvsig.fmap.dal.spi; |
---|---|
2 |
|
3 |
import java.io.File; |
4 |
import java.util.Map; |
5 |
import org.gvsig.fmap.dal.DataServerExplorerParameters; |
6 |
import org.gvsig.fmap.dal.DataServerExplorer_v2; |
7 |
import org.gvsig.fmap.dal.DataStore; |
8 |
import org.gvsig.fmap.dal.DataStoreParameters; |
9 |
import org.gvsig.fmap.dal.exception.DataException; |
10 |
import org.gvsig.fmap.dal.SQLBuilder; |
11 |
import org.gvsig.fmap.dal.exception.CloseException; |
12 |
import org.gvsig.fmap.dal.exception.OpenException; |
13 |
import org.gvsig.fmap.dal.feature.spi.SQLBuilderBase; |
14 |
import org.gvsig.tools.dispose.DisposeUtils; |
15 |
import org.gvsig.tools.dispose.impl.AbstractDisposable; |
16 |
import org.gvsig.tools.exception.BaseException; |
17 |
import org.gvsig.tools.resourcesstorage.EmptyResourcesStorage; |
18 |
import org.gvsig.tools.resourcesstorage.ResourcesStorage; |
19 |
import org.gvsig.tools.util.PropertiesSupport; |
20 |
import org.gvsig.tools.util.PropertiesSupportHelper; |
21 |
import org.slf4j.Logger; |
22 |
import org.slf4j.LoggerFactory; |
23 |
|
24 |
public abstract class AbstractDataServerExplorer extends AbstractDisposable implements DataServerExplorer_v2 { |
25 |
|
26 |
protected static final Logger LOGGER = LoggerFactory.getLogger(AbstractDataServerExplorer.class); |
27 |
|
28 |
private DataServerExplorerParameters parameters;
|
29 |
private final DataServerExplorerProviderServices providerServices; |
30 |
private PropertiesSupport propertiesSupport;
|
31 |
|
32 |
protected AbstractDataServerExplorer(DataServerExplorerParameters parameters, DataServerExplorerProviderServices providerServices) {
|
33 |
this.parameters = parameters;
|
34 |
this.providerServices = providerServices;
|
35 |
this.propertiesSupport = new PropertiesSupportHelper(); |
36 |
} |
37 |
|
38 |
public DataServerExplorerProviderServices getServerExplorerProviderServices() {
|
39 |
return this.providerServices; |
40 |
} |
41 |
|
42 |
@Override
|
43 |
public DataServerExplorerParameters getParameters() {
|
44 |
return this.parameters; |
45 |
} |
46 |
|
47 |
@Override
|
48 |
protected void doDispose() throws BaseException { |
49 |
this.parameters = null; |
50 |
} |
51 |
|
52 |
@Override
|
53 |
public DataStoreParameters get(String name) throws DataException { |
54 |
return null; |
55 |
} |
56 |
|
57 |
@Override
|
58 |
public boolean exists(DataStoreParameters parameters) throws DataException { |
59 |
return true; |
60 |
} |
61 |
|
62 |
@Deprecated
|
63 |
@Override
|
64 |
public File getResourcePath(DataStore dataStore, String resourceName) throws DataException { |
65 |
return null; |
66 |
} |
67 |
|
68 |
@Override
|
69 |
public ResourcesStorage getResourcesStorage() {
|
70 |
ResourcesStorage resourcesStorage = ResourcesStorage.EMPTY_RESOURCESSTORAGE; |
71 |
return resourcesStorage;
|
72 |
} |
73 |
|
74 |
@Override
|
75 |
public ResourcesStorage getResourcesStorage(DataStore dataStore) {
|
76 |
ResourcesStorage resourcesStorage = ResourcesStorage.EMPTY_RESOURCESSTORAGE; |
77 |
return resourcesStorage;
|
78 |
} |
79 |
|
80 |
@Override
|
81 |
public ResourcesStorage getResourcesStorage(DataStoreParameters parameters) {
|
82 |
ResourcesStorage resourcesStorage = ResourcesStorage.EMPTY_RESOURCESSTORAGE; |
83 |
return resourcesStorage;
|
84 |
} |
85 |
|
86 |
@Override
|
87 |
public SQLBuilder createSQLBuilder() {
|
88 |
return new SQLBuilderBase(); |
89 |
} |
90 |
|
91 |
@Override
|
92 |
public void open() throws OpenException { |
93 |
} |
94 |
|
95 |
@Override
|
96 |
public void close() throws CloseException { |
97 |
DisposeUtils.dispose(this);
|
98 |
} |
99 |
|
100 |
@Override
|
101 |
public DataStore open(DataStoreParameters dsp) throws DataException { |
102 |
return null; |
103 |
} |
104 |
|
105 |
public Object getProperty(String name) { |
106 |
return this.propertiesSupport.getProperty(name); |
107 |
} |
108 |
|
109 |
public void setProperty(String name, Object value) { |
110 |
this.propertiesSupport.setProperty(name, value);
|
111 |
} |
112 |
|
113 |
public Map<String,Object> getProperties() { |
114 |
return this.propertiesSupport.getProperties(); |
115 |
} |
116 |
} |