Mercurial > dive4elements > framework
annotate artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java @ 120:c030895edfcb
Added method to figure out TTL of a collection.
artifacts/trunk@1343 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Tue, 01 Mar 2011 16:07:25 +0000 |
parents | 3bb121d5b0b7 |
children | 9187abefba8b |
rev | line source |
---|---|
119
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
1 /* |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
2 * Copyright (c) 2011 by Intevation GmbH |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
3 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
4 * This program is free software under the LGPL (>=v2.1) |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
5 * Read the file LGPL.txt coming with the software for details |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
6 * or visit http://www.gnu.org/licenses/ if it does not exist. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
7 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
8 package de.intevation.artifactdatabase; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
9 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
10 import org.w3c.dom.Document; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
11 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
12 import de.intevation.artifacts.User; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
13 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
14 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
15 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
16 * Trivial implementation of a user. Useful to be subclassed. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
17 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
18 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
19 public class DefaultUser |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
20 implements User |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
21 { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
22 /** The identifier of the user.*/ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
23 protected String identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
24 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
25 /** The name of the user.*/ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
26 protected String name; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
27 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
28 /** The role of the user.*/ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
29 protected Document role; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
30 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
31 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
32 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
33 * The default constructor. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
34 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
35 public DefaultUser() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
36 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
37 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
38 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
39 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
40 * Returns the identifier of this user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
41 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
42 * @return the identifier of this user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
43 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
44 public String identifier() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
45 return identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
46 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
47 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
48 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
49 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
50 * Returns the name of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
51 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
52 * @return the name of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
53 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
54 public String getName() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
55 return name; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
56 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
57 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
58 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
59 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
60 * Set the name of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
61 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
62 * @param name The name for this user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
63 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
64 public void setName(String name) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
65 this.name = name; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
66 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
67 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
68 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
69 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
70 * Set the identifier of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
71 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
72 * @param identifier The new identifier. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
73 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
74 public void setIdentifier(String identifier) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
75 this.identifier = identifier; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
76 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
77 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
78 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
79 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
80 * Set the role of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
81 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
82 * @param role The new role of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
83 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
84 public void setRole(Document role) { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
85 this.role = role; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
86 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
87 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
88 |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
89 /** |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
90 * Returns the role of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
91 * |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
92 * @return the role of the user. |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
93 */ |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
94 public Document getRole() { |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
95 return role; |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
96 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
97 } |
3bb121d5b0b7
Added a default implementation of an ArtifactCollection and a User.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff
changeset
|
98 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |