org.apache.lenya.cms.ac
Class DocumentPolicyManagerWrapper

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.cms.ac.DocumentPolicyManagerWrapper
All Implemented Interfaces:
org.apache.avalon.framework.activity.Disposable, org.apache.avalon.framework.component.Component, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.lenya.ac.InheritingPolicyManager, org.apache.lenya.ac.PolicyManager

public class DocumentPolicyManagerWrapper
extends org.apache.avalon.framework.logger.AbstractLogEnabled
implements org.apache.lenya.ac.InheritingPolicyManager, org.apache.avalon.framework.service.Serviceable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.activity.Disposable

A PolicyManager which is capable of mapping all URLs of a document to the appropriate canonical URL, e.g. /foo/bar_de.print.html is mapped to /foo/bar.


Field Summary
 
Fields inherited from interface org.apache.lenya.ac.PolicyManager
ROLE
 
Constructor Summary
DocumentPolicyManagerWrapper()
          Ctor.
 
Method Summary
 void accreditableAdded(org.apache.lenya.ac.AccreditableManager manager, org.apache.lenya.ac.Accreditable accreditable)
           
 void accreditableRemoved(org.apache.lenya.ac.AccreditableManager manager, org.apache.lenya.ac.Accreditable accreditable)
           
 org.apache.lenya.ac.Policy buildSubtreePolicy(org.apache.lenya.ac.AccreditableManager controller, java.lang.String url)
           
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
           
 void dispose()
           
 org.apache.lenya.ac.Credential[] getCredentials(org.apache.lenya.ac.AccreditableManager controller, java.lang.String url)
           
 org.apache.lenya.ac.Role[] getGrantedRoles(org.apache.lenya.ac.AccreditableManager accreditableManager, org.apache.lenya.ac.Identity identity, java.lang.String url)
           
 org.apache.lenya.ac.Policy[] getPolicies(org.apache.lenya.ac.AccreditableManager controller, java.lang.String url)
           
 org.apache.lenya.ac.Policy getPolicy(org.apache.lenya.ac.AccreditableManager controller, java.lang.String url)
           
 org.apache.lenya.ac.InheritingPolicyManager getPolicyManager()
           
protected  java.lang.String getPolicyURL(java.lang.String webappUrl)
          Returns the URI which is used to obtain the policy for a webapp URL.
protected  java.lang.String getPolicyUrlCorrect(java.lang.String webappUrl)
          Returns the URI which is used to obtain the policy for a webapp URL.
protected  java.lang.String getPolicyUrlFast(java.lang.String webappUrl)
           
protected  org.apache.lenya.cms.publication.Publication getPublication(java.lang.String url)
          Returns the publication for a certain URL.
protected  org.apache.avalon.framework.service.ServiceManager getServiceManager()
          Returns the service manager.
 void saveSubtreePolicy(java.lang.String url, org.apache.lenya.ac.Policy policy)
           
 void service(org.apache.avalon.framework.service.ServiceManager manager)
           
 void setPolicyManager(org.apache.lenya.ac.InheritingPolicyManager _policyManager)
           
protected  java.lang.String strip(java.lang.String strippedUrl, char delimiter)
           
 
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
 

Constructor Detail

DocumentPolicyManagerWrapper

public DocumentPolicyManagerWrapper()
Ctor.

Method Detail

getPolicyURL

protected java.lang.String getPolicyURL(java.lang.String webappUrl)
                                 throws org.apache.lenya.ac.AccessControlException
Returns the URI which is used to obtain the policy for a webapp URL.

Parameters:
webappUrl - The web application URL.
Returns:
A string.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

getPolicyUrlCorrect

protected java.lang.String getPolicyUrlCorrect(java.lang.String webappUrl)
                                        throws org.apache.lenya.ac.AccessControlException
Returns the URI which is used to obtain the policy for a webapp URL.

Parameters:
webappUrl - The web application URL.
Returns:
A string.
Throws:
org.apache.lenya.ac.AccessControlException - when something went wrong.

getPolicyUrlFast

protected java.lang.String getPolicyUrlFast(java.lang.String webappUrl)
                                     throws org.apache.lenya.ac.AccessControlException
Throws:
org.apache.lenya.ac.AccessControlException

strip

protected java.lang.String strip(java.lang.String strippedUrl,
                                 char delimiter)

getPublication

protected org.apache.lenya.cms.publication.Publication getPublication(java.lang.String url)
                                                               throws org.apache.lenya.ac.AccessControlException
Returns the publication for a certain URL.

