org.w3c.jigsaw.acl
Class AclW3Cdb

java.lang.Object
  |
  +--org.w3c.tools.resources.AttributeHolder
        |
        +--org.w3c.tools.resources.Resource
              |
              +--org.w3c.tools.resources.FramedResource
                    |
                    +--org.w3c.tools.resources.ResourceFrame
                          |
                          +--org.w3c.tools.resources.MetaDataFrame
                                |
                                +--org.w3c.jigsaw.acl.JAcl
                                      |
                                      +--org.w3c.jigsaw.acl.AclW3Cdb
All Implemented Interfaces:
java.security.acl.Acl, AttributeChangedListener, java.lang.Cloneable, java.util.EventListener, FrameEventListener, java.security.acl.Owner

public class AclW3Cdb
extends JAcl

This class implement ACL taken form a Database, with a format used internally at W3C, see http://www.w3.org/Systems/Database/Auth/Design for more details


Field Summary
protected static int ATTR_ACL_REALM_NAME
          Attribute index - The realm name
protected static int ATTR_ACL_URI
          Attribute index - The acl URI
protected static int ATTR_DB_CACHE_ENABLED
          Attribute index - Should we cache some db replies?
protected static int ATTR_DB_CACHE_SIZE
          Attribute index - The cache size
protected static int ATTR_DB_CACHE_TIME
          Attribute index - The caching time of db results
protected static int ATTR_DB_DRIVER
          Attribute index - The class name of the driver
protected static int ATTR_DB_PASSWD
          Attribute index - The password of the database
protected static int ATTR_DB_URI
          Attribute index - The URI of the database
protected static int ATTR_DB_USER
          Attribute index - The User of the database
protected static int ATTR_USE_IPMATCH
          Attribute index - Should we use ip-based access or not?
protected  int cacheSize
           
protected  long cacheTimeout
           
protected  java.util.Vector entries
           
protected  java.util.Properties props
           
protected static java.lang.String STR_CHACL
           
protected static java.lang.String STR_CONNECT
           
protected static java.lang.String STR_DELEGATE
           
protected static java.lang.String STR_DELETE
           
protected static java.lang.String STR_FULL
           
protected static java.lang.String STR_FULL_HTTP
           
protected static java.lang.String STR_GET
           
protected static java.lang.String STR_HEAD
           
protected static java.lang.String STR_OPTIONS
           
protected static java.lang.String STR_POST
           
protected static java.lang.String STR_PUT
           
protected static java.lang.String STR_RACL
           
protected static java.lang.String STR_TRACE
           
protected  boolean useCache
           
protected  boolean useIPMatch
           
 
Fields inherited from class org.w3c.tools.resources.ResourceFrame
filterClass, frameListener, resource
 
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
AclW3Cdb()
           
 
Method Summary
 boolean addEntry(java.security.Principal caller, java.security.acl.AclEntry entry)
           
 boolean addOwner(java.security.Principal caller, java.security.Principal owner)
           
 boolean checkPermission(java.security.Principal principal, java.security.acl.Permission permission)
           
protected  void createEntry(AuthUser user)
           
 boolean deleteOwner(java.security.Principal caller, java.security.Principal owner)
           
 java.util.Enumeration entries()
           
protected  java.lang.String getAccessString(Request req)
           
 java.lang.String getName()
           
 java.util.Enumeration getPermissions(java.security.Principal user)
           
protected  boolean hasPrincipal(java.security.Principal p)
           
 void initialize(java.lang.Object[] values)
          Initialize the Acl.
 boolean isOwner(java.security.Principal owner)
           
 boolean removeEntry(java.security.Principal caller, java.security.acl.AclEntry entry)
           
 void setName(java.security.Principal caller, java.lang.String name)
           
 void setValue(int idx, java.lang.Object value)
          Catch setValue, to maintain cached header values correctness.
 java.lang.String toString()
           
 
Methods inherited from class org.w3c.tools.resources.MetaDataFrame
getTargetResource, perform
 
Methods inherited from class org.w3c.tools.resources.ResourceFrame
addFrameEventListener, attributeChanged, checkRequest, eventDisabled, fireFrameEvent, frameModified, getFilters, getFilters, getFrameReference, getResource, getResourceReference, getSpaceEntry, getURLPath, lookup, lookupFilters, lookupFrames, postFrameEvent, processEvent, registerResource, removeFrameEventListener, unregisterResource, updateDefaultChildAttributes
 
Methods inherited from class org.w3c.tools.resources.FramedResource
addAttributeChangedListener, addStructureChangedListener, collectFramesReference, delete, disableEvent, displayEvent, enableEvent, fireAttributeChangeEvent, fireStructureChangedEvent, fireStructureChangedEvent, frameAdded, frameRemoved, getClone, getFrame, getFrame, getFrameReference, getFrameReference, getFramesReference, getOid, markModified, notifyUnload, performFrames, postAttributeChangeEvent, postEvent, postStructureChangedEvent, postStructureChangedEvent, registerFrame, registerFrameIfNone, removeAttributeChangedListener, removeStructureChangedListener, setSilentValue, setSilentValue, unregisterFrame
 
