Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/FLYSArtifactCreator.java @ 8203:238fc722f87a
sed 's/logger/log/g' src/**/*.java
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Fri, 05 Sep 2014 13:19:22 +0200 |
parents | ea9eef426962 |
children | 7bbfb24e6eec 0a5239a1e46e |
comparison
equal
deleted
inserted
replaced
8202:e4606eae8ea5 | 8203:238fc722f87a |
---|---|
43 * | 43 * |
44 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 44 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
45 */ | 45 */ |
46 public class FLYSArtifactCreator implements ArtifactCreator { | 46 public class FLYSArtifactCreator implements ArtifactCreator { |
47 | 47 |
48 private static final Logger logger = | 48 private static final Logger log = |
49 Logger.getLogger(FLYSArtifactCreator.class); | 49 Logger.getLogger(FLYSArtifactCreator.class); |
50 | 50 |
51 | 51 |
52 /** The XPath to the artifact's uuid.*/ | 52 /** The XPath to the artifact's uuid.*/ |
53 public static final String XPATH_UUID = "/art:result/art:uuid/@art:value"; | 53 public static final String XPATH_UUID = "/art:result/art:uuid/@art:value"; |
100 * @param doc The result of the CREATE operation. | 100 * @param doc The result of the CREATE operation. |
101 * | 101 * |
102 * @return an instance of an {@link Artifact}. | 102 * @return an instance of an {@link Artifact}. |
103 */ | 103 */ |
104 protected Artifact extractArtifact(Document doc) { | 104 protected Artifact extractArtifact(Document doc) { |
105 logger.debug("FLYSArtifactCreator - extractArtifact()"); | 105 log.debug("FLYSArtifactCreator - extractArtifact()"); |
106 | 106 |
107 String uuid = XMLUtils.xpathString( | 107 String uuid = XMLUtils.xpathString( |
108 doc, XPATH_UUID, ArtifactNamespaceContext.INSTANCE); | 108 doc, XPATH_UUID, ArtifactNamespaceContext.INSTANCE); |
109 | 109 |
110 String hash = XMLUtils.xpathString( | 110 String hash = XMLUtils.xpathString( |
121 background = Boolean.valueOf(backgroundStr); | 121 background = Boolean.valueOf(backgroundStr); |
122 } | 122 } |
123 | 123 |
124 List<CalculationMessage> msg = parseBackgroundMessages(doc); | 124 List<CalculationMessage> msg = parseBackgroundMessages(doc); |
125 | 125 |
126 logger.debug("NEW Artifact UUID: " + uuid); | 126 log.debug("NEW Artifact UUID: " + uuid); |
127 logger.debug("NEW Artifact HASH: " + hash); | 127 log.debug("NEW Artifact HASH: " + hash); |
128 logger.debug("NEW Artifact NAME: " + name); | 128 log.debug("NEW Artifact NAME: " + name); |
129 logger.debug("NEW Artifact IN BACKGROUND: " + background); | 129 log.debug("NEW Artifact IN BACKGROUND: " + background); |
130 | 130 |
131 if (name == null) { | 131 if (name == null) { |
132 return new DefaultArtifact(uuid, hash, background, msg); | 132 return new DefaultArtifact(uuid, hash, background, msg); |
133 } | 133 } |
134 | 134 |
135 name = name.trim(); | 135 name = name.trim(); |
136 | 136 |
137 if (name.length() > 0 && name.equals("winfo")) { | 137 if (name.length() > 0 && name.equals("winfo")) { |
138 logger.debug("+++++ NEW WINFO ARTIFACT."); | 138 log.debug("+++++ NEW WINFO ARTIFACT."); |
139 return new WINFOArtifact(uuid, hash, background, msg); | 139 return new WINFOArtifact(uuid, hash, background, msg); |
140 } | 140 } |
141 else if (name.length() > 0 && name.equals("new_map")) { | 141 else if (name.length() > 0 && name.equals("new_map")) { |
142 logger.debug("+++++ NEW MAP ARTIFACT."); | 142 log.debug("+++++ NEW MAP ARTIFACT."); |
143 return new MapArtifact(uuid, hash, background, msg); | 143 return new MapArtifact(uuid, hash, background, msg); |
144 } | 144 } |
145 else if (name.length() > 0 && name.equals("new_chart")) { | 145 else if (name.length() > 0 && name.equals("new_chart")) { |
146 logger.debug("+++++ NEW CHART ARTIFACT."); | 146 log.debug("+++++ NEW CHART ARTIFACT."); |
147 return new ChartArtifact(uuid, hash, background, msg); | 147 return new ChartArtifact(uuid, hash, background, msg); |
148 } | 148 } |
149 else if (name.length() > 0 && name.equals("minfo")) { | 149 else if (name.length() > 0 && name.equals("minfo")) { |
150 logger.debug("+++++ NEW MINFO ARTIFACT."); | 150 log.debug("+++++ NEW MINFO ARTIFACT."); |
151 return new MINFOArtifact(uuid, hash, background, msg); | 151 return new MINFOArtifact(uuid, hash, background, msg); |
152 } | 152 } |
153 else if (name.length() > 0 && name.equals("fixanalysis")) { | 153 else if (name.length() > 0 && name.equals("fixanalysis")) { |
154 logger.debug("+++++ NEW FIXANALYSIS ARTIFACT."); | 154 log.debug("+++++ NEW FIXANALYSIS ARTIFACT."); |
155 return new FixAnalysisArtifact(uuid, hash, background, msg); | 155 return new FixAnalysisArtifact(uuid, hash, background, msg); |
156 } | 156 } |
157 else if (name.length() > 0 && name.equals("gaugedischargecurve")) { | 157 else if (name.length() > 0 && name.equals("gaugedischargecurve")) { |
158 logger.debug("+++++ NEW GAUGEDISCHARGECURVE ARTIFACT."); | 158 log.debug("+++++ NEW GAUGEDISCHARGECURVE ARTIFACT."); |
159 return new GaugeDischargeCurveArtifact(uuid, hash, background, msg); | 159 return new GaugeDischargeCurveArtifact(uuid, hash, background, msg); |
160 } | 160 } |
161 else if (name.length() > 0 && name.equals("staticsqrelation")) { | 161 else if (name.length() > 0 && name.equals("staticsqrelation")) { |
162 logger.debug("+++++ STATICSQRELATION ARTIFACT."); | 162 log.debug("+++++ STATICSQRELATION ARTIFACT."); |
163 return new StaticSQRelationArtifact(uuid, hash, background, msg); | 163 return new StaticSQRelationArtifact(uuid, hash, background, msg); |
164 } | 164 } |
165 | 165 |
166 return new DefaultArtifact(uuid, hash, background, msg); | 166 return new DefaultArtifact(uuid, hash, background, msg); |
167 } | 167 } |
172 d, XPATH_BACKGROUND, XPathConstants.NODESET, | 172 d, XPATH_BACKGROUND, XPathConstants.NODESET, |
173 ArtifactNamespaceContext.INSTANCE); | 173 ArtifactNamespaceContext.INSTANCE); |
174 | 174 |
175 int len = list != null ? list.getLength() : 0; | 175 int len = list != null ? list.getLength() : 0; |
176 | 176 |
177 logger.debug("Found " + len + " background messages."); | 177 log.debug("Found " + len + " background messages."); |
178 | 178 |
179 List<CalculationMessage> res = new ArrayList<CalculationMessage>(len); | 179 List<CalculationMessage> res = new ArrayList<CalculationMessage>(len); |
180 | 180 |
181 for (int i = 0; i < len; i++) { | 181 for (int i = 0; i < len; i++) { |
182 CalculationMessage msg = parseBackgroundMessage( | 182 CalculationMessage msg = parseBackgroundMessage( |