annotate artifacts/src/main/java/org/dive4elements/artifacts/ArtifactCollection.java @ 475:415df0fc4fa1

Fixed maven group ids
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 12:23:04 +0200
parents 1a87cb24a446
children
rev   line source
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 /*
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2 * Copyright (c) 2011 by Intevation GmbH
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 *
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4 * This program is free software under the LGPL (>=v2.1)
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 * Read the file LGPL.txt coming with the software for details
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
7 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
8
475
415df0fc4fa1 Fixed maven group ids
Sascha L. Teichmann <teichmann@intevation.de>
parents: 471
diff changeset
9 package org.dive4elements.artifacts;
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
10
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 import org.w3c.dom.Document;
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
12
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
13 import java.io.IOException;
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
14 import java.io.OutputStream;
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
15 import java.io.Serializable;
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
16
118
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
17 import java.util.Date;
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
18
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19 public interface ArtifactCollection
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 extends Serializable
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
21 {
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
22 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
23 * Set a new identifier for this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
24 * @param identifier New identifier for this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
25 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
26 void setIdentifier(String identifier);
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
27
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
28 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
29 * Identify this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
30 * @return Returns unique string to identify this collection globally.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
31 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
32 String identifier();
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
33
159
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 118
diff changeset
34 String getName();
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 118
diff changeset
35
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 118
diff changeset
36 void setName(String name);
db0d20440b92 Added code to create collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 118
diff changeset
37
118
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
38 Date getCreationTime();
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
39
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
40 void setCreationTime(Date creationTime);
0e0c27bc0b90 Added creation time to collections.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 116
diff changeset
41
281
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 269
diff changeset
42 long getTTL();
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 269
diff changeset
43
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 269
diff changeset
44 void setTTL(long ttl);
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 269
diff changeset
45
221
f75f83af19e0 Made the 'attribute' document of an ArtifactCollection accessible with getter and setter methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 218
diff changeset
46 Document getAttribute();
f75f83af19e0 Made the 'attribute' document of an ArtifactCollection accessible with getter and setter methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 218
diff changeset
47
f75f83af19e0 Made the 'attribute' document of an ArtifactCollection accessible with getter and setter methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 218
diff changeset
48 void setAttribute(Document attribute);
f75f83af19e0 Made the 'attribute' document of an ArtifactCollection accessible with getter and setter methods.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 218
diff changeset
49
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
50 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
51 * Set a new owner of this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
52 * @param user New owner for this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
53 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
54 void setUser(User user);
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
55
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
56 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
57 * Identify the owner of the collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
58 * @return Returns owner of the collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
59 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
60 User getUser(); // FIXME: Is ArtifactCollectionFactory needed?
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
61
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
62 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
63 * When created by a factory this method is called to
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
64 * initialize the collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
65 * @param identifier The identifier from collection database
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
66 * @param factory The factory which created this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
67 * @param context The global context of the runtime system.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
68 * @param data The data which can be use to setup a collection with
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
69 * more details.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
70 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
71 void setup(
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
72 String identifier,
170
ac0f8bd97277 Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 159
diff changeset
73 String name,
ac0f8bd97277 Fix parameter propagation of creation time ond collection names.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 159
diff changeset
74 Date creationTime,
281
942a54670a72 Made the TTL of a Collection retrievable via getter method.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 269
diff changeset
75 long ttl,
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
76 ArtifactCollectionFactory factory,
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
77 Object context,
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
78 Document data);
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
79
218
70cbbe144931 Added a describe() method for ArtifactCollections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 170
diff changeset
80
70cbbe144931 Added a describe() method for ArtifactCollections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 170
diff changeset
81 Document describe(CallContext context);
70cbbe144931 Added a describe() method for ArtifactCollections.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 170
diff changeset
82
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
83 //TODO: create LifeCycle interface
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
84 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
85 * Called from artifact database when an artifact is
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
86 * going to be removed from system.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
87 * @param context The global context of the runtime system.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
88 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
89 void endOfLife(Object context);
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
90
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
91 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
92 * Internal hash of this collection.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
93 * @return Returns hash that should stay the same if the internal
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
94 * value has not changed. Useful for caching
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
95 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
96 String hash();
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
97
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
98
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
99 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
100 * Called from artifact database before an artifact is
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
101 * going to be exported as xml document.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
102 * @param context The global context of the runtime system.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
103 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
104 void cleanup(Object context);
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
105
116
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
106 void addArtifact(Artifact artifact, Document attributes, CallContext context);
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
107
116
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
108 void removeArtifact(Artifact artifact, CallContext context);
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
109
116
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
110 Artifact [] getArtifacts(CallContext context);
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
111
116
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
112 Document getAttribute(Artifact artifactCall, CallContext context);
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
113
2707b7ec273f Added missing call contexts to API.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 115
diff changeset
114 void setAttribute(Artifact artifact, Document document, CallContext context);
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
116 /**
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
117 * Produce output for this collection.
269
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 221
diff changeset
118 * @param type Specifies the output type of the action.
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
119 * @param format Specifies the format of the output.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
120 * @param out Stream to write the result data to.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
121 * @param context The global context of the runtime system.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
122 * @throws IOException Thrown if an I/O occurs.
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
123 */
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
124 void out(
269
d9a99b28a847 Added support for the 'type' parameter of artifacts and collections out() call.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 221
diff changeset
125 String type,
115
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
126 Document format,
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
127 OutputStream out,
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
128 CallContext context)
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
129 throws IOException;
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
130 }
a1200c6ed048 Initial interfaces to handle with Collections and Users.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
131 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org