Revision 46050 trunk/org.gvsig.desktop/org.gvsig.desktop.compat.cdc/org.gvsig.fmap.dal/org.gvsig.fmap.dal.api/src/main/java/org/gvsig/fmap/dal/AbstractStoresRepository.java
AbstractStoresRepository.java | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.util.ArrayList; |
4 | 4 |
import java.util.Collection; |
5 |
import java.util.Collections; |
|
5 | 6 |
import java.util.Iterator; |
6 | 7 |
import java.util.List; |
7 | 8 |
import java.util.Map; |
9 |
import java.util.Objects; |
|
8 | 10 |
import org.apache.commons.lang3.StringUtils; |
9 | 11 |
import org.gvsig.tools.observer.Notification; |
10 | 12 |
import org.gvsig.tools.observer.ObservableHelper; |
11 | 13 |
import org.gvsig.tools.observer.Observer; |
14 |
import org.gvsig.tools.util.PropertiesSupport; |
|
12 | 15 |
import org.gvsig.tools.util.UnmodifiableBasicSet; |
13 | 16 |
import org.gvsig.tools.util.UnmodifiableBasicSetChained; |
14 | 17 |
import org.slf4j.Logger; |
... | ... | |
157 | 160 |
} |
158 | 161 |
return null; |
159 | 162 |
} |
163 |
|
|
164 |
public PropertiesSupport getProperties(String name) { |
|
165 |
return new PropertiesSupport() { |
|
166 |
@Override |
|
167 |
public Object getProperty(String name) { |
|
168 |
return null; |
|
169 |
} |
|
160 | 170 |
|
171 |
@Override |
|
172 |
public void setProperty(String name, Object value) { |
|
173 |
|
|
174 |
} |
|
175 |
|
|
176 |
@Override |
|
177 |
public Map<String, Object> getProperties() { |
|
178 |
return Collections.EMPTY_MAP; |
|
179 |
} |
|
180 |
}; |
|
181 |
} |
|
182 |
|
|
161 | 183 |
@Override |
162 | 184 |
public DataStore getStore(String name) { |
185 |
PropertiesSupport properties = this.getProperties(name); |
|
186 |
if(properties!=null && |
|
187 |
StringUtils.equalsIgnoreCase(Objects.toString(properties.getProperty("ignoreDALResource")),"true")) { |
|
188 |
return this.getStore(name, true); |
|
189 |
} |
|
190 |
return this.getStore(name, false); |
|
191 |
} |
|
192 |
|
|
193 |
public DataStore getStore(String name, boolean ignoreDALResource) { |
|
163 | 194 |
DataStoreParameters parameters = this.getMyParameters(name); |
164 | 195 |
if( parameters!=null ) { |
165 | 196 |
try { |
166 | 197 |
DataStore store = DALLocator.getDataManager().openStore( |
167 | 198 |
parameters.getDataStoreName(), |
168 |
parameters |
|
199 |
parameters, |
|
200 |
ignoreDALResource |
|
169 | 201 |
); |
170 | 202 |
return store; |
171 | 203 |
} catch (Exception ex) { |
Also available in: Unified diff