org.w3c.jigsaw.auth
Class AuthRealm

java.lang.Object
  extended by org.w3c.tools.resources.AttributeHolder
      extended by org.w3c.tools.resources.Resource
          extended by org.w3c.tools.resources.FramedResource
              extended by org.w3c.tools.resources.AbstractContainer
                  extended by org.w3c.tools.resources.ContainerResource
                      extended by org.w3c.tools.resources.ExternalContainer
                          extended by org.w3c.jigsaw.auth.AuthRealm
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, ContainerInterface, AttributeChangedListener, FrameEventListener, StructureChangedListener

public class AuthRealm
extends ExternalContainer


Field Summary
 
Fields inherited from class org.w3c.tools.resources.ExternalContainer
repository, transientFlag
 
Fields inherited from class org.w3c.tools.resources.ContainerResource
acquired, ATTR_KEY, debug
 
Fields inherited from class org.w3c.tools.resources.AbstractContainer
ur
 
Fields inherited from class org.w3c.tools.resources.FramedResource
ATTR_OID, attrListener, debugEvent, event_disabled, framesRef, structListener
 
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
AuthRealm()
           
AuthRealm(java.lang.String id, ResourceContext context)
           
 
Method Summary
 java.util.Enumeration enumerateUserNames()
          Enumerate this realm user's name.
 java.io.File getRepository(ResourceContext context)
          Get The repository for this external container.
 ResourceReference loadUser(java.lang.String name)
          Load the user having this name.
static AuthRealm makeRealm(ResourceContext context, java.lang.String name)
          create a new empty realm.
static AuthRealm makeRealm(Resource res, ResourceContext context, java.lang.String name)
          create a new empty realm.
 void registerResource(java.lang.String name, Resource resource, java.util.Hashtable defs)
          Initialize and register the given resource within that container.
 void registerUser(AuthUser user)
          register this new user in the realm.
 void save()
          Save our store.
 void unregisterUser(java.lang.String name)
          Unregister a user from the realm.
 
Methods inherited from class org.w3c.tools.resources.ExternalContainer
acquireChildren, createDefaultResource, delete, initialize, markModified
 
Methods inherited from class org.w3c.tools.resources.ContainerResource
addResource, delete, deleteChildren, enumerateResourceIdentifiers, getChildrenSpaceEntry, getClone, getKey, getMatchingCharsCount, getSpaceEntry, internalLookup, lookup, lookup, notifyUnload, replace, resourceCreated, resourceModified, resourceRemoved, updateDefaultChildAttributes
 
Methods inherited from class org.w3c.tools.resources.AbstractContainer
attributeChanged, enumerateResourceIdentifiers, resourceUnloaded
 
Methods inherited from class org.w3c.tools.resources.FramedResource
addAttributeChangedListener, addStructureChangedListener, collectFramesReference, disableEvent, displayEvent, enableEvent, eventDisabled, fireAttributeChangeEvent, fireStructureChangedEvent, fireStructureChangedEvent, frameAdded, frameModified, frameRemoved, getFrame, getFrame, getFrameReference, getFrameReference, getFramesReference, getOid, perform, performFrames, postAttributeChangeEvent, postEvent, postStructureChangedEvent, postStructureChangedEvent, processEvent, registerFrame, registerFrameIfNone, removeAttributeChangedListener, removeStructureChangedListener, setSilentValue, setSilentValue, setValue, unregisterFrame
 
Methods inherited from class org.w3c.tools.resources.Resource
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getResourceReference, getServer, getSpace, getStoreEntry, getURLPath, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, 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
 

Constructor Detail

AuthRealm

public AuthRealm(java.lang.String id,
                 ResourceContext context)

AuthRealm

public AuthRealm()
Method Detail

loadUser

public ResourceReference loadUser(java.lang.String name)
Load the user having this name.

Parameters:
name - The user's name.
Returns:
An instance of AuthUser or null if not found.

registerUser

public void registerUser(AuthUser user)
register this new user in the realm.

Parameters:
user - The new user.

registerResource

public void registerResource(java.lang.String name,
                             Resource resource,
                             java.util.Hashtable defs)
Description copied from class: ContainerResource
Initialize and register the given resource within that container.

Specified by:
registerResource in interface ContainerInterface
Overrides:
registerResource in class ContainerResource
Parameters:
name - The identifier for the resource.
resource - An unitialized resource instance.
defs - A default set of init attribute values (may be null).

unregisterUser

public void unregisterUser(java.lang.String name)
                    throws MultipleLockException
Unregister a user from the realm.

Parameters:
name - The user's name.
Throws:
MultipleLockException - if someone else has locked this user.

enumerateUserNames

public java.util.Enumeration enumerateUserNames()
Enumerate this realm user's name.


makeRealm

public static AuthRealm makeRealm(ResourceContext context,
                                  java.lang.String name)
create a new empty realm.

Parameters:
name - The name of the realm.
repository - The file to use to store the realm database.

makeRealm

public static AuthRealm makeRealm(Resource res,
                                  ResourceContext context,
                                  java.lang.String name)
create a new empty realm.

Parameters:
name - The name of the realm.
repository - The file to use to store the realm database.

save

public void save()
Save our store.


getRepository

public java.io.File getRepository(ResourceContext context)
Description copied from class: ExternalContainer
Get The repository for this external container. Warning: called in the constructor!

Specified by:
getRepository in class ExternalContainer
Parameters:
context - The container context.
Returns:
A File instance