Parameters:
url - The webapp url.
Returns:
A publication.
Throws:
org.apache.lenya.ac.AccessControlException - when the publication could not be created.

getServiceManager

protected org.apache.avalon.framework.service.ServiceManager getServiceManager()
Returns the service manager.

Returns:
A service manager.

service

public void service(org.apache.avalon.framework.service.ServiceManager manager)
             throws org.apache.avalon.framework.service.ServiceException
Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException
See Also:
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)

getPolicyManager

public org.apache.lenya.ac.InheritingPolicyManager getPolicyManager()
Returns:
Returns the policyManager.

setPolicyManager

public void setPolicyManager(org.apache.lenya.ac.InheritingPolicyManager _policyManager)
Parameters:
_policyManager - The policyManager to set.

buildSubtreePolicy

public org.apache.lenya.ac.Policy buildSubtreePolicy(org.apache.lenya.ac.AccreditableManager controller,
                                                     java.lang.String url)
                                              throws org.apache.lenya.ac.AccessControlException
Specified by:
buildSubtreePolicy in interface org.apache.lenya.ac.InheritingPolicyManager
Throws:
org.apache.lenya.ac.AccessControlException

getPolicies

public org.apache.lenya.ac.Policy[] getPolicies(org.apache.lenya.ac.AccreditableManager controller,
                                                java.lang.String url)
                                         throws org.apache.lenya.ac.AccessControlException
Specified by:
getPolicies in interface org.apache.lenya.ac.InheritingPolicyManager
Throws:
org.apache.lenya.ac.AccessControlException

saveSubtreePolicy

public void saveSubtreePolicy(java.lang.String url,
                              org.apache.lenya.ac.Policy policy)
                       throws org.apache.lenya.ac.AccessControlException
Specified by:
saveSubtreePolicy in interface org.apache.lenya.ac.InheritingPolicyManager
Throws:
org.apache.lenya.ac.AccessControlException

getPolicy

public org.apache.lenya.ac.Policy getPolicy(org.apache.lenya.ac.AccreditableManager controller,
                                            java.lang.String url)
                                     throws org.apache.lenya.ac.AccessControlException
Specified by:
getPolicy in interface org.apache.lenya.ac.PolicyManager
Throws:
org.apache.lenya.ac.AccessControlException
See Also:
PolicyManager.getPolicy(org.apache.lenya.ac.AccreditableManager, java.lang.String)

accreditableRemoved

public void accreditableRemoved(org.apache.lenya.ac.AccreditableManager manager,
                                org.apache.lenya.ac.Accreditable accreditable)
                         throws org.apache.lenya.ac.AccessControlException
Specified by:
accreditableRemoved in interface org.apache.lenya.ac.PolicyManager
Throws:
org.apache.lenya.ac.AccessControlException
See Also:
PolicyManager.accreditableRemoved(org.apache.lenya.ac.AccreditableManager, org.apache.lenya.ac.Accreditable)

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException
See Also:
Configurable.configure(org.apache.avalon.framework.configuration.Configuration)

dispose

public void dispose()
Specified by:
dispose in interface org.apache.avalon.framework.activity.Disposable
See Also:
Disposable.dispose()

accreditableAdded

public void accreditableAdded(org.apache.lenya.ac.AccreditableManager manager,
                              org.apache.lenya.ac.Accreditable accreditable)
                       throws org.apache.lenya.ac.AccessControlException
Specified by:
accreditableAdded in interface org.apache.lenya.ac.PolicyManager
Throws:
org.apache.lenya.ac.AccessControlException
See Also:
PolicyManager.accreditableAdded(org.apache.lenya.ac.AccreditableManager, org.apache.lenya.ac.Accreditable)

getCredentials

public org.apache.lenya.ac.Credential[] getCredentials(org.apache.lenya.ac.AccreditableManager controller,
                                                       java.lang.String url)
                                                throws org.apache.lenya.ac.AccessControlException
Specified by:
getCredentials in interface org.apache.lenya.ac.PolicyManager
Throws:
org.apache.lenya.ac.AccessControlException

getGrantedRoles

public org.apache.lenya.ac.Role[] getGrantedRoles(org.apache.lenya.ac.AccreditableManager accreditableManager,
                                                  org.apache.lenya.ac.Identity identity,
                                                  java.lang.String url)
                                           throws org.apache.lenya.ac.AccessControlException
Specified by:
getGrantedRoles in interface org.apache.lenya.ac.PolicyManager
Throws:
org.apache.lenya.ac.AccessControlException


Copyright $ Apache Software Foundation. All Rights Reserved.