Holger's
Java API

com.antelmann.db
Interface User

All Superinterfaces:
Comparable<User>, DBEntry, Enabled, Principal, Serializable
All Known Implementing Classes:
GUser, SecureUserImpl, UserImpl

public interface User
extends DBEntry, Comparable<User>, Enabled, Principal

This interface defines the basic functionality for a user; setter methods are optional in the sense that they may generally throw an UnsupportedOperationException

Author:
Holger Antelmann
See Also:
UserLoginStore

Field Summary
 
Fields inherited from interface com.antelmann.db.DBEntry
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR
 
Fields inherited from interface com.antelmann.util.Enabled
FILTER
 
Method Summary
 boolean checkPassword(char[] password)
          returns true only if the provided password matches the one of this user
 String getEmail()
           
 String getPasswordHash()
          returns the password representation suitable for serialization or other permanent storage
 String getUserDescription()
           
 boolean hasAccess(Object action)
          determines whether this user is allowed to access the given resource
 void resetPassword()
          resets the password to a commonly known value for this instance
 void setAccess(Object action, boolean flag)
          grants/denies access to the given action
 void setEmail(String email)
           
 void setName(String name)
           
 void setPassword(char[] newPassword)
          sets the password for this user (the password itself is not stored, but a hashed version of it)
 void setPasswordHash(String hashedString)
          directly sets the hashed version of the password (so that the password can be changed to that of another user without knowing it)
 void setUserDescription(String desc)
           
 
Methods inherited from interface com.antelmann.db.DBEntry
getID
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.antelmann.util.Enabled
isEnabled, setEnabled
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Method Detail

checkPassword

boolean checkPassword(char[] password)
returns true only if the provided password matches the one of this user


getPasswordHash

String getPasswordHash()
returns the password representation suitable for serialization or other permanent storage


setPassword

void setPassword(char[] newPassword)
                 throws UnsupportedOperationException
sets the password for this user (the password itself is not stored, but a hashed version of it)

Throws:
UnsupportedOperationException

setPasswordHash

void setPasswordHash(String hashedString)
                     throws UnsupportedOperationException
directly sets the hashed version of the password (so that the password can be changed to that of another user without knowing it)

Throws:
UnsupportedOperationException

resetPassword

void resetPassword()
                   throws UnsupportedOperationException
resets the password to a commonly known value for this instance

Throws:
UnsupportedOperationException

setName

void setName(String name)
             throws UnsupportedOperationException
Throws:
UnsupportedOperationException

getUserDescription

String getUserDescription()

setUserDescription

void setUserDescription(String desc)
                        throws UnsupportedOperationException
Throws:
UnsupportedOperationException

getEmail

String getEmail()

setEmail

void setEmail(String email)
              throws UnsupportedOperationException
Throws:
UnsupportedOperationException

hasAccess

boolean hasAccess(Object action)
determines whether this user is allowed to access the given resource


setAccess

void setAccess(Object action,
               boolean flag)
               throws UnsupportedOperationException
grants/denies access to the given action

Throws:
UnsupportedOperationException


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads