Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 481:20dde2b6f1b5
Added end of life support for artifact states. Implemented ZIP download
for "Horizontalschnitte". Laid some tracks for WMS (un-)publishing.
gnv-artifacts/trunk@554 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Sun, 17 Jan 2010 16:34:11 +0000 |
parents | d47b478e662b |
children | d265f5dc2979 |
comparison
equal
deleted
inserted
replaced
480:211cad2fb5ba | 481:20dde2b6f1b5 |
---|---|
59 import org.w3c.dom.Element; | 59 import org.w3c.dom.Element; |
60 import org.w3c.dom.Node; | 60 import org.w3c.dom.Node; |
61 import org.w3c.dom.NodeList; | 61 import org.w3c.dom.NodeList; |
62 | 62 |
63 /** | 63 /** |
64 * @author Tim Englich <tim.englich@intevation.de> | 64 * @author Tim Englich (tim.englich@intevation.de) |
65 * @author Ingo Weinzierl <ingo.weinzierl@intevation.de> | 65 * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) |
66 * | 66 * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) |
67 */ | 67 */ |
68 public abstract class GNVArtifactBase extends DefaultArtifact { | 68 public abstract class GNVArtifactBase extends DefaultArtifact { |
69 /** | 69 /** |
70 * the logger, used to log exceptions and additonaly information | 70 * the logger, used to log exceptions and additonaly information |
71 */ | 71 */ |
168 | 168 |
169 // 2. Transfer Results | 169 // 2. Transfer Results |
170 next.putInputData(current.getInputData(), identifier); | 170 next.putInputData(current.getInputData(), identifier); |
171 next.setParent(current); | 171 next.setParent(current); |
172 | 172 |
173 if (current != null) { | |
174 current.endOfLife(context.globalContext()); | |
175 } | |
176 | |
173 // 3. Switch to next State | 177 // 3. Switch to next State |
174 current = next; | 178 current = next; |
175 | 179 |
176 // 4. Initialize next Step | 180 // 4. Initialize next Step |
177 current.initialize(identifier, context.getMeta()); | 181 current.initialize(identifier, context.getMeta()); |
187 // reset input data | 191 // reset input data |
188 resetFutureStates(current, targetState); | 192 resetFutureStates(current, targetState); |
189 | 193 |
190 // remove data from future states from cache | 194 // remove data from future states from cache |
191 resetDescribeData(current, identifier, targetState); | 195 resetDescribeData(current, identifier, targetState); |
196 | |
197 if (current != null) { | |
198 current.endOfLife(context.globalContext()); | |
199 } | |
192 | 200 |
193 current = next; | 201 current = next; |
194 | 202 |
195 result = createReport( | 203 result = createReport( |
196 result, "result", "success", "Advance success" | 204 result, "result", "success", "Advance success" |
812 log.error(e, e); | 820 log.error(e, e); |
813 throw new IOException(e.getMessage()); | 821 throw new IOException(e.getMessage()); |
814 } | 822 } |
815 } | 823 } |
816 | 824 |
817 protected String readOutputType(Document document) { | 825 protected static String readOutputType(Document document) { |
818 String value = XMLUtils.xpathString( | 826 String value = XMLUtils.xpathString( |
819 document, XPATH_OUTPUT_NAME, ArtifactNamespaceContext.INSTANCE); | 827 document, XPATH_OUTPUT_NAME, ArtifactNamespaceContext.INSTANCE); |
820 return value; | 828 return value; |
821 } | 829 } |
822 | 830 |
823 | 831 |
824 public void setProduct(Product product) { | 832 public void setProduct(Product product) { |
825 this.product = product; | 833 this.product = product; |
826 } | 834 } |
835 | |
836 public void endOfLife(Object globalContext) { | |
837 super.endOfLife(globalContext); | |
838 | |
839 if (current != null) { | |
840 current.endOfLife(globalContext); | |
841 } | |
842 } | |
827 } | 843 } |
828 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: | 844 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: |