Java Doc for SecurityService.java in  » Web-Framework » TURBINE » org » apache » turbine » services » 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 » Web Framework » TURBINE » org.apache.turbine.services.security 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.turbine.services.security.SecurityService

All known Subclasses:   org.apache.turbine.services.security.BaseSecurityService,
SecurityService
public interface SecurityService extends Service(Code)
The Security Service manages Users, Groups Roles and Permissions in the system. The task performed by the security service include creation and removal of accounts, groups, roles, and permissions; assigning users roles in groups; assigning roles specific permissions and construction of objects representing these logical entities.

Because of pluggable nature of the Services, it is possible to create multiple implementations of SecurityService, for example employing database and directory server as the data backend.

author:
   Rafal Krzewski
author:
   Henning P. Schmiedehausen
author:
   Marco Knüttel
version:
   $Id: SecurityService.java 571795 2007-09-01 13:09:35Z tv $



Field Summary
 StringACL_CLASS_DEFAULT
    
 StringACL_CLASS_KEY
    
 StringGROUP_CLASS_DEFAULT
    
 StringGROUP_CLASS_KEY
    
 StringPERMISSION_CLASS_DEFAULT
    
 StringPERMISSION_CLASS_KEY
    
 StringROLE_CLASS_DEFAULT
    
 StringROLE_CLASS_KEY
    
 StringSECURE_PASSWORDS_ALGORITHM_DEFAULT
    
 StringSECURE_PASSWORDS_ALGORITHM_KEY
    
 StringSECURE_PASSWORDS_DEFAULT
    
 StringSECURE_PASSWORDS_KEY
    
 StringSERVICE_NAME
    
 StringUSER_CLASS_DEFAULT
    
 StringUSER_CLASS_KEY
    
 StringUSER_MANAGER_DEFAULT
    
 StringUSER_MANAGER_KEY
    


Method Summary
 booleanaccountExists(String userName)
     Check whether a specified user's account exists. The login name is used for looking up the account.
Parameters:
  userName - The user to be checked.
 booleanaccountExists(User user)
     Check whether a specified user's account exists. An User object is used for looking up the account.
Parameters:
  user - The user object to be checked.
 GroupaddGroup(Group group)
     Creates a new group with specified attributes.
Parameters:
  group - the object describing the group to be created.
 PermissionaddPermission(Permission permission)
     Creates a new permission with specified attributes.
Parameters:
  permission - The object describing the permission to be created.
 RoleaddRole(Role role)
     Creates a new role with specified attributes.
Parameters:
  role - The object describing the role to be created.
 voidaddUser(User user, String password)
     Creates new user account with specified attributes.
 voidchangePassword(User user, String oldPassword, String newPassword)
     Change the password for an User.
 booleancheckPassword(String checkpw, String encpw)
    
 StringencryptPassword(String password)
     This method provides client-side encryption mechanism for passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password.
 StringencryptPassword(String password, String salt)
     This method provides client-side encryption mechanism for passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password.
 voidforcePassword(User user, String password)
     Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords.
 AccessControlListgetACL(User user)
     Constructs an AccessControlList for a specific user.
 ClassgetAclClass()
     Returns the Class object for the implementation of AccessControlList interface used by the system.
 AccessControlListgetAclInstance(Map roles, Map permissions)
     Construct a new ACL object.
 GroupSetgetAllGroups()
     Retrieves all groups defined in the system.
 PermissionSetgetAllPermissions()
     Retrieves all permissions defined in the system.
 RoleSetgetAllRoles()
     Retrieves all roles defined in the system.
 UsergetAnonymousUser()
     Constructs an User object to represent an anonymous user of the application.
 UsergetAuthenticatedUser(String username, String password)
     Authenticates an user, and constructs an User object to represent him/her.
Parameters:
  username - The user name.
Parameters:
  password - The user password.
 GroupgetGlobalGroup()
     Provides a reference to the Group object that represents the global group.
 GroupgetGroup(String name)
     Retrieve a Group object with specified name.
Parameters:
  name - the name of the Group.
 GroupgetGroupById(int id)
     Retrieve a Group object with specified Id.
Parameters:
  name - the name of the Group.
 GroupgetGroupByName(String name)
     Retrieve a Group object with specified name.
Parameters:
  name - the name of the Group.
 ClassgetGroupClass()
     Returns the Class object for the implementation of Group interface used by the system.
 GroupgetGroupInstance()
     Construct a blank Group object.
 GroupgetGroupInstance(String groupName)
     Construct a blank Group object.
 GroupSetgetGroups(Criteria criteria)
     Retrieve a set of Groups that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Group selection.
 GroupgetNewGroup(String groupName)
    
 PermissiongetNewPermission(String permissionName)
    
 RolegetNewRole(String roleName)
    
 PermissiongetPermission(String name)
     Retrieve a Permission object with specified name.
Parameters:
  name - the name of the Permission.
 PermissiongetPermissionById(int id)
     Retrieve a Permission object with specified Id.
Parameters:
  name - the name of the Permission.
 PermissiongetPermissionByName(String name)
     Retrieve a Permission object with specified name.
Parameters:
  name - the name of the Permission.
 ClassgetPermissionClass()
     Returns the Class object for the implementation of Permission interface used by the system.
 PermissiongetPermissionInstance()
     Construct a blank Permission object.
 PermissiongetPermissionInstance(String permName)
     Construct a blank Permission object.
 PermissionSetgetPermissions(Role role)
     Retrieves all permissions associated with a role.
Parameters:
  role - the role name, for which the permissions are to be retrieved.
 PermissionSetgetPermissions(Criteria criteria)
     Retrieve a set of Permissions that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Permissions selection.
 RolegetRole(String name)
     Retrieve a Role object with specified name.
Parameters:
  name - the name of the Role.
 RolegetRoleById(int id)
     Retrieve a Role object with specified Id.
Parameters:
  name - the name of the Role.
 RolegetRoleByName(String name)
     Retrieve a Role object with specified name.
Parameters:
  name - the name of the Role.
 ClassgetRoleClass()
     Returns the Class object for the implementation of Role interface used by the system.
 RolegetRoleInstance()
     Construct a blank Role object.
 RolegetRoleInstance(String roleName)
     Construct a blank Role object.
 RoleSetgetRoles(Criteria criteria)
     Retrieve a set of Roles that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Roles selection.
 UsergetUser(String username)
     Constructs an User object to represent a registered user of the application.
Parameters:
  username - The user name.
 ClassgetUserClass()
     Returns the Class object for the implementation of User interface used by the system.
 UsergetUserInstance()
     Construct a blank User object.
 UsergetUserInstance(String userName)
     Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor.
Parameters:
  userName - The name of the user.
 ListgetUserList(Criteria criteria)
     Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in User interface, plus the names of the custom attributes you added to your user representation in the data storage.
 UserManagergetUserManager()
     Returns the configured UserManager.
 User[]getUsers(Criteria criteria)
     Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in User interface, plus the names of the custom attributes you added to your user representation in the data storage.
 voidgrant(User user, Group group, Role role)
     Grant an User a Role in a Group.
 voidgrant(Role role, Permission permission)
    
 booleanisAnonymousUser(User u)
    
 voidremoveGroup(Group group)
     Removes a Group from the system.
 voidremovePermission(Permission permission)
     Removes a Permission from the system.
 voidremoveRole(Role role)
     Removes a Role from the system.
 voidremoveUser(User user)
     Removes an user account from the system.
 voidrenameGroup(Group group, String name)
     Renames an existing Group.
 voidrenamePermission(Permission permission, String name)
     Renames an existing Permission.
 voidrenameRole(Role role, String name)
     Renames an existing Role.
 voidrevoke(User user, Group group, Role role)
     Revoke a Role in a Group from an User.
 voidrevoke(Role role, Permission permission)
     Revokes a Permission from a Role.
 voidrevokeAll(User user)
     Revokes all roles from an User.
 voidrevokeAll(Role role)
     Revokes all permissions from a Role.
 voidsaveGroup(Group group)
     Stores Group's attributes.
 voidsaveOnSessionUnbind(User user)
     Saves User data when the session is unbound.
 voidsavePermission(Permission permission)
     Stores Permission's attributes.
 voidsaveRole(Role role)
     Stores Role's attributes.
 voidsaveUser(User user)
     Saves User's data in the permanent storage.
 voidsetUserManager(UserManager userManager)
     Configure a new user Manager.

Field Detail
ACL_CLASS_DEFAULT
String ACL_CLASS_DEFAULT(Code)
The default implementation of the Acl Interface (org.apache.turbine.util.security.TurbineAccessControlList)



ACL_CLASS_KEY
String ACL_CLASS_KEY(Code)
The key within services' properties for the ACL implementation classname (acl.class)



GROUP_CLASS_DEFAULT
String GROUP_CLASS_DEFAULT(Code)
The default implementation of the Group interface (org.apache.turbine.om.security.TurbineGroup)



GROUP_CLASS_KEY
String GROUP_CLASS_KEY(Code)
The key within services' properties for the GROUP implementation classname (group.class)



PERMISSION_CLASS_DEFAULT
String PERMISSION_CLASS_DEFAULT(Code)
The default implementation of the Permissions interface (org.apache.turbine.om.security.TurbinePermission)



PERMISSION_CLASS_KEY
String PERMISSION_CLASS_KEY(Code)
The key within services' properties for the PERMISSION implementation classname (permission.class)



ROLE_CLASS_DEFAULT
String ROLE_CLASS_DEFAULT(Code)
The default implementation of the Role Interface (org.apache.turbine.om.security.TurbineRole)



ROLE_CLASS_KEY
String ROLE_CLASS_KEY(Code)
The key within services' properties for the ROLE implementation classname (role.class)



SECURE_PASSWORDS_ALGORITHM_DEFAULT
String SECURE_PASSWORDS_ALGORITHM_DEFAULT(Code)
the default algorithm for password encryption (SHA)



SECURE_PASSWORDS_ALGORITHM_KEY
String SECURE_PASSWORDS_ALGORITHM_KEY(Code)
the key within services's properties for secure passwords algorithm (secure.passwords.algorithm)



SECURE_PASSWORDS_DEFAULT
String SECURE_PASSWORDS_DEFAULT(Code)
the value of secure passwords flag (false)



SECURE_PASSWORDS_KEY
String SECURE_PASSWORDS_KEY(Code)
the key within services's properties for secure passwords flag (secure.passwords)



SERVICE_NAME
String SERVICE_NAME(Code)
The name of the service



USER_CLASS_DEFAULT
String USER_CLASS_DEFAULT(Code)
the default implementation of User interface (org.apache.turbine.om.security.TurbineUser)



USER_CLASS_KEY
String USER_CLASS_KEY(Code)
the key within services's properties for user implementation classname (user.class)



USER_MANAGER_DEFAULT
String USER_MANAGER_DEFAULT(Code)
the default implementation of UserManager interface (org.apache.turbine.services.security.torque.TorqueUserManager)



USER_MANAGER_KEY
String USER_MANAGER_KEY(Code)
the key within services's properties for user implementation classname (user.manager)





Method Detail
accountExists
boolean accountExists(String userName) throws DataBackendException(Code)
Check whether a specified user's account exists. The login name is used for looking up the account.
Parameters:
  userName - The user to be checked. true if the specified account exists
throws:
  DataBackendException - if there was an error accessing the databackend.



accountExists
boolean accountExists(User user) throws DataBackendException(Code)
Check whether a specified user's account exists. An User object is used for looking up the account.
Parameters:
  user - The user object to be checked. true if the specified account exists
throws:
  DataBackendException - if there was an error accessing the databackend.