Methods inherited from class org.w3c.tools.resources.Resource
acceptUnload, checkMultipleLock, collectFrames, getContext, getFrame, getFrames, getHelpURL, getHelpURL, getIdentifier, getLastModified, getParent, getServer, getSpace, getStoreEntry, getValue, getValue, initialize, isInitialized, isUnloaded, pickleValues, setContext, setContext, setValue, unsafeGetContext, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ATTR_DB_DRIVER

protected static int ATTR_DB_DRIVER
Attribute index - The class name of the driver


ATTR_DB_URI

protected static int ATTR_DB_URI
Attribute index - The URI of the database


ATTR_DB_USER

protected static int ATTR_DB_USER
Attribute index - The User of the database


ATTR_DB_PASSWD

protected static int ATTR_DB_PASSWD
Attribute index - The password of the database


ATTR_ACL_URI

protected static int ATTR_ACL_URI
Attribute index - The acl URI


ATTR_ACL_REALM_NAME

protected static int ATTR_ACL_REALM_NAME
Attribute index - The realm name


ATTR_DB_CACHE_ENABLED

protected static int ATTR_DB_CACHE_ENABLED
Attribute index - Should we cache some db replies?


ATTR_DB_CACHE_SIZE

protected static int ATTR_DB_CACHE_SIZE
Attribute index - The cache size


ATTR_DB_CACHE_TIME

protected static int ATTR_DB_CACHE_TIME
Attribute index - The caching time of db results


ATTR_USE_IPMATCH

protected static int ATTR_USE_IPMATCH
Attribute index - Should we use ip-based access or not?


STR_CHACL

protected static final java.lang.String STR_CHACL
See Also:
Constant Field Values

STR_RACL

protected static final java.lang.String STR_RACL
See Also:
Constant Field Values

STR_DELEGATE

protected static final java.lang.String STR_DELEGATE
See Also:
Constant Field Values

STR_HEAD

protected static final java.lang.String STR_HEAD
See Also:
Constant Field Values

STR_GET

protected static final java.lang.String STR_GET
See Also:
Constant Field Values

STR_PUT

protected static final java.lang.String STR_PUT
See Also:
Constant Field Values

STR_POST

protected static final java.lang.String STR_POST
See Also:
Constant Field Values

STR_DELETE

protected static final java.lang.String STR_DELETE
See Also:
Constant Field Values

STR_CONNECT

protected static final java.lang.String STR_CONNECT
See Also:
Constant Field Values

STR_OPTIONS

protected static final java.lang.String STR_OPTIONS
See Also:
Constant Field Values

STR_TRACE

protected static final java.lang.String STR_TRACE
See Also:
Constant Field Values

STR_FULL_HTTP

protected static final java.lang.String STR_FULL_HTTP
See Also:
Constant Field Values

STR_FULL

protected static final java.lang.String STR_FULL
See Also:
Constant Field Values

entries

protected java.util.Vector entries

props

protected java.util.Properties props

useCache

protected boolean useCache

useIPMatch

protected boolean useIPMatch

cacheSize

protected int cacheSize

cacheTimeout

protected long cacheTimeout
Constructor Detail

AclW3Cdb

public AclW3Cdb()
Method Detail

createEntry

protected void createEntry(AuthUser user)

hasPrincipal

protected boolean hasPrincipal(java.security.Principal p)

addOwner

public boolean addOwner(java.security.Principal caller,
                        java.security.Principal owner)
                 throws java.security.acl.NotOwnerException
java.security.acl.NotOwnerException

deleteOwner

public boolean deleteOwner(java.security.Principal caller,
                           java.security.Principal owner)
                    throws java.security.acl.NotOwnerException,
                           java.security.acl.LastOwnerException
java.security.acl.NotOwnerException
java.security.acl.LastOwnerException

isOwner

public boolean isOwner(java.security.Principal owner)

setName

public void setName(java.security.Principal caller,
                    java.lang.String name)
             throws java.security.acl.NotOwnerException
java.security.acl.NotOwnerException

getName

public java.lang.String getName()

addEntry

public boolean addEntry(java.security.Principal caller,
                        java.security.acl.AclEntry entry)
                 throws java.security.acl.NotOwnerException
java.security.acl.NotOwnerException

removeEntry

public boolean removeEntry(java.security.Principal caller,
                           java.security.acl.AclEntry entry)
                    throws java.security.acl.NotOwnerException
java.security.acl.NotOwnerException

getPermissions

public java.util.Enumeration getPermissions(java.security.Principal user)

entries

public java.util.Enumeration entries()

getAccessString

protected java.lang.String getAccessString(Request req)

checkPermission

public boolean checkPermission(java.security.Principal principal,
                               java.security.acl.Permission permission)

toString

public java.lang.String toString()
Specified by:
toString in interface java.security.acl.Acl
Overrides:
toString in class java.lang.Object

setValue

public void setValue(int idx,
                     java.lang.Object value)
Catch setValue, to maintain cached header values correctness.

Overrides:
setValue in class ResourceFrame
Parameters:
idx - The index of the attribute to be set.
value - The new value for the attribute.

initialize

public void initialize(java.lang.Object[] values)
Initialize the Acl.

Overrides:
initialize in class FramedResource
Parameters:
values - Default attribute values.