ingo@119: /* ingo@119: * Copyright (c) 2011 by Intevation GmbH ingo@119: * ingo@119: * This program is free software under the LGPL (>=v2.1) ingo@119: * Read the file LGPL.txt coming with the software for details ingo@119: * or visit http://www.gnu.org/licenses/ if it does not exist. ingo@119: */ ingo@119: package de.intevation.artifactdatabase; ingo@119: ingo@119: import org.w3c.dom.Document; ingo@119: ingo@119: import de.intevation.artifacts.User; ingo@119: ingo@119: ingo@119: /** ingo@119: * Trivial implementation of a user. Useful to be subclassed. ingo@119: * @author Ingo Weinzierl ingo@119: */ ingo@119: public class DefaultUser ingo@119: implements User ingo@119: { ingo@119: /** The identifier of the user.*/ ingo@119: protected String identifier; ingo@119: ingo@119: /** The name of the user.*/ ingo@119: protected String name; ingo@119: bjoern@409: /** The account name of the user.*/ bjoern@409: protected String account; bjoern@409: ingo@119: /** The role of the user.*/ ingo@119: protected Document role; ingo@119: ingo@119: ingo@119: /** ingo@119: * The default constructor. ingo@119: */ ingo@119: public DefaultUser() { ingo@119: } ingo@119: sascha@316: public DefaultUser(String identifier) { sascha@316: this.identifier = identifier; sascha@316: } ingo@119: ingo@119: /** ingo@123: * A constructor that creates a new user. ingo@123: * ingo@123: * @param identifier The uuid of the user. ingo@123: * @param name The name of the user. bjoern@409: * @param account The account name of the user. ingo@123: * @param role The role of the user. ingo@123: */ bjoern@409: public DefaultUser(String identifier, String name, String account, bjoern@409: Document role) { ingo@123: this.identifier = identifier; ingo@123: this.name = name; ingo@123: this.role = role; bjoern@409: this.account = account; ingo@123: } ingo@123: ingo@123: ingo@123: /** ingo@119: * Returns the identifier of this user. ingo@119: * ingo@119: * @return the identifier of this user. ingo@119: */ bjoern@409: @Override ingo@119: public String identifier() { ingo@119: return identifier; ingo@119: } ingo@119: ingo@119: ingo@119: /** ingo@119: * Returns the name of the user. ingo@119: * ingo@119: * @return the name of the user. ingo@119: */ bjoern@409: @Override ingo@119: public String getName() { ingo@119: return name; ingo@119: } ingo@119: ingo@119: ingo@119: /** ingo@119: * Set the name of the user. ingo@119: * ingo@119: * @param name The name for this user. ingo@119: */ bjoern@409: @Override ingo@119: public void setName(String name) { ingo@119: this.name = name; ingo@119: } ingo@119: ingo@119: ingo@119: /** ingo@119: * Set the identifier of the user. ingo@119: * ingo@119: * @param identifier The new identifier. ingo@119: */ bjoern@409: @Override ingo@119: public void setIdentifier(String identifier) { ingo@119: this.identifier = identifier; ingo@119: } ingo@119: ingo@119: ingo@119: /** ingo@119: * Set the role of the user. ingo@119: * ingo@119: * @param role The new role of the user. ingo@119: */ bjoern@409: @Override ingo@119: public void setRole(Document role) { ingo@119: this.role = role; ingo@119: } ingo@119: ingo@119: ingo@119: /** ingo@119: * Returns the role of the user. ingo@119: * ingo@119: * @return the role of the user. ingo@119: */ bjoern@409: @Override ingo@119: public Document getRole() { ingo@119: return role; ingo@119: } bjoern@409: bjoern@409: /** bjoern@409: * Returns the account of the user. bjoern@409: * bjoern@409: * @return the account name of the user. bjoern@409: */ bjoern@409: @Override bjoern@409: public String getAccount() { bjoern@409: return account; bjoern@409: } ingo@119: } ingo@119: // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :