Java Doc for AccessControlManager.java in  » 6.0-JDK-Modules » jsr-283 » javax » jcr » security » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » jsr 283 » javax.jcr.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.jcr.security.AccessControlManager

AccessControlManager
public interface AccessControlManager (Code)
The AccessControlManager object is accessed via javax.jcr.Session.getAccessControlManager . It provides methods for:
  • Access control discovery
  • Assigning access control policies
  • Assigning access control entries

since:
   JCR 2.0




Method Summary
 AccessControlEntryaddAccessControlEntry(String absPath, Principal principal, Privilege[] privileges)
     Adds the access control entry consisting of the specified principal and the specified privileges to the node at absPath.

This method returns the AccessControlEntry object constructed from the specified principal and contains at least the given privileges. An implementation may return a resulting ACE that combines the given privileges with those added by a previous call to addAccessControlEntry for the same Principal.

 voidaddPolicy(String absPath, AccessControlPolicy policy)
     Binds the policy to the node at absPath.

Only one policy may be bound at a time.

 AccessControlEntry[]getAccessControlEntries(String absPath)
     Returns all access control entries assigned to the node at absPath.
 AccessControlPolicygetEffectivePolicy(String absPath)
     Performs a best-effort search for the policy in effect on the node at absPath.
 AccessControlPolicygetPolicy(String absPath)
     Returns the AccessControlPolicy that currently applies to the node at absPath.
 Privilege[]getPrivileges(String absPath)
     Returns the privileges the session has for absolute path absPath, which must be an existing node.

The returned privileges are those for which AccessControlManager.hasPrivileges would return true.

The results reported by the this method reflect the net effect of the currently applied control mechanisms.

 AccessControlPolicyIteratorgetSupportedPolicies(String absPath)
     Returns the access control policies that are capable of being applied to the node at absPath.
 Privilege[]getSupportedPrivileges(String absPath)
     Returns the privileges supported for absolute path absPath, which must be an existing node.

This method does not return the privileges held by the session.

 booleanhasPrivileges(String absPath, Privilege[] privileges)
     Returns whether the session has the specified privileges for absolute path absPath, which must be an existing node.

Testing an aggregate privilege is equivalent to testing each nonaggregate privilege among the set returned by calling Privilege.getAggregatePrivileges() for that privilege.

The results reported by the this method reflect the net effect of the currently applied control mechanisms.

 voidremoveAccessControlEntry(String absPath, AccessControlEntry ace)
     Removes the specified AccessControlEntry from the node at absPath.

This method is guaranteed to affect only the privileges of the principal defined within the passed AccessControlEntry.

This method may affect the privileges granted to that principal with respect to nodes other than that specified.

 AccessControlPolicyremovePolicy(String absPath)
     Removes the currently applied AccessControlPolicy from the node at absPath and returns it.

An AccessControlPolicy can only be removed if it was previously bound to the specified node through this API before.




Method Detail
addAccessControlEntry
AccessControlEntry addAccessControlEntry(String absPath, Principal principal, Privilege[] privileges) throws PathNotFoundException, PrincipalNotFoundException, AccessDeniedException, RepositoryException(Code)
Adds the access control entry consisting of the specified principal and the specified privileges to the node at absPath.

This method returns the AccessControlEntry object constructed from the specified principal and contains at least the given privileges. An implementation may return a resulting ACE that combines the given privileges with those added by a previous call to addAccessControlEntry for the same Principal. However, a call to addAccessControlEntry for a given Principal can never remove a Privilege added by a previous call to addAccessControlEntry.

The access control entry does not take effect until a save is performed.

This method is guaranteed to affect only the privileges of the specified principal.

This method may affect the privileges granted to that principal with respect to nodes other than that specified. However, if it does, it is guaranteed to only affect the privileges of those other nodes in the same way as it affects the privileges of the specified node.
Parameters:
  absPath - an absolute path
Parameters:
  principal - a Principal
Parameters:
  privileges - an array of Privileges the AccessControlEntry object constructed from thespecified principal and privileges.
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  PrincipalNotFoundException - if the specified principal does not exist.
throws:
  AccessDeniedException - if the session lacksjcr:setAccessControlPolicy privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.




addPolicy
void addPolicy(String absPath, AccessControlPolicy policy) throws PathNotFoundException, PolicyNotFoundException, AccessDeniedException, RepositoryException(Code)
Binds the policy to the node at absPath.

Only one policy may be bound at a time. If more than one policy per node is required, the implementation should provide an appropriate aggregate policy among those returned by getSupportedPolicies(absPath) The access control policy does not take effect until a save is performed.

If the node has existing access control entries that were bound to it though the JCR API these entries may be deleted upon execution of the addPolicy call. Any implementation-specific (non-JCR) access control settings may be changed in response to a successful call to addPolicy.
Parameters:
  absPath - an absolute path
Parameters:
  policy - the AccessControlPolicy to be applied
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  PolicyNotFoundException - if no policy exists.
throws:
  AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.




