comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 105:beb991dc4827

Added a first stub of an WINFO artifact. flys-artifacts/trunk@1287 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 02 Feb 2011 14:56:22 +0000
parents
children 9891d133f08d
comparison
equal deleted inserted replaced
104:b3792346cb10 105:beb991dc4827
1 package de.intevation.flys.artifacts;
2
3 import java.io.IOException;
4 import java.io.OutputStream;
5
6 import org.w3c.dom.Document;
7
8 import org.apache.log4j.Logger;
9
10 import de.intevation.artifacts.ArtifactFactory;
11 import de.intevation.artifacts.CallContext;
12
13 import de.intevation.artifactdatabase.DefaultArtifact;
14
15
16 /**
17 * The default WINFO artifact.
18 *
19 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
20 */
21 public class WINFOArtifact extends DefaultArtifact {
22
23 /** The logger for this class */
24 private static Logger logger = Logger.getLogger(WINFOArtifact.class);
25
26
27 /**
28 * The default constructor.
29 */
30 public WINFOArtifact() {
31 super();
32 }
33
34
35 /**
36 * Initialize the artifact and insert new data if <code>data</code> contains
37 * information necessary for this artifact.
38 *
39 * @param identifier The UUID.
40 * @param factory The factory that is used to create this artifact.
41 * @param context The CallContext.
42 * @param data Some optional data.
43 */
44 @Override
45 public void setup(
46 String identifier,
47 ArtifactFactory factory,
48 Object context,
49 Document data)
50 {
51 logger.debug("Setup this artifact with the uuid: " + identifier);
52
53 super.setup(identifier, factory, context, data);
54 }
55
56
57 /**
58 * This method handles requests for changing the current state of an
59 * artifact.
60 *
61 * @param target The target of the advance action.
62 * @param context The CallContext.
63 *
64 * @return the result of the advance action.
65 */
66 @Override
67 public Document advance(Document target, CallContext context) {
68 logger.debug("Advance to another state.");
69
70 return super.advance(target, context);
71 }
72
73
74 /**
75 * This methods introduces new data to the current artifact.
76 *
77 * @param data A document containing the new data.
78 * @param context The CallContext.
79 *
80 * @return the result of the feed action.
81 */
82 @Override
83 public Document feed(Document data, CallContext context) {
84 logger.debug("Feed the artifact with new data.");
85
86 return super.feed(data, context);
87 }
88
89
90 /**
91 * This method returns a description of this artifact.
92 *
93 * @param data Some data.
94 * @param CallContext The CallContext.
95 *
96 * @return the description of this artifact.
97 */
98 public Document describe(Document data, CallContext context) {
99 logger.debug("Describe the artifact.");
100
101 return super.describe(data, context);
102 }
103
104
105 /**
106 * Call an output target.
107 *
108 * @param format The format for the output.
109 * @param outStream The output stream.
110 * @param context The CallContext.
111 * @throws IOException if an error occured while writing the result to the
112 * output stream.
113 */
114 public void out(
115 Document format, OutputStream outStream, CallContext context)
116 throws IOException
117 {
118 logger.debug("Call an out target.");
119
120 super.out(format, outStream, context);
121 }
122 }
123 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org