Java Doc for GranteeManager.java in  » Database-DBMS » hsql » org » hsqldb » 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 » Database DBMS » hsql » org.hsqldb 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.hsqldb.GranteeManager

GranteeManager
class GranteeManager implements GrantConstants(Code)
Contains a set of Grantee objects, and supports operations for creating, finding, modifying and deleting Grantee objects for a Database; plus Administrative privileges.
author:
   boucherb@users
author:
   fredt@users
author:
   unsaved@users
version:
   1.8.0
since:
   1.8.0
See Also:   Grantee


Field Summary
final static  StringDBA_ADMIN_ROLE_NAME
     The role name reserved for ADMIN users.
final static  StringPUBLIC_ROLE_NAME
     The role name reserved for the special PUBLIC pseudo-user.
final static  StringSYSTEM_AUTHORIZATION_NAME
     The role name reserved for authorization of INFORMATION_SCHEMA and system objects.
final static  String[]emptyRightsList
     An empty list that is returned from GranteeManager.listTablePrivileges listTablePrivileges when it is detected that neither this User object or its PUBLIC User object attribute have been granted any rights on the Table object identified by the specified HsqlName object.
final static  IntKeyHashMaphRightsLists
     MAP: int => HsqlArrayList.
final static  IntValueHashMaprightsStringLookup
    

Constructor Summary
public  GranteeManager(Database inDatabase)
     Construct the GranteeManager for a Database.

Method Summary
public  GranteeaddGrantee(String name)
     We don't have to worry about anything manually creating a reserved account, because the reserved accounts are created upon DB initialization.
 StringaddRole(String name)
     Creates a new Role object under management of this object.
 voiddropRole(String name)
     Attempts to drop a Role with the specified name from this object's set.
public  Granteeget(String name)
    
static  intgetCheckRight(String right)
    
 HashSetgetGrantedClassNames()
     Retrieves the set of distinct, fully qualified Java Class names upon which any grants currently exist to elements in this collection.
public  CollectiongetGrantees()
    
static  intgetRight(String right)
     Translate a string representation or right(s) into its numeric form.
static  String[]getRightsArray(int rights)
     Retrieves the list of right names represented by the right flags set in the specified Integer object's int value.
static  StringgetRightsList(int rights)
     Returns a comma separated list of right names corresponding to the right flags set in the right argument.
 GranteegetRole(String name)
    
public  SetgetRoleNames()
    
 voidgrant(String name, Object dbobject, int rights)
     Grants the rights represented by the rights argument on the database object identified by the dbobject argument to the Grantee object identified by name argument.

Note: For the dbobject argument, Java Class objects are identified using a String object whose value is the fully qualified name of the Class, while Table and other objects are identified by an HsqlName object.

 voidgrant(String name, String role)
     Grant a role to this Grantee.
 booleanisGrantee(String name)
     Returns true if named Grantee object exists.
public static  booleanisImmutable(String name)
    
public static  booleanisReserved(String name)
    
 booleanisRole(String name)
    
 voidremoveDbObject(Object dbobject)
     Removes all rights mappings for the database object identified by the dbobject argument from all Grantee objects in the set.
 voidremoveEmptyRole(Grantee role)
    
public  booleanremoveGrantee(String name)
    
 voidrevoke(String name, String role)
    
 voidrevoke(String name, Object dbobject, int rights)
    
 voidupdateAllRights(Grantee role)
     First updates all ROLE Grantee objects.
public static  booleanvalidRightString(String rightString)
    

Field Detail
DBA_ADMIN_ROLE_NAME
final static String DBA_ADMIN_ROLE_NAME(Code)
The role name reserved for ADMIN users.



PUBLIC_ROLE_NAME
final static String PUBLIC_ROLE_NAME(Code)
The role name reserved for the special PUBLIC pseudo-user.



SYSTEM_AUTHORIZATION_NAME
final static String SYSTEM_AUTHORIZATION_NAME(Code)
The role name reserved for authorization of INFORMATION_SCHEMA and system objects.



emptyRightsList
final static String[] emptyRightsList(Code)
An empty list that is returned from GranteeManager.listTablePrivileges listTablePrivileges when it is detected that neither this User object or its PUBLIC User object attribute have been granted any rights on the Table object identified by the specified HsqlName object.



hRightsLists
final static IntKeyHashMap hRightsLists(Code)
MAP: int => HsqlArrayList.

This map caches the lists of String objects naming the rights corresponding to each valid set of rights flags, as returned by GranteeManager.listRightNames listRightNames




rightsStringLookup
final static IntValueHashMap rightsStringLookup(Code)




