annotate src/main/java/org/dive4elements/artifacts/httpclient/utils/Configuration.java @ 125:e602a29f1dcc 3.2.x

Upgrade to Log4j 2
author Tom Gottfried <tom@intevation.de>
date Mon, 28 Feb 2022 17:49:46 +0100
parents 133281653904
children
rev   line source
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 /*
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
3 *
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
7 */
72
133281653904 Renamed internal references.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 71
diff changeset
8 package org.dive4elements.artifacts.httpclient.utils;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
9
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
10 import java.io.File;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
11 import java.io.FileInputStream;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
12 import java.io.IOException;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
13 import java.util.HashMap;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
14 import java.util.Map;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
15
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
16 import org.w3c.dom.Document;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
17 import org.w3c.dom.Node;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18 import org.w3c.dom.NodeList;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
19
125
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 72
diff changeset
20 import org.apache.logging.log4j.Logger;
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 72
diff changeset
21 import org.apache.logging.log4j.LogManager;
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 /**
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
24 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 */
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 public class Configuration {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27
125
e602a29f1dcc Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 72
diff changeset
28 private static final Logger logger = LogManager.getLogger(Configuration.class);
0
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
29
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
30 private File config;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
31
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
32 private Map serverSettings;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
33 private Map artifactSettings;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
34 private Map outputSettings;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
35
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
36 public static final String XPATH_SERVER = "/configuration/artifact-server";
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 public static final String XPATH_ARTIFACT = "/configuration/artifact";
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
38 public static final String XPATH_OUTPUT = "/configuration/output";
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
40
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
41 public Configuration(File config) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
42 this.config = config;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
43 serverSettings = new HashMap();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44 artifactSettings = new HashMap();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 outputSettings = new HashMap();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
49 public void initialize()
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
50 throws IOException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
51 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
52 Document conf = XMLUtils.readDocument(new FileInputStream(config));
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
53
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
54 if (conf == null) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
55 throw new IOException("Can't read config: " + config.getName());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
56 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58 readServerSettings(conf);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59 readArtifactSettings(conf);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 readOutputSettings(conf);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 private void readServerSettings(Document document)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 throws IOException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
66 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
67 Node serverNode = XMLUtils.getNodeXPath(document, XPATH_SERVER);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
68
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
69 if (serverNode == null) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
70 throw new IOException("No server configuration found.");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
73 serverSettings = extractSettings(serverSettings, serverNode);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
74 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
75
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
76
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
77 private void readArtifactSettings(Document document)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
78 throws IOException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
79 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
80 Node artifactNode = XMLUtils.getNodeXPath(document, XPATH_ARTIFACT);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
81
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
82 if (artifactNode == null) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
83 throw new IOException("No artifact configuration found.");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
84 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
85
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
86 artifactSettings = extractSettings(artifactSettings, artifactNode);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
87 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
88
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
89
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
90 private void readOutputSettings(Document document)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
91 throws IOException
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
92 {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
93 Node outputNode = XMLUtils.getNodeXPath(document, XPATH_OUTPUT);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
94
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
95 if (outputNode == null) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
96 throw new IOException("No output configuration found.");
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
97 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
98
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
99 outputSettings = extractSettings(outputSettings, outputNode);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
100 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
101
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
102
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
103 private Map extractSettings(Map settings, Node node) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
104 NodeList children = node.getChildNodes();
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
105
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
106 for (int i = 0; i < children.getLength(); i++) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
107 Node child = children.item(i);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
108 if (child.getNodeType() == Node.ELEMENT_NODE)
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
109 logger.debug(child.getNodeName() + "|" + child.getTextContent());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
110 settings.put(child.getNodeName(), child.getTextContent());
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
111 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
112
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
113 return settings;
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
114 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
115
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
116
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
117 public Object getServerSettings(String key) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
118 return serverSettings.get(key);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
119 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
120
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
121
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
122 public Object getArtifactSettings(String key) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
123 return artifactSettings.get(key);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
124 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
125
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
126
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
127 public Object getOutputSettings(String key) {
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
128 return outputSettings.get(key);
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
129 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
130 }
a1db30b33f43 Moved the experimental branch 'work-on-gwt' of the console-client to an own module 'http-client' and removed the console-client.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
131 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:

http://dive4elements.wald.intevation.org