comparison artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java @ 123:9187abefba8b

Added a default implementation of a UserFactory and a new constructor to create new DefaultUsers. artifacts/trunk@1346 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 01 Mar 2011 17:14:10 +0000
parents
children 147610c43863
comparison
equal deleted inserted replaced
122:c9cf5f33a230 123:9187abefba8b
1 /*
2 * Copyright (c) 2010 by Intevation GmbH
3 *
4 * This program is free software under the LGPL (>=v2.1)
5 * Read the file LGPL.txt coming with the software for details
6 * or visit http://www.gnu.org/licenses/ if it does not exist.
7 */
8
9 package de.intevation.artifactdatabase;
10
11 import org.apache.log4j.Logger;
12
13 import org.w3c.dom.Document;
14
15 import de.intevation.artifacts.User;
16 import de.intevation.artifacts.UserFactory;
17
18
19 /**
20 * Default implementation of a UserFactory.
21 *
22 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
23 */
24 public class DefaultUserFactory
25 implements UserFactory
26 {
27 /** The logger that is used in this factory.*/
28 private static Logger logger = Logger.getLogger(DefaultUserFactory.class);
29
30
31 /**
32 * Default constructor.
33 */
34 public DefaultUserFactory() {
35 }
36
37
38 /**
39 * This method creates a new DefaultUser with the given identifier, name and
40 * role.
41 *
42 * @param identifier The identifier for the new user.
43 * @param name The name for the new user.
44 * @param role The role for the new user.
45 * @param context The CallContext.
46 */
47 public User createUser(
48 String identifier,
49 String name,
50 Document role,
51 Object context)
52 {
53 logger.debug("DefaultUserFactory.createUser: " + name);
54
55 return new DefaultUser(identifier, name, role);
56 }
57
58
59 /**
60 * Deletes the given user.
61 *
62 * @param user The user to be deleted.
63 * @param context The CallContext.
64 */
65 public void deleteUser(User user, Object context) {
66 logger.debug("DefaultUserFactory.deleteUser: " + user.identifier());
67 }
68
69
70 /**
71 * Returns the user with the given identifier.
72 *
73 * @param identifier The identifier of a user.
74 * @param context The CallContext.
75 *
76 * @return the user with the given identifier.
77 */
78 public User getUser(String identifier, Object context) {
79 logger.debug("DefaultUserFactory.getUser: " + identifier);
80
81 // TODO Implement me
82 return null;
83 }
84
85
86 /**
87 * Returns a list of users available for this application.
88 *
89 * @param context The CallContext.
90 *
91 * @return a list of users.
92 */
93 public User [] getUsers(Object context) {
94 logger.debug("DefaultUserFactory.getUsers");
95
96 // TODO Implement me
97 return null;
98 }
99 }
100 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org