Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultService.java @ 217:87a7773030b5
The Backend got a method that retrieves an ArtifactCollection based on its GID.
artifacts/trunk@1556 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 24 Mar 2011 15:41:25 +0000 |
parents | b2115f484edb |
children | a8d62eb93cd4 |
rev | line source |
---|---|
100
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
90
diff
changeset
|
1 /* |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
90
diff
changeset
|
2 * Copyright (c) 2010 by Intevation GmbH |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
90
diff
changeset
|
3 * |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
90
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:
90
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:
90
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:
90
diff
changeset
|
7 */ |
933bbc9fc11f
Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
90
diff
changeset
|
8 |
69
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
9 package de.intevation.artifactdatabase; |
498bb84334d0
Added base class for services and service factories.
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:
100
diff
changeset
|
11 import de.intevation.artifacts.common.utils.XMLUtils; |
b2115f484edb
Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
100
diff
changeset
|
12 |
69
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.artifacts.CallMeta; |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 import de.intevation.artifacts.Service; |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.artifacts.ServiceFactory; |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 import org.apache.log4j.Logger; |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
18 |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 import org.w3c.dom.Document; |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
21 /** |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
22 * Trivial implementation of an artifact database service. Useful to |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
23 * be subclassed. |
90
68285f7bc476
More javadoc.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
89
diff
changeset
|
24 * |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
25 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a> |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
26 */ |
69
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 public class DefaultService |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
28 implements Service |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
29 { |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
30 private static Logger logger = Logger.getLogger(DefaultService.class); |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 |
89
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
32 public Document process( |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
33 Document data, |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
34 Object globalContext, |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
35 CallMeta callMeta |
d348fe1fd822
More javadoc (fixes small glitches, too).
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
69
diff
changeset
|
36 ) { |
69
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 if (logger.isDebugEnabled()) { |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 logger.debug("Service.process"); |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 } |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 return XMLUtils.newDocument(); |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 } |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 public void setup(ServiceFactory factory, Object globalContext) { |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 if (logger.isDebugEnabled()) { |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 logger.debug("Service.setup"); |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 } |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 } |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 } |
498bb84334d0
Added base class for services and service factories.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |