|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.lenya.ac.file.FilePolicyManager
public class FilePolicyManager
A PolicyBuilder is used to build policies.
Field Summary | |
---|---|
protected static java.lang.String |
DIRECTORY_PARAMETER
|
protected static java.lang.String |
SUBTREE_FILENAME
|
protected static java.lang.String |
URL_FILENAME
|
protected static java.lang.String |
USER_ADMIN_URL
|
Fields inherited from interface org.apache.lenya.ac.PolicyManager |
---|
ROLE |
Constructor Summary | |
---|---|
FilePolicyManager()
Creates a new FilePolicyManager. |
Method Summary | |
---|---|
void |
accreditableAdded(AccreditableManager manager,
Accreditable accreditable)
Called when an accreditable was added. |
void |
accreditableRemoved(AccreditableManager manager,
Accreditable accreditable)
Called when an accreditable was removed. |
protected DefaultPolicy |
buildPolicy(AccreditableManager controller,
java.lang.String url,
java.lang.String policyFilename)
Builds a policy from a file. |
DefaultPolicy |
buildSubtreePolicy(AccreditableManager controller,
java.lang.String url)
Builds a subtree policy from a file. |
DefaultPolicy |
buildURLPolicy(AccreditableManager controller,
java.lang.String url)
Builds the URL policy for a URL from a file. |
void |
dispose()
|
protected SourceCache |
getCache()
Returns the source cache. |
DefaultPolicy[] |
getPolicies(AccreditableManager controller,
java.lang.String url)
Returns the existing policies for all URL steps, beginning with the root policy. |
java.io.File |
getPoliciesDirectory()
Get the path to the policies directory. |
Policy |
getPolicy(AccreditableManager controller,
java.lang.String url)
Returns the policy for a given page. |
protected java.io.File |
getPolicyFile(java.lang.String url,
java.lang.String policyFilename)
Returns the policy file for a certain URL. |
protected java.lang.String |
getPolicySourceURI(java.lang.String url,
java.lang.String policyFilename)
Returns the policy file URI for a URL and a policy filename. |
protected org.apache.avalon.framework.service.ServiceManager |
getServiceManager()
Returns the service manager. |
void |
parameterize(org.apache.avalon.framework.parameters.Parameters parameters)
|
protected void |
removeAccreditable(AccreditableManager manager,
Accreditable accreditable,
java.io.File policyDirectory)
Removes an accreditable from all policies within a certain directory tree. |
protected void |
savePolicy(DefaultPolicy policy,
java.io.File file)
Saves a policy to a file. |
protected void |
savePolicy(java.lang.String url,
DefaultPolicy policy,
java.lang.String filename)
Saves a policy to a file. |
void |
saveSubtreePolicy(java.lang.String url,
DefaultPolicy policy)
Saves a Subtree policy. |
void |
saveURLPolicy(java.lang.String url,
DefaultPolicy policy)
Saves a URL policy. |
void |
service(org.apache.avalon.framework.service.ServiceManager manager)
|
void |
setPoliciesDirectory(java.io.File directory)
Sets the policies directory. |
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 |
---|
protected static final java.lang.String URL_FILENAME
protected static final java.lang.String SUBTREE_FILENAME
protected static final java.lang.String USER_ADMIN_URL
protected static final java.lang.String DIRECTORY_PARAMETER
Constructor Detail |
---|
public FilePolicyManager()
Method Detail |
---|
protected SourceCache getCache()
public DefaultPolicy buildURLPolicy(AccreditableManager controller, java.lang.String url) throws AccessControlException
buildURLPolicy
in interface InheritingPolicyManager
controller
- The access controller to use.url
- The URL inside the web application.
AccessControlException
- when something went wrong.public DefaultPolicy buildSubtreePolicy(AccreditableManager controller, java.lang.String url) throws AccessControlException
buildSubtreePolicy
in interface InheritingPolicyManager
controller
- The access controller to use.url
- The URL inside the web application.
AccessControlException
- when something went wrong.protected DefaultPolicy buildPolicy(AccreditableManager controller, java.lang.String url, java.lang.String policyFilename) throws AccessControlException
controller
- The access controller to use.url
- The url.policyFilename
- The policy filename.
AccessControlException
- when something went wrong.protected java.lang.String getPolicySourceURI(java.lang.String url, java.lang.String policyFilename) throws AccessControlException
url
- The url to get the file for.policyFilename
- The name of the policy file.
AccessControlException
- if an error occursprotected java.io.File getPolicyFile(java.lang.String url, java.lang.String policyFilename) throws AccessControlException
url
- The URL to get the policy for.policyFilename
- The policy filename.
AccessControlException
- when an error occurs.public void saveURLPolicy(java.lang.String url, DefaultPolicy policy) throws AccessControlException
saveURLPolicy
in interface InheritingPolicyManager
url
- The URL to save the policy for.policy
- The policy to save.
AccessControlException
- when something went wrong.public void saveSubtreePolicy(java.lang.String url, DefaultPolicy policy) throws AccessControlException
saveSubtreePolicy
in interface InheritingPolicyManager
url
- The url to save the policy for.policy
- The policy to save.
AccessControlException
- when something went wrong.protected void savePolicy(java.lang.String url, DefaultPolicy policy, java.lang.String filename) throws AccessControlException
url
- The URL to save the policy for.policy
- The policy.filename
- The file.
AccessControlException
- if something goes wrong.protected void savePolicy(DefaultPolicy policy, java.io.File file) throws AccessControlException
policy
- The policy to save.file
- The file.
AccessControlException
- when an error occurs.public Policy getPolicy(AccreditableManager controller, java.lang.String url) throws AccessControlException
PolicyManager
getPolicy
in interface PolicyManager
controller
- The access controller.url
- The url inside the web application.
AccessControlException
- when something went wrong.PolicyManager.getPolicy(org.apache.lenya.ac.AccreditableManager,
java.lang.String)
public void parameterize(org.apache.avalon.framework.parameters.Parameters parameters) throws org.apache.avalon.framework.parameters.ParameterException
parameterize
in interface org.apache.avalon.framework.parameters.Parameterizable
org.apache.avalon.framework.parameters.ParameterException
Parameterizable.parameterize(org.apache.avalon.framework.parameters.Parameters)
public java.io.File getPoliciesDirectory() throws AccessControlException
AccessControlException
- if an error occurspublic void service(org.apache.avalon.framework.service.ServiceManager manager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
Serviceable.service(org.apache.avalon.framework.service.ServiceManager)
public void setPoliciesDirectory(java.io.File directory) throws AccessControlException
directory
- The directory.
AccessControlException
- if the directory is not a directorypublic DefaultPolicy[] getPolicies(AccreditableManager controller, java.lang.String url) throws AccessControlException
InheritingPolicyManager
getPolicies
in interface InheritingPolicyManager
controller
- The accreditable manager to use.url
- The URL inside the web application.
AccessControlException
- when something went wrong.InheritingPolicyManager.getPolicies(org.apache.lenya.ac.AccreditableManager,
java.lang.String)
public void dispose()
dispose
in interface org.apache.avalon.framework.activity.Disposable
Disposable.dispose()
protected void removeAccreditable(AccreditableManager manager, Accreditable accreditable, java.io.File policyDirectory) throws AccessControlException
manager
- The accreditable manager which owns the accreditable.accreditable
- The accreditable to remove.policyDirectory
- The directory where the policies are located.
AccessControlException
- when an error occurs.public void accreditableRemoved(AccreditableManager manager, Accreditable accreditable) throws AccessControlException
PolicyManager
accreditableRemoved
in interface PolicyManager
manager
- The accreditable manager the accreditable belonged to.accreditable
- The accreditable that was removed.
AccessControlException
- when something went wrong.PolicyManager.accreditableRemoved(org.apache.lenya.ac.AccreditableManager,
org.apache.lenya.ac.Accreditable)
protected org.apache.avalon.framework.service.ServiceManager getServiceManager()
public void accreditableAdded(AccreditableManager manager, Accreditable accreditable) throws AccessControlException
PolicyManager
accreditableAdded
in interface PolicyManager
manager
- The accreditable manager the accreditable belonged to.accreditable
- The accreditable that was removed.
AccessControlException
- when something went wrong.PolicyManager.accreditableAdded(org.apache.lenya.ac.AccreditableManager,
org.apache.lenya.ac.Accreditable)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |