# HG changeset patch # User Ingo Weinzierl # Date 1308215099 0 # Node ID 2600aa2c7319a09cf27f173cc5b13e3985429b17 # Parent 3481cd37e6091f6ea33a10c564fe6ad503f0ea07 Store facets for each state. flys-artifacts/branches/facets-slt@2131 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 3481cd37e609 -r 2600aa2c7319 flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java --- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Thu Jun 16 08:57:05 2011 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java Thu Jun 16 09:04:59 2011 +0000 @@ -3,6 +3,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.TreeMap; import java.util.List; import java.util.Map; @@ -104,7 +105,7 @@ protected Map data; /** The list of facets supported by this artifact.*/ - protected List facets; + protected Map> facets; /** @@ -113,7 +114,7 @@ public FLYSArtifact() { data = new TreeMap(); previousStateIds = new ArrayList(); - facets = new ArrayList(); + facets = new HashMap>(); } @@ -258,6 +259,7 @@ String prev = prevs.get(i); logger.debug("Remove state id '" + prev + "'"); prevs.remove(prev); + facets.remove(prev); } setCurrentStateId(targetState); @@ -1089,15 +1091,21 @@ ComputeCallback callback, ComputeType type) { + String stateId = getCurrentStateId(); + List fs = facets.get(stateId); + if (fs == null) { + fs = new ArrayList(); + facets.put(stateId, fs); + } + Cache cache = CacheFactory.getCache(COMPUTING_CACHE); - if (cache == null) { switch (type) { case FEED: - return callback.computeFeed(facets); + return callback.computeFeed(fs); case ADVANCE: - return callback.computeAdvance(facets); + return callback.computeAdvance(fs); } } @@ -1110,11 +1118,11 @@ Object result = null; switch (type) { case FEED: - result = callback.computeFeed(facets); + result = callback.computeFeed(fs); break; case ADVANCE: - result = callback.computeAdvance(facets); + result = callback.computeAdvance(fs); } if (result != null) {