org.apache.lenya.cms.ac
Class PublicationAccessControllerResolver

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.ac.impl.AbstractAccessControllerResolver
          extended by org.apache.lenya.cms.ac.PublicationAccessControllerResolver
All Implemented Interfaces:
org.apache.avalon.framework.activity.Initializable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.thread.ThreadSafe, AccessControllerResolver

public class PublicationAccessControllerResolver
extends AbstractAccessControllerResolver
implements org.apache.avalon.framework.activity.Initializable

Resolves the access controller according to the ac.xconf file of a publication.


Field Summary
protected static java.lang.String CONFIGURATION_FILE
           
protected static java.lang.String TYPE_ATTRIBUTE
           
 
Fields inherited from class org.apache.lenya.ac.impl.AbstractAccessControllerResolver
CAPACITY
 
Fields inherited from interface org.apache.lenya.ac.AccessControllerResolver
DEFAULT_RESOLVER, ROLE
 
Constructor Summary
PublicationAccessControllerResolver()
           
 
Method Summary
 AccessController doResolveAccessController(java.lang.String webappUrl)
          The actual resolving method.
protected  java.lang.Object generateCacheKey(java.lang.String webappUrl, org.apache.excalibur.source.SourceResolver resolver)
          This implementation uses the publication ID in combination with the context path as cache key.
protected  java.io.File getContext()
          Returns the servlet context.
protected  Publication getPublication(java.lang.String webappUrl)
          Returns the publication for the webapp URL or null if the URL is not included in a publication.
 void initialize()
           
 AccessController resolveAccessController(Publication publication, java.lang.String url)
          Resolves an access controller for a certain URL within a publication.
 
Methods inherited from class org.apache.lenya.ac.impl.AbstractAccessControllerResolver
getManager, release, resolveAccessController, service
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONFIGURATION_FILE

protected static final java.lang.String CONFIGURATION_FILE

TYPE_ATTRIBUTE

protected static final java.lang.String TYPE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

PublicationAccessControllerResolver

public PublicationAccessControllerResolver()
Method Detail

generateCacheKey

protected java.lang.Object generateCacheKey(java.lang.String webappUrl,
                                            org.apache.excalibur.source.SourceResolver resolver)
                                     throws AccessControlException
This implementation uses the publication ID in combination with the context path as cache key.

Overrides:
generateCacheKey in class AbstractAccessControllerResolver
Parameters:
webappUrl - The webapp URL.
resolver - The source resolver.
Returns:
An object.
Throws:
AccessControlException - when something went wrong.
See Also:
AbstractAccessControllerResolver.generateCacheKey(java.lang.String, org.apache.excalibur.source.SourceResolver)

doResolveAccessController

public AccessController doResolveAccessController(java.lang.String webappUrl)
                                           throws AccessControlException
Description copied from class: AbstractAccessControllerResolver
The actual resolving method.

Specified by:
doResolveAccessController in class AbstractAccessControllerResolver
Parameters:
webappUrl - The URL within the web application.
Returns:
An access controller.
Throws:
AccessControlException - when something went wrong.
See Also:
AbstractAccessControllerResolver.doResolveAccessController(java.lang.String)

getPublication

protected Publication getPublication(java.lang.String webappUrl)
                              throws AccessControlException
Returns the publication for the webapp URL or null if the URL is not included in a publication.

Parameters:
webappUrl - The webapp URL.
Returns:
A publication.
Throws:
AccessControlException - when something went wrong.

getContext

protected java.io.File getContext()
                           throws AccessControlException
Returns the servlet context.

Returns:
A file.
Throws:
AccessControlException - when something went wrong.

resolveAccessController

public AccessController resolveAccessController(Publication publication,
                                                java.lang.String url)
                                         throws AccessControlException
Resolves an access controller for a certain URL within a publication.

Parameters:
publication - The publication.
url - The url within the publication.
Returns:
An access controller.
Throws:
AccessControlException - when something went wrong.

initialize

public void initialize()
                throws java.lang.Exception
Specified by:
initialize in interface org.apache.avalon.framework.activity.Initializable
Throws:
java.lang.Exception
See Also:
Initializable.initialize()


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.