Constructor Detail
GranteeManager
public GranteeManager(Database inDatabase) throws HsqlException(Code)
Construct the GranteeManager for a Database. Construct special Grantee objects for PUBLIC and SYS, and add them to the Grantee map. We depend on the corresponding User accounts being created independently so as to remove a dependency to the UserManager class.
Parameters:
  inDatabase - Only needed to link to the RoleManager later on.




Method Detail
addGrantee
public Grantee addGrantee(String name) throws HsqlException(Code)
We don't have to worry about anything manually creating a reserved account, because the reserved accounts are created upon DB initialization. If somebody tries to create one of these accounts after that, it will fail because the account will already exist. (We do prevent them from being removed, elsewhere!)



addRole
String addRole(String name) throws HsqlException(Code)
Creates a new Role object under management of this object.

A set of constraints regarding user creation is imposed:

  1. Can't create a role with name same as any right.
  2. If the specified name is null, then an ASSERTION_FAILED exception is thrown stating that the name is null.
  3. If this object's collection already contains an element whose name attribute equals the name argument, then a GRANTEE_ALREADY_EXISTS or ROLE_ALREADY_EXISTS Trace is thrown. (This will catch attempts to create Reserved grantee names).



dropRole
void dropRole(String name) throws HsqlException(Code)
Attempts to drop a Role with the specified name from this object's set.

A successful drop action consists of:

  • removing the Grantee object with the specified name from the set.
  • revoking all rights from the removed object
    (this ensures that in case there are still references to the just dropped Grantee object, those references cannot be used to erronously access database objects).




get
public Grantee get(String name)(Code)



getCheckRight
static int getCheckRight(String right) throws HsqlException(Code)



getGrantedClassNames
HashSet getGrantedClassNames() throws HsqlException(Code)
Retrieves the set of distinct, fully qualified Java Class names upon which any grants currently exist to elements in this collection.

the set of distinct, fully qualified Java Class names, asString objects, upon which grants currently existto the elements of this collection




getGrantees
public Collection getGrantees()(Code)



getRight
static int getRight(String right)(Code)
Translate a string representation or right(s) into its numeric form.



getRightsArray
static String[] getRightsArray(int rights)(Code)
Retrieves the list of right names represented by the right flags set in the specified Integer object's int value.


Parameters:
  rights - An Integer representing a set of right flags an empty list if the specified Integer object isnull, else a list of rights, as String objects,represented by the rights flag bits set in the specifiedInteger object's int value.




getRightsList
static String getRightsList(int rights)(Code)
Returns a comma separated list of right names corresponding to the right flags set in the right argument.




getRole
Grantee getRole(String name) throws HsqlException(Code)
Returns Grantee for the named Role



getRoleNames
public Set getRoleNames()(Code)



grant
void grant(String name, Object dbobject, int rights) throws HsqlException(Code)
Grants the rights represented by the rights argument on the database object identified by the dbobject argument to the Grantee object identified by name argument.

Note: For the dbobject argument, Java Class objects are identified using a String object whose value is the fully qualified name of the Class, while Table and other objects are identified by an HsqlName object. A Table object identifier must be precisely the one obtained by calling table.getName(); if a different HsqlName object with an identical name attribute is specified, then rights checks and tests will fail, since the HsqlName class implements its HsqlName.hashCode hashCode and HsqlName.equals equals methods based on pure object identity, rather than on attribute values.




grant
void grant(String name, String role) throws HsqlException(Code)
Grant a role to this Grantee.



isGrantee
boolean isGrantee(String name)(Code)
Returns true if named Grantee object exists. This will return true for reserved Grantees SYSTEM_AUTHORIZATION_NAME, ADMIN_ROLE_NAME, PUBLIC_USER_NAME.



isImmutable
public static boolean isImmutable(String name)(Code)



isReserved
public static boolean isReserved(String name)(Code)



isRole
boolean isRole(String name) throws HsqlException(Code)



removeDbObject
void removeDbObject(Object dbobject)(Code)
Removes all rights mappings for the database object identified by the dbobject argument from all Grantee objects in the set.



removeEmptyRole
void removeEmptyRole(Grantee role)(Code)
Removes a role without any privileges from all grantees



removeGrantee
public boolean removeGrantee(String name)(Code)



revoke
void revoke(String name, String role) throws HsqlException(Code)
Revoke a role from a Grantee



revoke
void revoke(String name, Object dbobject, int rights) throws HsqlException(Code)
Revokes the rights represented by the rights argument on the database object identified by the dbobject argument from the User object identified by the name argument.


See Also:   GranteeManager.grant




updateAllRights
void updateAllRights(Grantee role)(Code)
First updates all ROLE Grantee objects. Then updates all USER Grantee Objects.



validRightString
public static boolean validRightString(String rightString)(Code)



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.