org.w3c.jigsaw.auth
Class AuthUser

java.lang.Object
  extended by org.w3c.tools.resources.AttributeHolder
      extended by org.w3c.tools.resources.Resource
          extended by org.w3c.jigsaw.auth.AuthUser
All Implemented Interfaces:
java.lang.Cloneable

public class AuthUser
extends Resource

The basic description of a user. A user is defined by the following set of attributes: its name, its email adress, some comments. Than it can have either an IP adress, and/or a password.

If an IP adress is provided, the user will be authentified by its incoming connection IP address. Moreover, if a password is provided, before being authentified, the client will be challenged for it.

Finally a user can be registered in any number of groups.


Field Summary
protected static int ATTR_COMMENTS
          Attribute index - The comments for this user.
protected static int ATTR_EMAIL
          Attribute index - The email adress of the user.
protected static int ATTR_GROUPS
          Attribute index - The list of groups this user belongs to.
protected static int ATTR_IPADDR
          Attribute index - The IP adress of the user.
protected static int ATTR_PASSWORD
          Attribute index - The optional password for the user.
 
Fields inherited from class org.w3c.tools.resources.Resource
ATTR_CONTEXT, ATTR_HELP_URL, ATTR_IDENTIFIER, ATTR_LAST_MODIFIED, ATTR_PARENT, ATTR_RESOURCE_FRAMES, ATTR_STORE_ENTRY, ATTR_URL, co, id
 
Fields inherited from class org.w3c.tools.resources.AttributeHolder
attributes, values
 
Constructor Summary
AuthUser()
           
 
Method Summary
 java.lang.String getComments()
          Get the user associated comments.
 java.lang.String getEmail()
          Get the user email address.
 java.lang.String[] getGroups()
          Get the user groups.
 short[][] getIPTemplates()
          Get the user IP templates.
 java.lang.String getName()
          Get this user's name.
 java.lang.String getPassword()
          Get the user password.
static AuthUser makeUser(Resource res, java.lang.String name, ResourceContext context)
          Create a new user.
static AuthUser makeUser(java.lang.String name, ResourceContext context)
          Create a new user.
 void setPassword(java.lang.String passwd)
          Set a new password for this user.
 
Methods inherited from class org.w3c.tools.resources.Resource
acceptUnload, checkMultipleLock, collectFrames, delete, getClone, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getSpaceEntry, getStoreEntry, getURLPath, getValue, getValue, initialize, initialize, isInitialized, isUnloaded, markModified, notifyUnload, pickleValues, registerFrame, setContext, setContext, setValue, setValue, unregisterFrame, unsafeGetContext, unsafeGetFrame, unsafeGetFrames, unsafeGetIdentifier, unsafeGetResourceReference, unsafeGetURLPath, unsafeGetValue, updateAttributes
 
Methods inherited from class org.w3c.tools.resources.AttributeHolder
definesAttribute, definesAttribute, getAttributes, getBoolean, getChar, getClone, getClone, getDouble, getFloat, getInt, getLong, getString, getValue, lookupAttribute, print, setBoolean, setChar, setDouble, setFloat, setInt, setLong, setString, setValue, unsafeDefinesAttribute, unsafeGetDouble, unsafeGetString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTR_EMAIL

protected static int ATTR_EMAIL
Attribute index - The email adress of the user.


ATTR_COMMENTS

protected static int ATTR_COMMENTS
Attribute index - The comments for this user.


ATTR_IPADDR

protected static int ATTR_IPADDR
Attribute index - The IP adress of the user.


ATTR_PASSWORD

protected static int ATTR_PASSWORD
Attribute index - The optional password for the user.


ATTR_GROUPS

protected static int ATTR_GROUPS
Attribute index - The list of groups this user belongs to.

Constructor Detail

AuthUser

public AuthUser()
Method Detail

getName

public java.lang.String getName()
Get this user's name. We use the resource identifier as the user name here.


getEmail

public java.lang.String getEmail()
Get the user email address.


getComments

public java.lang.String getComments()
Get the user associated comments.


getIPTemplates

public short[][] getIPTemplates()
Get the user IP templates.


getPassword

public java.lang.String getPassword()
Get the user password.


setPassword

public void setPassword(java.lang.String passwd)
Set a new password for this user.

Parameters:
passwd - The new user's password.

getGroups

public java.lang.String[] getGroups()
Get the user groups.


makeUser

public static AuthUser makeUser(java.lang.String name,
                                ResourceContext context)
Create a new user.

Parameters:
name - The user's name.

makeUser

public static AuthUser makeUser(Resource res,
                                java.lang.String name,
                                ResourceContext context)
Create a new user.

Parameters:
name - The user's name.