getAccessControlEntries
AccessControlEntry[] getAccessControlEntries(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException(Code)
Returns all access control entries assigned to the node at absPath.

This method is only guaranteed to return an AccessControlEntry if that AccessControlEntry has been assigned through this API.
Parameters:
  absPath - an absolute path all access control entries assigned to the specified node
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  AccessDeniedException - if the session lacksjcr:getAccessControlPolicy privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.




getEffectivePolicy
AccessControlPolicy getEffectivePolicy(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException(Code)
Performs a best-effort search for the policy in effect on the node at absPath. Since finding the effective policy may be impractical or impossible in certain implementations, a return value of null may mean either that a policy exists but the implementation cannot find it, or that there is no effective policy on the node.
Parameters:
  absPath - an absolute path an AccessControlPolicy object
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.



getPolicy
AccessControlPolicy getPolicy(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException(Code)
Returns the AccessControlPolicy that currently applies to the node at absPath.
Parameters:
  absPath - an absolute path an AccessControlPolicy object
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.



getPrivileges
Privilege[] getPrivileges(String absPath) throws PathNotFoundException, RepositoryException(Code)
Returns the privileges the session has for absolute path absPath, which must be an existing node.

The returned privileges are those for which AccessControlManager.hasPrivileges would return true.

The results reported by the this method reflect the net effect of the currently applied control mechanisms. It does not reflect unsaved access control policies or unsaved access control entries (see XX). Changes to access control status caused by these mechanisms only take effect on Session.save() and are only then reflected in the results of the privilege test methods.
Parameters:
  absPath - an absolute path an array of Privileges
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  RepositoryException - if another error occurs.




getSupportedPolicies
AccessControlPolicyIterator getSupportedPolicies(String absPath) throws PathNotFoundException, AccessDeniedException, RepositoryException(Code)
Returns the access control policies that are capable of being applied to the node at absPath.
Parameters:
  absPath - an absolute path an AccessControlPolicyIterator over the applicableaccess control policies
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  AccessDeniedException - if the session lacksGET_ACCESS_CONTROL privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.



getSupportedPrivileges
Privilege[] getSupportedPrivileges(String absPath) throws PathNotFoundException, RepositoryException(Code)
Returns the privileges supported for absolute path absPath, which must be an existing node.

This method does not return the privileges held by the session. Instead, it returns the privileges that the repository supports.
Parameters:
  absPath - an absolute path an array of Privileges
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  RepositoryException - if another error occurs.




hasPrivileges
boolean hasPrivileges(String absPath, Privilege[] privileges) throws PathNotFoundException, RepositoryException(Code)
Returns whether the session has the specified privileges for absolute path absPath, which must be an existing node.

Testing an aggregate privilege is equivalent to testing each nonaggregate privilege among the set returned by calling Privilege.getAggregatePrivileges() for that privilege.

The results reported by the this method reflect the net effect of the currently applied control mechanisms. It does not reflect unsaved access control policies or unsaved access control entries (see XX). Changes to access control status caused by these mechanisms only take effect on Session.save() and are only then reflected in the results of the privilege test methods.
Parameters:
  absPath - an absolute path
Parameters:
  privileges - an array of Privileges true if the session has the specified privileges;false otherwise.
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  RepositoryException - if another error occurs.




removeAccessControlEntry
void removeAccessControlEntry(String absPath, AccessControlEntry ace) throws PathNotFoundException, AccessControlEntryNotFoundException, AccessDeniedException, RepositoryException(Code)
Removes the specified AccessControlEntry from the node at absPath.

This method is guaranteed to affect only the privileges of the principal defined within the passed AccessControlEntry.

This method may affect the privileges granted to that principal with respect to nodes other than that specified. However, if it does, it is guaranteed to only affect the privileges of those other nodes in the same way as it affects the privileges of the specified node.

Only exactly those entries explicitly added though this API can be removed through this API. The effect of the removal only takes place upon Session.save().
Parameters:
  absPath - an absolute path
Parameters:
  ace - the access control entry to be removed
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  AccessControlEntryNotFoundException - if the specified entry is notpresent on the specified node.
throws:
  AccessDeniedException - if the session lacksjcr:setAccessControlPolicy privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.




removePolicy
AccessControlPolicy removePolicy(String absPath) throws PathNotFoundException, PolicyNotFoundException, AccessDeniedException, RepositoryException(Code)
Removes the currently applied AccessControlPolicy from the node at absPath and returns it.

An AccessControlPolicy can only be removed if it was previously bound to the specified node through this API before. The effect of the removal only takes place upon Session.save().
Parameters:
  absPath - an absolute path the removed AccessControlPolicy
throws:
  PathNotFoundException - if no node at absPath existsor the session does not have privilege to retrieve the node.
throws:
  PolicyNotFoundException - if no policy exists.
throws:
  AccessDeniedException - if the session lacksMODIFY_ACCESS_CONTROL privilege for theabsPath node.
throws:
  RepositoryException - if another error occurs.




www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.