addGroup
Group addGroup(Group group) throws DataBackendException, EntityExistsException(Code)
Creates a new group with specified attributes.
Parameters:
  group - the object describing the group to be created. the new Group object.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  EntityExistsException - if the group already exists.



addPermission
Permission addPermission(Permission permission) throws DataBackendException, EntityExistsException(Code)
Creates a new permission with specified attributes.
Parameters:
  permission - The object describing the permission to be created. the new Permission object.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  EntityExistsException - if the permission already exists.



addRole
Role addRole(Role role) throws DataBackendException, EntityExistsException(Code)
Creates a new role with specified attributes.
Parameters:
  role - The object describing the role to be created. the new Role object.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  EntityExistsException - if the role already exists.



addUser
void addUser(User user, String password) throws DataBackendException, EntityExistsException(Code)
Creates new user account with specified attributes.
Parameters:
  user - the object describing account to be created.
Parameters:
  password - The password to use.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  EntityExistsException - if the user account already exists.



changePassword
void changePassword(User user, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException(Code)
Change the password for an User.
Parameters:
  user - an User to change password for.
Parameters:
  oldPassword - the current password supplied by the user.
Parameters:
  newPassword - the current password requested by the user.
exception:
  PasswordMismatchException - if the supplied password wasincorrect.
exception:
  UnknownEntityException - if the user's record does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



checkPassword
boolean checkPassword(String checkpw, String encpw)(Code)
Checks if a supplied password matches the encrypted password when using the current encryption algorithm
Parameters:
  checkpw - The clear text password supplied by the user
Parameters:
  encpw - The current, encrypted password true if the password matches, else false



encryptPassword
String encryptPassword(String password)(Code)
This method provides client-side encryption mechanism for passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password. The behavior of the method can be configured in service's properties.
Parameters:
  password - the password to process processed password



encryptPassword
String encryptPassword(String password, String salt)(Code)
This method provides client-side encryption mechanism for passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password. The behavior of the method can be configured in service's properties. Algorithms that must supply a salt for encryption can use this method to provide it.
Parameters:
  password - the password to process
Parameters:
  salt - Salt parameter for some crypto algorithms processed password



forcePassword
void forcePassword(User user, String password) throws UnknownEntityException, DataBackendException(Code)
Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program.
Parameters:
  user - an User to change password for.
Parameters:
  password - the new password.
exception:
  UnknownEntityException - if the user's record does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



getACL
AccessControlList getACL(User user) throws DataBackendException, UnknownEntityException(Code)
Constructs an AccessControlList for a specific user.
Parameters:
  user - the user for whom the AccessControlList are to be retrieved A new AccessControlList object.
throws:
  DataBackendException - if there was an error accessing the data backend.
throws:
  UnknownEntityException - if user account is not present.



getAclClass
Class getAclClass() throws UnknownEntityException(Code)
Returns the Class object for the implementation of AccessControlList interface used by the system. the implementation of AccessControlList interface used by the system.
throws:
  UnknownEntityException - if the system's implementation of AccessControlListinterface could not be determined.



getAclInstance
AccessControlList getAclInstance(Map roles, Map permissions) throws UnknownEntityException(Code)
Construct a new ACL object. This constructs a new ACL object from the configured class and initializes it with the supplied roles and permissions.
Parameters:
  roles - The roles that this ACL should contain
Parameters:
  permissions - The permissions for this ACL an object implementing ACL interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getAllGroups
GroupSet getAllGroups() throws DataBackendException(Code)
Retrieves all groups defined in the system. the names of all groups defined in the system.
throws:
  DataBackendException - if there was an error accessing the databackend.



getAllPermissions
PermissionSet getAllPermissions() throws DataBackendException(Code)
Retrieves all permissions defined in the system. the names of all roles defined in the system.
throws:
  DataBackendException - if there was an error accessing the databackend.



getAllRoles
RoleSet getAllRoles() throws DataBackendException(Code)
Retrieves all roles defined in the system. the names of all roles defined in the system.
throws:
  DataBackendException - if there was an error accessing the databackend.



getAnonymousUser
User getAnonymousUser() throws UnknownEntityException(Code)
Constructs an User object to represent an anonymous user of the application. An anonymous Turbine User.
throws:
  UnknownEntityException - if the anonymous User object couldn't beconstructed.



getAuthenticatedUser
User getAuthenticatedUser(String username, String password) throws DataBackendException, UnknownEntityException, PasswordMismatchException(Code)
Authenticates an user, and constructs an User object to represent him/her.
Parameters:
  username - The user name.
Parameters:
  password - The user password. An authenticated Turbine User.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if user account is not present.
throws:
  PasswordMismatchException - if the supplied password was incorrect.



getGlobalGroup
Group getGlobalGroup()(Code)
Provides a reference to the Group object that represents the global group. A Group object that represents the global group.



getGroup
Group getGroup(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Group object with specified name.
Parameters:
  name - the name of the Group. an object representing the Group with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the group does not exist.



getGroupById
Group getGroupById(int id) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Group object with specified Id.
Parameters:
  name - the name of the Group. an object representing the Group with specified name.
exception:
  UnknownEntityException - if the permission does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



getGroupByName
Group getGroupByName(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Group object with specified name.
Parameters:
  name - the name of the Group. an object representing the Group with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the group does not exist.



getGroupClass
Class getGroupClass() throws UnknownEntityException(Code)
Returns the Class object for the implementation of Group interface used by the system. the implementation of Group interface used by the system.
throws:
  UnknownEntityException - if the system's implementation of Groupinterface could not be determined.



getGroupInstance
Group getGroupInstance() throws UnknownEntityException(Code)
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor. an object implementing Group interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getGroupInstance
Group getGroupInstance(String groupName) throws UnknownEntityException(Code)
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor.
Parameters:
  groupName - The name of the Group an object implementing Group interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getGroups
GroupSet getGroups(Criteria criteria) throws DataBackendException(Code)
Retrieve a set of Groups that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Group selection. a set of Groups that meet the specified Criteria.
throws:
  DataBackendException - if there was an error accessing the databackend.



getNewGroup
Group getNewGroup(String groupName)(Code)



getNewPermission
Permission getNewPermission(String permissionName)(Code)



getNewRole
Role getNewRole(String roleName)(Code)



getPermission
Permission getPermission(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Permission object with specified name.
Parameters:
  name - the name of the Permission. an object representing the Permission with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the permission does not exist.



getPermissionById
Permission getPermissionById(int id) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Permission object with specified Id.
Parameters:
  name - the name of the Permission. an object representing the Permission with specified name.
exception:
  UnknownEntityException - if the permission does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



getPermissionByName
Permission getPermissionByName(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Permission object with specified name.
Parameters:
  name - the name of the Permission. an object representing the Permission with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the permission does not exist.



getPermissionClass
Class getPermissionClass() throws UnknownEntityException(Code)
Returns the Class object for the implementation of Permission interface used by the system. the implementation of Permission interface used by the system.
throws:
  UnknownEntityException - if the system's implementation of Permissioninterface could not be determined.



getPermissionInstance
Permission getPermissionInstance() throws UnknownEntityException(Code)
Construct a blank Permission object. This method calls getPermissionClass, and then creates a new object using the default constructor. an object implementing Permission interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getPermissionInstance
Permission getPermissionInstance(String permName) throws UnknownEntityException(Code)
Construct a blank Permission object. This method calls getPermissionClass, and then creates a new object using the default constructor.
Parameters:
  permName - The name of the Permission an object implementing Permission interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getPermissions
PermissionSet getPermissions(Role role) throws DataBackendException, UnknownEntityException(Code)
Retrieves all permissions associated with a role.
Parameters:
  role - the role name, for which the permissions are to be retrieved. the permissions associated with the role
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role is not present.



getPermissions
PermissionSet getPermissions(Criteria criteria) throws DataBackendException(Code)
Retrieve a set of Permissions that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Permissions selection. a set of Permissions that meet the specified Criteria.
throws:
  DataBackendException - if there was an error accessing the databackend.



getRole
Role getRole(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Role object with specified name.
Parameters:
  name - the name of the Role. an object representing the Role with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role does not exist.



getRoleById
Role getRoleById(int id) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Role object with specified Id.
Parameters:
  name - the name of the Role. an object representing the Role with specified name.
exception:
  UnknownEntityException - if the permission does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



getRoleByName
Role getRoleByName(String name) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Role object with specified name.
Parameters:
  name - the name of the Role. an object representing the Role with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role does not exist.



getRoleClass
Class getRoleClass() throws UnknownEntityException(Code)
Returns the Class object for the implementation of Role interface used by the system. the implementation of Role interface used by the system.
throws:
  UnknownEntityException - if the system's implementation of Roleinterface could not be determined.



getRoleInstance
Role getRoleInstance() throws UnknownEntityException(Code)
Construct a blank Role object. This method calls getRoleClass, and then creates a new object using the default constructor. an object implementing Role interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getRoleInstance
Role getRoleInstance(String roleName) throws UnknownEntityException(Code)
Construct a blank Role object. This method calls getRoleClass, and then creates a new object using the default constructor.
Parameters:
  roleName - The name of the Role an object implementing Role interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getRoles
RoleSet getRoles(Criteria criteria) throws DataBackendException(Code)
Retrieve a set of Roles that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Roles selection. a set of Roles that meet the specified Criteria.
throws:
  DataBackendException - if there was an error accessing the databackend.



getUser
User getUser(String username) throws DataBackendException, UnknownEntityException(Code)
Constructs an User object to represent a registered user of the application.
Parameters:
  username - The user name. A Turbine User.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if user account is not present.



getUserClass
Class getUserClass() throws UnknownEntityException(Code)
Returns the Class object for the implementation of User interface used by the system. the implementation of User interface used by the system.
throws:
  UnknownEntityException - if the system's implementation of Userinterface could not be determined.



getUserInstance
User getUserInstance() throws UnknownEntityException(Code)
Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor. an object implementing User interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getUserInstance
User getUserInstance(String userName) throws UnknownEntityException(Code)
Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor.
Parameters:
  userName - The name of the user. an object implementing User interface.
throws:
  UnknownEntityException - if the object could not be instantiated.



getUserList
List getUserList(Criteria criteria) throws DataBackendException(Code)
Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in User interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of Torque implementation.
Parameters:
  criteria - The criteria of selection. a List of users meeting the criteria.
throws:
  DataBackendException - if there is a problem accessing thestorage.



getUserManager
UserManager getUserManager()(Code)
Returns the configured UserManager. An UserManager object



getUsers
User[] getUsers(Criteria criteria) throws DataBackendException(Code)
Retrieve a set of users that meet the specified criteria. As the keys for the criteria, you should use the constants that are defined in User interface, plus the names of the custom attributes you added to your user representation in the data storage. Use verbatim names of the attributes - without table name prefix in case of DB implementation.
Parameters:
  criteria - The criteria of selection. a List of users meeting the criteria.
throws:
  DataBackendException - if there is a problem accessing thestorage.



grant
void grant(User user, Group group, Role role) throws DataBackendException, UnknownEntityException(Code)
Grant an User a Role in a Group.
Parameters:
  user - the user.
Parameters:
  group - the group.
Parameters:
  role - the role.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if user account, group or role is notpresent.



grant
void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException(Code)
Grants a Role a Permission
Parameters:
  role - the Role.
Parameters:
  permission - the Permission.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if role or permission is not present.



isAnonymousUser
boolean isAnonymousUser(User u)(Code)
Checks whether a passed user object matches the anonymous user pattern according to the configured user manager
Parameters:
  An - user object True if this is an anonymous user



removeGroup
void removeGroup(Group group) throws DataBackendException, UnknownEntityException(Code)
Removes a Group from the system.
Parameters:
  group - The object describing the group to be removed.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the group does not exist.



removePermission
void removePermission(Permission permission) throws DataBackendException, UnknownEntityException(Code)
Removes a Permission from the system.
Parameters:
  permission - The object describing the permission to be removed.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the permission does not exist.



removeRole
void removeRole(Role role) throws DataBackendException, UnknownEntityException(Code)
Removes a Role from the system.
Parameters:
  role - The object describing the role to be removed.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role does not exist.



removeUser
void removeUser(User user) throws DataBackendException, UnknownEntityException(Code)
Removes an user account from the system.
Parameters:
  user - the object describing the account to be removed.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the user account is not present.



renameGroup
void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException(Code)
Renames an existing Group.
Parameters:
  group - The object describing the group to be renamed.
Parameters:
  name - the new name for the group.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the group does not exist.



renamePermission
void renamePermission(Permission permission, String name) throws DataBackendException, UnknownEntityException(Code)
Renames an existing Permission.
Parameters:
  permission - The object describing the permission to be renamed.
Parameters:
  name - the new name for the permission.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the permission does not exist.



renameRole
void renameRole(Role role, String name) throws DataBackendException, UnknownEntityException(Code)
Renames an existing Role.
Parameters:
  role - The object describing the role to be renamed.
Parameters:
  name - the new name for the role.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role does not exist.



revoke
void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException(Code)
Revoke a Role in a Group from an User.
Parameters:
  user - the user.
Parameters:
  group - the group.
Parameters:
  role - the role.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if user account, group or role is notpresent.



revoke
void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException(Code)
Revokes a Permission from a Role.
Parameters:
  role - the Role.
Parameters:
  permission - the Permission.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if role or permission is not present.



revokeAll
void revokeAll(User user) throws DataBackendException, UnknownEntityException(Code)
Revokes all roles from an User. This method is used when deleting an account.
Parameters:
  user - the User.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the account is not present.



revokeAll
void revokeAll(Role role) throws DataBackendException, UnknownEntityException(Code)
Revokes all permissions from a Role. This method is user when deleting a Role.
Parameters:
  role - the Role
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Role is not present.



saveGroup
void saveGroup(Group group) throws DataBackendException, UnknownEntityException(Code)
Stores Group's attributes. The Groups is required to exist in the system.
Parameters:
  group - The Group to be stored.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the group does not exist.



saveOnSessionUnbind
void saveOnSessionUnbind(User user) throws UnknownEntityException, DataBackendException(Code)
Saves User data when the session is unbound. The user account is required to exist in the storage. LastLogin, AccessCounter, persistent pull tools, and any data stored in the permData hashtable that is not mapped to a column will be saved.
exception:
  UnknownEntityException - if the user's account does notexist in the database.
exception:
  DataBackendException - if there is a problem accessing thestorage.



savePermission
void savePermission(Permission permission) throws DataBackendException, UnknownEntityException(Code)
Stores Permission's attributes. The Permission is required to exist in the system.
Parameters:
  permission - The Permission to be stored.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the permission does not exist.



saveRole
void saveRole(Role role) throws DataBackendException, UnknownEntityException(Code)
Stores Role's attributes. The Roles is required to exist in the system.
Parameters:
  role - The Role to be stored.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role does not exist.



saveUser
void saveUser(User user) throws UnknownEntityException, DataBackendException(Code)
Saves User's data in the permanent storage. The user account is required to exist in the storage.
Parameters:
  user - the user object to save
throws:
  UnknownEntityException - if the user's account does notexist in the database.
throws:
  DataBackendException - if there is a problem accessing the storage.



setUserManager
void setUserManager(UserManager userManager)(Code)
Configure a new user Manager.
Parameters:
  userManager - An UserManager object



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