comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 635:87f05cec1632

Removed useless methods after having refactored the caching mechanism. gnv-artifacts/trunk@717 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 01 Mar 2010 13:39:00 +0000
parents 61f688a69a55
children 22cc12b1622c
comparison
equal deleted inserted replaced
634:58c32df1a44d 635:87f05cec1632
210 db.getInternalArtifactFactory(fis); 210 db.getInternalArtifactFactory(fis);
211 211
212 Artifact select = fac.createArtifact(identifier, context, null); 212 Artifact select = fac.createArtifact(identifier, context, null);
213 context.putContextValue(ProxyArtifact.REPLACE_PROXY, select); 213 context.putContextValue(ProxyArtifact.REPLACE_PROXY, select);
214 214
215 resetDescribeData(current, identifier, INITIAL_STATE);
216
217 result = createReport( 215 result = createReport(
218 result, "result", "success", "Advance success" 216 result, "result", "success", "Advance success"
219 ); 217 );
220 } 218 }
221 219
276 if (current.getID().equals(name)) { 274 if (current.getID().equals(name)) {
277 return current; 275 return current;
278 } 276 }
279 else { 277 else {
280 return getPreviousState(current.getParent(), name); 278 return getPreviousState(current.getParent(), name);
281 }
282 }
283
284 public void resetDescribeData(State state, String uuid, String target) {
285 CacheFactory factory = CacheFactory.getInstance();
286
287 if (factory.isInitialized()) {
288 Cache cache = factory.getCache();
289 String key = uuid + StateBase.DESCRIBEDATAKEY;
290
291 net.sf.ehcache.Element value = cache.get(key);
292 if (value == null)
293 return;
294
295 List data = (List) value.getObjectValue();
296 while(!target.equals(state.getID())) {
297 data.remove(data.size()-1);
298 state = state.getParent();
299
300 if (state == null)
301 break;
302 }
303
304 cache.put(new net.sf.ehcache.Element(key, data));
305 }
306 }
307
308
309 protected void resetFutureStates(State current, String name) {
310 if (current == null) {
311 return;
312 }
313
314 if (current.getID().equals(name)) {
315 return;
316 }
317 else {
318 current.reset(identifier);
319 resetFutureStates(current.getParent(), name);
320 } 279 }
321 } 280 }
322 281
323 282
324 private boolean isStateCurrentlyReachable(String stateid){ 283 private boolean isStateCurrentlyReachable(String stateid){

http://dive4elements.wald.intevation.org