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


java.lang.Object
   org.apache.turbine.services.security.TurbineSecurity

TurbineSecurity
abstract public class TurbineSecurity (Code)
This is a Facade class for SecurityService. This class provides static methods that call related methods of the implementation of SecurityService used by the System, according to the settings in TurbineResources.

Certain Roles that the Users may have in the system may are not related to any specific resource nor entity. They are assigned within a special group named 'global' that can be referenced in the code as org.apache.turbine.om.security.Group.GLOBAL_GROUP_NAME .
author:
   Rafal Krzewski
author:
   Henning P. Schmiedehausen
version:
   $Id: TurbineSecurity.java 264148 2005-08-29 14:21:04Z henning $





Method Summary
public static  booleanaccountExists(User user)
     Check whether a specified user's account exists. The login name is used for looking up the account.
Parameters:
  user - The user to be checked.
public static  booleanaccountExists(String userName)
     Check whether a specified user's account exists. The login name is used for looking up the account.
Parameters:
  userName - The name of the user to be checked.
public static  voidaddGroup(Group group)
     Creates a new group with specified attributes.
public static  voidaddPermission(Permission permission)
     Creates a new permission with specified attributes.
public static  voidaddRole(Role role)
     Creates a new role with specified attributes.
public static  voidaddUser(User user, String password)
     Creates new user account with specified attributes.
public static  voidchangePassword(User user, String oldPassword, String newPassword)
     Change the password for an User.
public static  booleancheckPassword(String checkpw, String encpw)
    
public static  GroupcreateGroup(String name)
     Creates a new Group in the system.
public static  PermissioncreatePermission(String name)
     Creates a new Permission in the system.
public static  RolecreateRole(String name)
     Creates a new Role in the system.
public static  StringencryptPassword(String password)
     This method provides client-side encryption of passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password.
public static  StringencryptPassword(String password, String salt)
     This method provides client-side encryption of passwords. This is an utility method that is used by other classes to maintain a consistent approach to encrypting password.
public static  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.
public static  AccessControlListgetACL(User user)
     Constructs an AccessControlList for a specific user.
public static  GroupSetgetAllGroups()
     Retrieves all groups defined in the system.
public static  PermissionSetgetAllPermissions()
     Retrieves all permissions defined in the system.
public static  RoleSetgetAllRoles()
     Retrieves all roles defined in the system.
public static  UsergetAnonymousUser()
     Constructs an User object to represent an anonymous user of the application.
public static  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.
public static  GroupgetGlobalGroup()
     Provides a reference to the Group object that represents the global group.
public static  GroupgetGroup(String groupName)
     Retrieve a Group object with specified name.
Parameters:
  groupName - The name of the Group to be retrieved.
public static  GroupgetGroupById(int groupId)
     Retrieve a Group object with specified Id.
Parameters:
  name - the name of the Group.
public static  GroupgetGroupByName(String groupName)
     Retrieve a Group object with specified name.
Parameters:
  groupName - The name of the Group to be retrieved.
public static  ClassgetGroupClass()
     Returns the Class object for the implementation of Group interface used by the system.
public static  GroupgetGroupInstance(String groupName)
     Construct a blank Group object.
public static  GroupSetgetGroups(Criteria criteria)
     Retrieve a set of Groups that meet the specified Criteria.
Parameters:
  criteria - A Criteria of Group selection.
public static  GroupgetNewGroup(String groupName)
     Retrieves a named Group.
public static  PermissiongetNewPermission(String permissionName)
     Retrieves a named Permission.
public static  RolegetNewRole(String roleName)
     Retrieves a named Role.
public static  PermissiongetPermission(String permissionName)
     Retrieve a Permission object with specified name.
Parameters:
  permissionName - The name of the Permission to be retrieved.
public static  PermissiongetPermissionById(int permissionId)
     Retrieve a Permission object with specified Id.
Parameters:
  name - the name of the Permission.
public static  PermissiongetPermissionByName(String permissionName)
     Retrieve a Permission object with specified name.
Parameters:
  permissionName - The name of the Permission to be retrieved.
public static  ClassgetPermissionClass()
     Returns the Class object for the implementation of Permission interface used by the system.
public static  PermissiongetPermissionInstance(String permName)
     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.
public static  PermissionSetgetPermissions(Criteria criteria)
     Retrieve a set of Permissions that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Permissions selection.
public static  PermissionSetgetPermissions(Role role)
     Retrieves all permissions associated with a role.
Parameters:
  role - the role name, for which the permissions are to be retrieved.
public static  RolegetRole(String roleName)
     Retrieve a Role object with specified name.
Parameters:
  roleName - The name of the Role to be retrieved.
public static  RolegetRoleById(int roleId)
     Retrieve a Role object with specified Id.
Parameters:
  name - the name of the Role.
public static  RolegetRoleByName(String roleName)
     Retrieve a Role object with specified name.
Parameters:
  roleName - The name of the Role to be retrieved.
public static  ClassgetRoleClass()
     Returns the Class object for the implementation of Role interface used by the system.
public static  RolegetRoleInstance(String roleName)
     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.
public static  RoleSetgetRoles(Criteria criteria)
     Retrieve a set of Roles that meet the specified Criteria.
Parameters:
  criteria - a Criteria of Roles selection.
public static  SecurityServicegetService()
     Retrieves an implementation of SecurityService, base on the settings in TurbineResources.
public static  UsergetUser(String username)
     Constructs an User object to represent a registered user of the application.
Parameters:
  username - The user name.
public static  ClassgetUserClass()
     Returns the Class object for the implementation of User interface used by the system.
public static  UsergetUserInstance()
     Construct a blank User object.
public static  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.
public static  UserManagergetUserManager()
     Returns the configured UserManager.
public static  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.
public static  voidgrant(User user, Group group, Role role)
     Grant an User a Role in a Group.
public static  voidgrant(Role role, Permission permission)
    
public static  booleanisAnonymousUser(User user)
    
public static  voidremoveGroup(Group group)
     Removes a Group from the system.
public static  voidremovePermission(Permission permission)
     Removes a Permission from the system.
public static  voidremoveRole(Role role)
     Removes a Role from the system.
public static  voidremoveUser(User user)
     Removes an user account from the system.
public static  voidrenameGroup(Group group, String name)
     Renames an existing Group.
public static  voidrenamePermission(Permission permission, String name)
     Renames an existing Permission.
public static  voidrenameRole(Role role, String name)
     Renames an existing Role.
public static  voidrevoke(User user, Group group, Role role)
     Revoke a Role in a Group from an User.
public static  voidrevoke(Role role, Permission permission)
     Revokes a Permission from a Role.
public static  voidrevokeAll(User user)
     Revokes all roles from an User.
public static  voidrevokeAll(Role role)
     Revokes all permissions from a Role.
public static  voidsaveGroup(Group group)
     Stores Group's attributes.
public static  voidsaveOnSessionUnbind(User user)
     Saves User data when the session is unbound.
public static  voidsavePermission(Permission permission)
     Stores Permission's attributes.
public static  voidsaveRole(Role role)
     Stores Role's attributes.
public static  voidsaveUser(User user)
     Saves User's data in the permanent storage.
public  voidsetUserManager(UserManager userManager)
     Configure a new user Manager.



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



accountExists
public static 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 name of the user to be checked. true if the specified account exists
throws:
  DataBackendException - if there was an error accessing the databackend.



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



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



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



addUser
public static void addUser(User user, String password) throws DataBackendException, EntityExistsException(Code)
Creates new user account with specified attributes. TODO throw more specific exception

Parameters:
  user - the object describing account to be created.
Parameters:
  password - password for the new user
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  EntityExistsException - if the user account already exists.



changePassword
public static 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.
throws:
  PasswordMismatchException - if the supplied password wasincorrect.
throws:
  UnknownEntityException - if the user's record does notexist in the database.
throws:
  DataBackendException - if there is a problem accessing thestorage.



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



createGroup
public static Group createGroup(String name) throws TurbineSecurityException(Code)
Creates a new Group in the system. This is a convenience method.
Parameters:
  name - The name of the new Group. An object representing the new Group.
throws:
  TurbineSecurityException - if the Group could not be created.



createPermission
public static Permission createPermission(String name) throws TurbineSecurityException(Code)
Creates a new Permission in the system. This is a convenience method.
Parameters:
  name - The name of the new Permission. An object representing the new Permission.
throws:
  TurbineSecurityException - if the Permission could not be created.



createRole
public static Role createRole(String name) throws TurbineSecurityException(Code)
Creates a new Role in the system. This is a convenience method.
Parameters:
  name - The name of the Role. An object representing the new Role.
throws:
  TurbineSecurityException - if the Role could not be created.



encryptPassword
public static String encryptPassword(String password)(Code)
This method provides client-side encryption of 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
public static String encryptPassword(String password, String salt)(Code)
This method provides client-side encryption of 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
Parameters:
  salt - the supplied salt to encrypt the password processed password



forcePassword
public static 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.
throws:
  UnknownEntityException - if the user's record does notexist in the database.
throws:
  DataBackendException - if there is a problem accessing thestorage.



getACL
public static 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 The AccessControList object constructed from the user object.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if user account is not present.



getAllGroups
public static 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
public static 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
public static 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
public static 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
public static 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
public static Group getGlobalGroup()(Code)
Provides a reference to the Group object that represents the global group. a Group object that represents the global group.



getGroup
public static Group getGroup(String groupName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Group object with specified name.
Parameters:
  groupName - The name of the Group to be retrieved. an object representing the Group with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Group is not present.



getGroupById
public static Group getGroupById(int groupId) 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
public static Group getGroupByName(String groupName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Group object with specified name.
Parameters:
  groupName - The name of the Group to be retrieved. an object representing the Group with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Group is not present.



getGroupClass
public static 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
public static 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
public static 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
public static Group getNewGroup(String groupName) throws DataBackendException(Code)
Retrieves a named Group. If the Group does not exist, it creates a new Group based on the Services Group implementation. It is ok to pass in null or "" here and then use Group.setName() at a later point.
Parameters:
  groupName - The name of the Group to be retrieved. an object representing the Group with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.



getNewPermission
public static Permission getNewPermission(String permissionName) throws DataBackendException(Code)
Retrieves a named Permission. If the Permission does not exist, it creates a new Permission based on the Services Permission implementation. It is ok to pass in null or "" here and then use Permission.setName() at a later point.
Parameters:
  permissionName - The name of the Permission to be retrieved. an object representing the Permission with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.



getNewRole
public static Role getNewRole(String roleName) throws TurbineSecurityException(Code)
Retrieves a named Role. If the Role does not exist, it creates a new Role based on the Services Role implementation. It is ok to pass in null or "" here and then use Role.setName() at a later point.
Parameters:
  roleName - The name of the Role to be retrieved. an object representing the Role with specified name.
throws:
  TurbineSecurityException - if the Role could not be retrieved



getPermission
public static Permission getPermission(String permissionName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Permission object with specified name.
Parameters:
  permissionName - The name of the Permission to be retrieved. an object representing the Permission with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Permission is not present.



getPermissionById
public static Permission getPermissionById(int permissionId) 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
public static Permission getPermissionByName(String permissionName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Permission object with specified name.
Parameters:
  permissionName - The name of the Permission to be retrieved. an object representing the Permission with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Permission is not present.



getPermissionClass
public static 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
public static 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
public static 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.



getPermissions
public static 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 for the specified role
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the role is not present.



getRole
public static Role getRole(String roleName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Role object with specified name.
Parameters:
  roleName - The name of the Role to be retrieved. an object representing the Role with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Role is not present.



getRoleById
public static Role getRoleById(int roleId) 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
public static Role getRoleByName(String roleName) throws DataBackendException, UnknownEntityException(Code)
Retrieve a Role object with specified name.
Parameters:
  roleName - The name of the Role to be retrieved. an object representing the Role with specified name.
throws:
  DataBackendException - if there was an error accessing the databackend.
throws:
  UnknownEntityException - if the Role is not present.



getRoleClass
public static 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
public static 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
public static 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.



getService
public static SecurityService getService()(Code)
Retrieves an implementation of SecurityService, base on the settings in TurbineResources. an implementation of SecurityService.



getUser
public static 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
public static 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
public static 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.



getUserList
public static 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 DB implementation.
Parameters:
  criteria - The criteria of selection. a List of users meeting the criteria.
throws:
  DataBackendException - if there is a problem accessing thestorage.



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



getUsers
public static 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
public static 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
public static 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
public static boolean isAnonymousUser(User user)(Code)
Checks whether a passed user object matches the anonymous user pattern according to the configured service
Parameters:
  user - A user object True if this is an anonymous user



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



removePermission
public static 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
public static 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 data backend.
throws:
  UnknownEntityException - if the role does not exist.



removeUser
public static void removeUser(User user) throws DataBackendException, UnknownEntityException(Code)
Removes an user account from the system. TODO throw more specific exception

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
public static 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
public static 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
public static 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
public static 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
public static 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
public static 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
public static 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
public static 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
public static 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
public static void savePermission(Permission permission) throws DataBackendException, UnknownEntityException(Code)
Stores Permission's attributes. The Permissions 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
public static 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
public static 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 thestorage.



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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