Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/FactoryBootstrap.java @ 230:fbd57d2eeaef
Changed semantics of locked artifact ids.
artifacts/trunk@1634 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 31 Mar 2011 14:48:28 +0000 |
parents | b2115f484edb |
children | c47a640cfdae |
rev | line source |
---|---|
100
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
1 /* |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
3 * |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
7 */ |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
94
diff
changeset
|
8 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.artifactdatabase; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
10 |
207
b2115f484edb
Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
155
diff
changeset
|
11 import de.intevation.artifacts.common.utils.Config; |
b2115f484edb
Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
155
diff
changeset
|
12 |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
13 import de.intevation.artifacts.ArtifactCollectionFactory; |
70
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
14 import de.intevation.artifacts.ArtifactContextFactory; |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
15 import de.intevation.artifacts.ArtifactFactory; |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
16 import de.intevation.artifacts.ServiceFactory; |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
17 import de.intevation.artifacts.UserFactory; |
70
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
18 |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
19 import java.util.ArrayList; |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
20 |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
21 import org.apache.log4j.Logger; |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
22 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 import org.w3c.dom.Document; |
130
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
24 import org.w3c.dom.Node; |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 import org.w3c.dom.NodeList; |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
26 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 /** |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 * Bootstrap facility for the global context and the artifact factories. |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 * |
77
48d1a9a082c2
Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>'
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
71
diff
changeset
|
30 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 */ |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 public class FactoryBootstrap |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
34 private static Logger logger = Logger.getLogger(FactoryBootstrap.class); |
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
35 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
36 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
37 * XPath to figure out the class name of the context factory from |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
38 * the global configuration. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
39 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 public static final String CONTEXT_FACTORY = |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 "/artifact-database/factories/context-factory/text()"; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
43 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
44 * The name of the default context factory. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
45 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 public static final String DEFAULT_CONTEXT_FACTORY = |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 "de.intevation.artifactdatabase.DefaultArtifactContextFactory"; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
49 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
50 * XPath to figure out the names of the artifact factories from |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
51 * the global configuration to be exposed by the artifact database. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
52 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 public static final String ARTIFACT_FACTORIES = |
16
635310c6a20e
Bug fixed in in XPath Expression.
Tim Englich <tim.englich@intevation.de>
parents:
10
diff
changeset
|
54 "/artifact-database/factories/artifact-factories/artifact-factory"; |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
56 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
57 * XPath to figure out the names of the service factories from |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
58 * the global configuration to build the services offered by the |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
59 * artifact database. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
60 */ |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
61 public static final String SERVICE_FACTORIES = |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
62 "/artifact-database/factories/service-factories/service-factory"; |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
63 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
64 /** |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
65 * XPath to figure out the class name of the user factory from global |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
66 * configuration. |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
67 */ |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
68 public static final String USER_FACTORY = |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
69 "/artifact-database/factories/user-factory"; |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
70 |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
71 /** |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
72 * The name of the default user factory. |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
73 */ |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
74 public static final String DEFAULT_USER_FACTORY = |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
75 "de.intevation.artifactdatabase.DefaultUserFactory"; |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
76 |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
77 /** |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
78 * XPath to figure out the class name of the collection factory from global |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
79 * configuration. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
80 */ |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
81 public static final String COLLECTION_FACTORY = |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
82 "/artifact-database/factories/collection-factory"; |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
83 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
84 /** |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
85 * The name of the default user factory. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
86 */ |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
87 public static final String DEFAULT_COLLECTION_FACTORY = |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
88 "de.intevation.artifactdatabase.DefaultArtifactCollectionFactory"; |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
89 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
90 /** |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
91 * XPath to figure out the secret used to sign the artifact exports |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
92 * made by the artfifact database server. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
93 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
94 public static final String EXPORT_SECRET = |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
95 "/artifact-database/export-secret/text()"; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
96 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
97 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
98 * Default export signing secret. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
99 * <strong>PLEASE CHANGE THE SECRET VIA THE XPATH EXPORT_SECRET |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
100 * IN THE CONFIGURATION.</strong>. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
101 */ |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
102 public static final String DEFAULT_EXPORT_SECRET = |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
103 "!!!CHANGE ME! I'M NO SECRET!!!"; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
104 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
105 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
106 * Reference to the global context build by the global context factory. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
107 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 protected Object context; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
110 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
111 * List of the artifact factories to be exposed by the |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
112 * artifact database. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
113 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
114 protected ArtifactFactory [] artifactFactories; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
115 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
116 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
117 * List of service factories which creates services that are |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
118 * exposed by the artifact database. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
119 */ |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
120 protected ServiceFactory [] serviceFactories; |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
121 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
122 /** |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
123 * The factory that is used to create and list users. |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
124 */ |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
125 protected UserFactory userFactory; |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
126 |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
127 /** |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
128 * The factory that is used to create new artifact collections. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
129 */ |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
130 protected ArtifactCollectionFactory collectionFactory; |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
131 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
132 /** |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
133 * byte array holding the export signing secret. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
134 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
135 protected byte [] exportSecret; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
136 |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
137 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
138 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
139 * Default constructor |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
140 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 public FactoryBootstrap() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 void buildContext() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 String className = Config.getStringXPath( |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 CONTEXT_FACTORY, DEFAULT_CONTEXT_FACTORY); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 ArtifactContextFactory factory = null; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 try { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
151 Class clazz = Class.forName(className); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
152 factory = (ArtifactContextFactory)clazz.newInstance(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
153 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 catch (ClassNotFoundException cnfe) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
155 logger.error(cnfe.getLocalizedMessage(), cnfe); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
157 catch (InstantiationException ie) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
158 logger.error(ie.getLocalizedMessage(), ie); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
159 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
160 catch (ClassCastException cce) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
161 logger.error(cce.getLocalizedMessage(), cce); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
162 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
163 catch (IllegalAccessException iae) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
164 logger.error(iae.getLocalizedMessage(), iae); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
165 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
167 if (factory == null) { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
168 factory = new DefaultArtifactContextFactory(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
169 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
170 |
19
1259d192e3c3
* New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
17
diff
changeset
|
171 logger.info("Using class '" + factory.getClass().getName() |
1259d192e3c3
* New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
17
diff
changeset
|
172 + "' for context creation."); |
1259d192e3c3
* New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
17
diff
changeset
|
173 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
174 context = factory.createArtifactContext(Config.getConfig()); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
175 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
176 |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
177 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
178 /** |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
179 * Scans the global configuration to load the configured collection factory |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
180 * and sets it up. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
181 */ |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
182 protected void loadCollectionFactory() { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
183 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
184 logger.info("loading collection factory."); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
185 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
186 Node factory = Config.getNodeXPath(COLLECTION_FACTORY); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
187 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
188 String className = Config.getStringXPath( |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
189 factory, "text()", DEFAULT_COLLECTION_FACTORY); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
190 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
191 try { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
192 Class clazz = Class.forName(className); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
193 collectionFactory = (ArtifactCollectionFactory) clazz.newInstance(); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
194 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
195 collectionFactory.setup(Config.getConfig(), factory); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
196 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
197 catch (ClassNotFoundException cnfe) { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
198 logger.error(cnfe.getLocalizedMessage(), cnfe); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
199 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
200 catch (InstantiationException ie) { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
201 logger.error(ie.getLocalizedMessage(), ie); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
202 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
203 catch (ClassCastException cce) { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
204 logger.error(cce.getLocalizedMessage(), cce); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
205 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
206 catch (IllegalAccessException iae) { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
207 logger.error(iae.getLocalizedMessage(), iae); |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
208 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
209 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
210 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
211 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
212 * Scans the global configuration to load the configured |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
213 * artifact factories and sets them up. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
214 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
215 protected void loadArtifactFactories() { |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
216 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
217 logger.info("loading artifact factories"); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
218 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
219 ArrayList loadedFactories = new ArrayList(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
220 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
221 NodeList nodes = Config.getNodeSetXPath(ARTIFACT_FACTORIES); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
222 |
10
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
223 if (nodes == null) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
224 logger.warn("No factories found"); |
10
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
225 } |
e8626caac353
* Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
7
diff
changeset
|
226 |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
227 Document config = Config.getConfig(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
228 |
19
1259d192e3c3
* New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
17
diff
changeset
|
229 for (int i = 0, N = nodes != null ? nodes.getLength() : 0; i < N; ++i) { |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
230 String className = nodes.item(i).getTextContent().trim(); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
231 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
232 ArtifactFactory factory = null; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
233 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
234 try { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
235 Class clazz = Class.forName(className); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
236 factory = (ArtifactFactory)clazz.newInstance(); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
237 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
238 catch (ClassNotFoundException cnfe) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
239 logger.error(cnfe.getLocalizedMessage(), cnfe); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
240 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
241 catch (InstantiationException ie) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
242 logger.error(ie.getLocalizedMessage(), ie); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
243 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
244 catch (ClassCastException cce) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
245 logger.error(cce.getLocalizedMessage(), cce); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
246 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
247 catch (IllegalAccessException iae) { |
17
5a6b6a3debc7
Integrated logging into artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
16
diff
changeset
|
248 logger.error(iae.getLocalizedMessage(), iae); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
249 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
250 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
251 if (factory != null) { |
19
1259d192e3c3
* New configuration based on config directory
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
17
diff
changeset
|
252 factory.setup(config, nodes.item(i)); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
253 loadedFactories.add(factory); |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
254 logger.info("Registering '" |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
255 + factory.getName() + "' as artifact factory."); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
256 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
257 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
258 |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
259 artifactFactories = (ArtifactFactory [])loadedFactories.toArray( |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
260 new ArtifactFactory[loadedFactories.size()]); |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
261 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
262 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
263 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
264 * Scans the global configuration for the configured service factories |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
265 * and sets them up. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
266 */ |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
267 protected void loadServiceFactories() { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
268 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
269 logger.info("loading service factories"); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
270 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
271 ArrayList loadedFactories = new ArrayList(); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
272 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
273 NodeList nodes = Config.getNodeSetXPath(SERVICE_FACTORIES); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
274 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
275 if (nodes == null) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
276 logger.warn("No factories found"); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
277 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
278 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
279 Document config = Config.getConfig(); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
280 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
281 for (int i = 0, N = nodes != null ? nodes.getLength() : 0; i < N; ++i) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
282 String className = nodes.item(i).getTextContent().trim(); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
283 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
284 ServiceFactory factory = null; |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
285 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
286 try { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
287 Class clazz = Class.forName(className); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
288 factory = (ServiceFactory)clazz.newInstance(); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
289 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
290 catch (ClassNotFoundException cnfe) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
291 logger.error(cnfe.getLocalizedMessage(), cnfe); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
292 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
293 catch (InstantiationException ie) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
294 logger.error(ie.getLocalizedMessage(), ie); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
295 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
296 catch (ClassCastException cce) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
297 logger.error(cce.getLocalizedMessage(), cce); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
298 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
299 catch (IllegalAccessException iae) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
300 logger.error(iae.getLocalizedMessage(), iae); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
301 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
302 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
303 if (factory != null) { |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
304 factory.setup(config, nodes.item(i)); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
305 loadedFactories.add(factory); |
94
5332d956729c
Brought all line lengths of non Javadoc lines below 80.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
89
diff
changeset
|
306 logger.info( "Registering '" + factory.getName() |
5332d956729c
Brought all line lengths of non Javadoc lines below 80.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
89
diff
changeset
|
307 + "' as service factory."); |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
308 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
309 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
310 |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
311 serviceFactories = (ServiceFactory [])loadedFactories.toArray( |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
312 new ServiceFactory[loadedFactories.size()]); |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
313 } |
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
314 |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
315 |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
316 /** |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
317 * Scans the global configuration for the configured user factory. |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
318 */ |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
319 protected void loadUserFactory() { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
320 logger.info("loading user factory"); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
321 |
130
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
322 Node factory = Config.getNodeXPath(USER_FACTORY); |
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
323 |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
324 String className = Config.getStringXPath( |
130
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
325 factory, "text()", DEFAULT_USER_FACTORY); |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
326 |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
327 try { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
328 Class clazz = Class.forName(className); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
329 userFactory = (UserFactory) clazz.newInstance(); |
130
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
330 |
147610c43863
The UserFactory got a setup() method that is called while bootstrap.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
127
diff
changeset
|
331 userFactory.setup(Config.getConfig(), factory); |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
332 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
333 catch (ClassNotFoundException cnfe) { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
334 logger.error(cnfe.getLocalizedMessage(), cnfe); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
335 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
336 catch (InstantiationException ie) { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
337 logger.error(ie.getLocalizedMessage(), ie); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
338 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
339 catch (ClassCastException cce) { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
340 logger.error(cce.getLocalizedMessage(), cce); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
341 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
342 catch (IllegalAccessException iae) { |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
343 logger.error(iae.getLocalizedMessage(), iae); |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
344 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
345 } |
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
346 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
347 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
348 * Fetches the export signing secret from the global configuration. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
349 * If none is found if defaults to the DEFAULT_EXORT_SECRET which |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
350 * is insecure. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
351 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
352 protected void setupExportSecret() { |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
353 String secret = Config.getStringXPath(EXPORT_SECRET); |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
354 |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
355 if (secret == null) { |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
356 logger.warn("NO EXPORT SECRET SET! USING INSECURE DEFAULT!"); |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
357 secret = DEFAULT_EXPORT_SECRET; |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
358 } |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
359 |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
360 exportSecret = StringUtils.getUTF8Bytes(secret); |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
361 } |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
362 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
363 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
364 * Loads all the dynamic classes configured by the global configuration. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
365 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
366 public void boot() { |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
367 setupExportSecret(); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
368 buildContext(); |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
369 loadCollectionFactory(); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
370 loadArtifactFactories(); |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
371 loadServiceFactories(); |
125
cee54e52000c
Added the registration of the UserFactory to the bootstrap process.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
100
diff
changeset
|
372 loadUserFactory(); |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
373 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
374 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
375 /** |
155
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
376 * Returns the artifact collection factory. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
377 * |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
378 * @return the artifact collection factory. |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
379 */ |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
380 public ArtifactCollectionFactory getArtifactCollectionFactory() { |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
381 return collectionFactory; |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
382 } |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
383 |
f797093c60bd
Made a (single one) artifact collection factory configurable.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
130
diff
changeset
|
384 /** |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
385 * Returns the list of ready to use artifact factories. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
386 * @return The list of artifact factories. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
387 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
388 public ArtifactFactory [] getArtifactFactories() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
389 return artifactFactories; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
390 } |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
391 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
392 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
393 * Returns the ready to use service factories. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
394 * @return The list of service factories. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
395 */ |
70
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
396 public ServiceFactory [] getServiceFactories() { |
71
c99da6837be0
Load service factories and services during bootstrap.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
70
diff
changeset
|
397 return serviceFactories; |
70
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
398 } |
ce488c1d3fc4
Serve services over artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
19
diff
changeset
|
399 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
400 /** |
127
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
401 * Returns the user factory. |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
402 * |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
403 * @return the user factory. |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
404 */ |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
405 public UserFactory getUserFactory() { |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
406 return userFactory; |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
407 } |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
408 |
0245a87df368
Made the user factory available in the artifact database.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
125
diff
changeset
|
409 /** |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
410 * Returns the global context created by the global context factory. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
411 * @return The global context. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
412 */ |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
413 public Object getContext() { |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
414 return context; |
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
415 } |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
416 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
417 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
418 * Returns the signing secret to be used when ex- and importing |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
419 * artifacts from and into the artifact database. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
420 * @return the byte array containg the signing secret. |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
79
diff
changeset
|
421 */ |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
422 public byte [] getExportSecret() { |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
423 return exportSecret; |
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
424 } |
5
8f2de197bce2
Added config to artifact database and modelled bootstap of artifact factories on top of this.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
425 } |
79
f69e5b87f05f
Implementation to export artifacts as xml (applied patch from issue208 by SLT).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
77
diff
changeset
|
426 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |