Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java @ 439:8975de9d7483
Loop through configuration to chart generation.
gnv-artifacts/trunk@487 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 28 Dec 2009 16:24:05 +0000 |
parents | bed9735adf84 |
children | 211cad2fb5ba |
comparison
equal
deleted
inserted
replaced
438:7399bb8f83ea | 439:8975de9d7483 |
---|---|
14 import org.w3c.dom.Element; | 14 import org.w3c.dom.Element; |
15 import org.w3c.dom.Node; | 15 import org.w3c.dom.Node; |
16 import org.w3c.dom.NodeList; | 16 import org.w3c.dom.NodeList; |
17 | 17 |
18 import de.intevation.artifactdatabase.Config; | 18 import de.intevation.artifactdatabase.Config; |
19 | |
19 import de.intevation.artifacts.CallMeta; | 20 import de.intevation.artifacts.CallMeta; |
21 import de.intevation.artifacts.CallContext; | |
22 | |
20 import de.intevation.gnv.artifacts.cache.CacheFactory; | 23 import de.intevation.gnv.artifacts.cache.CacheFactory; |
21 import de.intevation.gnv.artifacts.ressource.RessourceFactory; | 24 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
22 import de.intevation.gnv.geobackend.base.Result; | 25 import de.intevation.gnv.geobackend.base.Result; |
23 import de.intevation.gnv.geobackend.base.query.QueryExecutor; | 26 import de.intevation.gnv.geobackend.base.query.QueryExecutor; |
24 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; | 27 import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; |
140 } | 143 } |
141 | 144 |
142 /** | 145 /** |
143 * @return | 146 * @return |
144 */ | 147 */ |
145 protected Object getChartResult(String uuid) { | 148 protected Object getChartResult(String uuid, CallContext callContext) { |
146 log.debug("OutputStateBase.getChartResult"); | 149 log.debug("OutputStateBase.getChartResult"); |
147 Collection<Result> result = null; | 150 Object result = null; |
148 if (CacheFactory.getInstance().isInitialized()) { | 151 if (CacheFactory.getInstance().isInitialized()) { |
149 String key = uuid + super.getID(); | 152 String key = uuid + super.getID(); |
150 log.debug("Hash for Queryelements: " + key); | 153 log.debug("Hash for Queryelements: " + key); |
151 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); | 154 net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); |
152 if (value != null) { | 155 if (value != null) { |
153 result = (Collection<Result>) (value.getObjectValue()); | 156 result = value.getObjectValue(); |
154 }else{ | 157 }else{ |
155 result = this.getData(this.queryID); | 158 result = this.getData(this.queryID); |
156 if (CacheFactory.getInstance().isInitialized()) { | 159 if (CacheFactory.getInstance().isInitialized()) { |
157 CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); | 160 CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); |
158 } | 161 } |
160 } | 163 } |
161 } | 164 } |
162 return result; | 165 return result; |
163 } | 166 } |
164 | 167 |
165 protected Object getChartFromCache(String uuid) { | 168 protected Object getChartFromCache(String uuid, CallContext callContext) { |
166 log.debug("Fetch chart [" + uuid + "] from cache"); | 169 log.debug("Fetch chart [" + uuid + "] from cache"); |
167 CacheFactory cacheFactory = CacheFactory.getInstance(); | 170 CacheFactory cacheFactory = CacheFactory.getInstance(); |
168 if (cacheFactory.isInitialized()) { | 171 if (cacheFactory.isInitialized()) { |
169 String key = "chart_" + uuid + super.getID(); | 172 String key = "chart_" + uuid + super.getID(); |
170 net.sf.ehcache.Element object = cacheFactory.getCache().get(key); | 173 net.sf.ehcache.Element object = cacheFactory.getCache().get(key); |