Mercurial > dive4elements > framework
changeset 409:4748949c4f19
Extend user class implementations to handle account information
artifacts/trunk@5245 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Thu, 23 Aug 2012 13:42:41 +0000 |
parents | 7cdd63310d5c |
children | f456d9d55541 |
files | ChangeLog artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java |
diffstat | 4 files changed, 43 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Aug 23 13:39:30 2012 +0000 +++ b/ChangeLog Thu Aug 23 13:42:41 2012 +0000 @@ -1,3 +1,9 @@ +2012-08-23 Björn Ricks <bjoern.ricks@intevation.de> + * artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java, + artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java: + Extend user class implementations to handle account information. + 2012-08-23 Björn Ricks <bjoern.ricks@intevation.de> * artifacts/src/main/java/de/intevation/artifacts/UserFactory.java,
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java Thu Aug 23 13:39:30 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUser.java Thu Aug 23 13:42:41 2012 +0000 @@ -25,6 +25,9 @@ /** The name of the user.*/ protected String name; + /** The account name of the user.*/ + protected String account; + /** The role of the user.*/ protected Document role; @@ -44,12 +47,15 @@ * * @param identifier The uuid of the user. * @param name The name of the user. + * @param account The account name of the user. * @param role The role of the user. */ - public DefaultUser(String identifier, String name, Document role) { + public DefaultUser(String identifier, String name, String account, + Document role) { this.identifier = identifier; this.name = name; this.role = role; + this.account = account; } @@ -58,6 +64,7 @@ * * @return the identifier of this user. */ + @Override public String identifier() { return identifier; } @@ -68,6 +75,7 @@ * * @return the name of the user. */ + @Override public String getName() { return name; } @@ -78,6 +86,7 @@ * * @param name The name for this user. */ + @Override public void setName(String name) { this.name = name; } @@ -88,6 +97,7 @@ * * @param identifier The new identifier. */ + @Override public void setIdentifier(String identifier) { this.identifier = identifier; } @@ -98,6 +108,7 @@ * * @param role The new role of the user. */ + @Override public void setRole(Document role) { this.role = role; } @@ -108,8 +119,19 @@ * * @return the role of the user. */ + @Override public Document getRole() { return role; } + + /** + * Returns the account of the user. + * + * @return the account name of the user. + */ + @Override + public String getAccount() { + return account; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java Thu Aug 23 13:39:30 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/DefaultUserFactory.java Thu Aug 23 13:42:41 2012 +0000 @@ -47,17 +47,19 @@ * * @param identifier The identifier for the new user. * @param name The name for the new user. + * @param account The name of the new users account. * @param role The role for the new user. * @param context The CallContext. */ public User createUser( String identifier, String name, + String account, Document role, Object context) { logger.debug("DefaultUserFactory.createUser: " + name); - return new DefaultUser(identifier, name, role); + return new DefaultUser(identifier, name, account, role); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java Thu Aug 23 13:39:30 2012 +0000 +++ b/artifact-database/src/main/java/de/intevation/artifactdatabase/LazyBackendUser.java Thu Aug 23 13:42:41 2012 +0000 @@ -43,28 +43,39 @@ return user; } + @Override public String identifier() { return getUser().identifier(); } + @Override public String getName() { return getUser().getName(); } + @Override public void setName(String name) { getUser().setName(name); } + @Override public void setIdentifier(String identifier) { getUser().setIdentifier(identifier); } + @Override public Document getRole() { return getUser().getRole(); } + @Override public void setRole(Document document) { getUser().setRole(document); } + + @Override + public String getAccount() { + return getUser().getAccount(); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :