annotate artifact-database/src/main/java/org/dive4elements/artifactdatabase/DefaultArtifact.java @ 570:584591f8203c 3.2.x

Upgrade to Log4j 2
author Tom Gottfried <tom@intevation.de>
date Mon, 28 Feb 2022 17:41:14 +0100
parents 69f99bdf3d65
children
rev   line source
100
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 91
diff changeset
1 /*
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 91
diff changeset
2 * Copyright (c) 2010 by Intevation GmbH
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 91
diff changeset
3 *
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 91
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: 91
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: 91
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: 91
diff changeset
7 */
933bbc9fc11f Added license file and license headers.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 91
diff changeset
8
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
9 package org.dive4elements.artifactdatabase;
207
b2115f484edb Move Config and XMLUtils totally to commons package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 100
diff changeset
10
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
11 import org.dive4elements.artifacts.common.utils.XMLUtils;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
12
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
13 import org.dive4elements.artifacts.Artifact;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
14 import org.dive4elements.artifacts.ArtifactFactory;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
15 import org.dive4elements.artifacts.CallContext;
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 473
diff changeset
16 import org.dive4elements.artifacts.CallMeta;
91
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
17
75
d4c4c23847f5 Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
18 import java.io.IOException;
d4c4c23847f5 Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
19 import java.io.OutputStream;
513
69f99bdf3d65 Use a list of "static" facets loaded from configuration to generate facets on artifact setup.
Raimund Renkert <rrenkert@intevation.de>
parents: 512
diff changeset
20 import java.util.List;
75
d4c4c23847f5 Extended the Artifact-Interface-Method setup to be able to put the XML-Document which can contain further Data
Tim Englich <tim.englich@intevation.de>
parents: 55
diff changeset
21
570
584591f8203c Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 513
diff changeset
22 import org.apache.logging.log4j.Logger;
584591f8203c Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 513
diff changeset
23 import org.apache.logging.log4j.LogManager;
91
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
24
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 import org.w3c.dom.Document;
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27 /**
91
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
28 * Trivial implementation of an artifact. Useful to be subclassed.
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: 75
diff changeset
29 * @author <a href="mailto:sascha.teichmann@intevation.de">Sascha L. Teichmann</a>
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 */
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 public class DefaultArtifact
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 implements Artifact
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33 {
570
584591f8203c Upgrade to Log4j 2
Tom Gottfried <tom@intevation.de>
parents: 513
diff changeset
34 private static Logger logger = LogManager.getLogger(DefaultArtifact.class);
47
4ae4dc99127d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 42
diff changeset
35
87
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
36 /**
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
37 * The identifier of the artifact.
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
38 */
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
39 protected String identifier;
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
40
512
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
41 /**
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
42 * The name of the artifact.
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
43 */
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
44 protected String name;
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
45
367
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
46
87
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
47 /**
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
48 * Default constructor.
0f48188a6e02 Added some javadoc to the artifactdatabase module. Not done yet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 86
diff changeset
49 */
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 public DefaultArtifact() {
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52
81
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
53
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
54 public void setIdentifier(String identifier) {
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
55 if (logger.isDebugEnabled()) {
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
56 logger.debug("Change identifier: "
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
57 + this.identifier + " -> " + identifier);
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
58 }
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
59 this.identifier = identifier;
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
60 }
e9c80fdfee13 Set new identifiers on artifacts after an artifact import.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 77
diff changeset
61
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
62 public String identifier() {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
63 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
64 logger.debug("DefaultArtifact.identifier: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
65 }
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 return this.identifier;
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68
367
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
69
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
70 public String hash() {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
71 String hash = String.valueOf(hashCode());
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
72 if (logger.isDebugEnabled()) {
47
4ae4dc99127d Removed trailing whitespace.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 42
diff changeset
73 logger.debug("DefaultArtifact.hashCode: "
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
74 + identifier + " (" + hash + ")");
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
75 }
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
76 return hash;
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78
55
9a29899b31e5 describe() in REST interface is also handled as POST to pass
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 47
diff changeset
79 public Document describe(Document data, CallContext context) {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
80 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
81 logger.debug("DefaultArtifact.describe: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
82 }
26
83a059c204f8 Connected /create with artifact db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 24
diff changeset
83 return XMLUtils.newDocument();
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
85
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 31
diff changeset
86 public Document advance(Document target, CallContext context) {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
87 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
88 logger.debug("DefaultArtifact.advance: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
89 }
26
83a059c204f8 Connected /create with artifact db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 24
diff changeset
90 return XMLUtils.newDocument();
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
91 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 31
diff changeset
93 public Document feed(Document target, CallContext context) {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
94 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
95 logger.debug("DefaultArtifact.feed: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
96 }
26
83a059c204f8 Connected /create with artifact db.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 24
diff changeset
97 return XMLUtils.newDocument();
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99
31
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
100 public void out(
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
101 Document format,
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
102 OutputStream out,
32
c2d53bd30ab8 Re-factored artifact API for better integration of background processing.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 31
diff changeset
103 CallContext context
31
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
104 )
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
105 throws IOException
c4d85a8532d1 Artifact.out() is now called with an java.io.Outpustream
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 26
diff changeset
106 {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
107 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
108 logger.debug("DefaultArtifact.out: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
109 }
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
110 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
269
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
112 public void out(
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
113 String type,
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
114 Document format,
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
115 OutputStream out,
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
116 CallContext context
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
117 )
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
118 throws IOException
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
119 {
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
120 if (logger.isDebugEnabled()) {
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
121 logger.debug("DefaultArtifact.out: " + identifier);
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
122 }
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
123 }
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 207
diff changeset
124
367
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
125 public void setup(String identifier,
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
126 ArtifactFactory factory,
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
127 Object context,
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
128 CallMeta callMeta,
513
69f99bdf3d65 Use a list of "static" facets loaded from configuration to generate facets on artifact setup.
Raimund Renkert <rrenkert@intevation.de>
parents: 512
diff changeset
129 Document data,
69f99bdf3d65 Use a list of "static" facets loaded from configuration to generate facets on artifact setup.
Raimund Renkert <rrenkert@intevation.de>
parents: 512
diff changeset
130 List<Class> facets)
367
6431b7efe240 Cosmetics.
Felix Wolfsteller <felix.wolfsteller@intevation.de>
parents: 297
diff changeset
131 {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
132 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
133 logger.debug("DefaultArtifact.setup: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
134 }
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
135 this.identifier = identifier;
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
136 }
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
137
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
138 public void endOfLife(Object context) {
42
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
139 if (logger.isDebugEnabled()) {
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
140 logger.debug("DefaultArtifact.endOfLife: " + identifier);
5fbd8e65bdf5 Added debug output to DefaultArtifact tracing of artifact lifecyle easier.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 32
diff changeset
141 }
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
142 }
82
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
143
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
144 public void cleanup(Object context) {
91
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
145 if (logger.isDebugEnabled()) {
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
146 logger.debug("DefaultArtifact.cleanup: " + identifier);
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
147 }
82
efe752c4f8b2 Call cleanup method to remove special data stored by an 'out'-target before exporting an artifact.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 81
diff changeset
148 }
512
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
149
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
150
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
151 @Override
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
152 public String getName() {
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
153 return name;
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
154 }
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
155
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
156
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
157 @Override
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
158 public void setName(String name) {
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
159 this.name = name;
ff79b8df9aa6 Added getter and setter for name in artifact interface and default artifact.
Raimund Renkert <rrenkert@intevation.de>
parents: 475
diff changeset
160 }
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
161 }
91
730ff077a58c More javadoc, some code formatting.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 87
diff changeset
162 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org