Java Doc for Grantee.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.Grantee

Grantee
public class Grantee (Code)
A Grantee Object holds the name, access and administrative rights for a particular grantee.

It supplies the methods used to grant, revoke, test and check a grantee's access rights to other database objects. It also holds a reference to the common PUBLIC User Object, which represent the special user refered to in GRANT ... TO PUBLIC statements.

The check(), isAccessible() and getGrantedClassNames() methods check the rights granted to the PUBLIC User Object, in addition to individually granted rights, in order to decide which rights exist for the user. Method names ending in Direct indicate methods which do not recurse to look through Roles which "this" object is a member of. We use the word "Admin" (e.g., in private variable "admin" and method "isAdmin()) to mean this Grantee has admin priv by any means. We use the word "adminDirect" (e.g., in private variable "adminDirect" and method "isAdminDirect()) to mean this Grantee has admin priv directly.
author:
   boucherb@users
author:
   fredt@usrs
author:
   unsaved@users
version:
   1.8.0
since:
   1.8.0



Field Summary
 booleanisRole
    
 HashSetroles
     These are the DIRECT roles.

Constructor Summary
 Grantee(String name, Grantee inGrantee, GranteeManager man)
     Constructor, with a argument reference to the PUBLIC User Object which is null if this is the SYS or PUBLIC user. The dependency upon a GranteeManager is undesirable.

Method Summary
public  StringallRolesString()
    
 voidcheck(HsqlName dbobject, int rights)
     Checks if any of the rights represented by the rights argument have been granted on the specified database object.
 voidcheck(String dbobject)
    
 voidcheckAdmin()
     Checks whether this Grantee has administrative privs either directly or indirectly.
 voidclearPrivileges()
     Revokes all rights from this Grantee object.
public  HashSetgetAllRoles()
     Gets direct and nested roles.
 StringgetAllRolesString()
    
public  HashSetgetDirectRoles()
     Gets direct roles, not roles nested within them.
 StringgetDirectRolesString()
    
 HashSetgetGrantedClassNames(boolean andToPublic)
     Retrieves the distinct set of Java Class FQNs for which this User object has been granted ALL (the Class execution privilege).
 HashSetgetGrantedClassNamesDirect()
     Retrieves the distinct set of Java Class FQNs for which this User object has directly been granted ALL (the Class execution privilege).
 StringgetName()
    
 IntValueHashMapgetRights()
     Retrieves the map object that represents the rights that have been granted on database objects.
public  voidgrant(String role)
    
 voidgrant(Object dbobject, int rights)
     Grants the specified rights on the specified database object.
public  booleanhasRole(String role)
    
public  booleanhasRoleDirect(String role)
    
 booleanisAccessible(HsqlName dbObject, int rights)
     Returns true if any of the rights represented by the rights argument has been granted on the database object identified by the dbobject argument.
 booleanisAccessible(String functionName)
     Returns true if any right at all has been granted to this User object on the database object identified by the dbObject argument.
 booleanisAccessible(HsqlName dbObject)
     Returns true if any right at all has been granted to this User object on the database object identified by the dbObject argument.
 booleanisAdmin()
     Returns true if this Grantee has administrative privs either directly or indirectly.
 booleanisAdminDirect()
     Returns true if this grantee object is for a user with Direct database administrator privileges. I.e., if this User/Role has Admin priv.
protected  booleanisDirectlyAccessible(Object dbObject, int rights)
     Returns true if any of the rights represented by the rights argument has been granted on the database object identified by the dbObject argument.
 String[]listGrantedTablePrivileges(HsqlName name)
     Retrieves a string[] whose elements are the names of the rights explicitly granted with the GRANT command to this User object on the Table object identified by the name argument.
public  voidrevoke(String role)
    
 voidrevoke(Object dbobject, int rights)
     Revokes the specified rights on the specified database object.
 voidrevokeDbObject(Object dbobject)
    
 voidsetAdminDirect()
     Violates naming convention (for backward compatibility).
public  StringsetToString(Set set)
    
 voidupdateAllRights()
     Method used with all Grantee objects to set the full set of rights according to those inherited form ROLE Grantee objects and those granted to the object itself.
 booleanupdateNestedRoles(String role)
     Recursive method used with ROLE Grantee objects to set the fullRightsMap and admin flag for all the roles. If a new ROLE is granted to a ROLE Grantee object, the ROLE should first be added to the Set of ROLE Grantee objects (roles) for the grantee. The grantee will be the parameter. If the direct permissions granted to an existing ROLE Grentee is modified no extra initial action is necessary. The existing Grantee will b the parameter. If an existing ROLE is REVOKEed from a ROLE, it should first be removed from the set of ROLE Grantee objects in the containing ROLE. The containing ROLE will be the parameter. If an existing ROLE is DROPped, all its privileges should be cleared first.

Field Detail
isRole
boolean isRole(Code)



roles
HashSet roles(Code)
These are the DIRECT roles. Each of these may contain nested roles




Constructor Detail
Grantee
Grantee(String name, Grantee inGrantee, GranteeManager man) throws HsqlException(Code)
Constructor, with a argument reference to the PUBLIC User Object which is null if this is the SYS or PUBLIC user. The dependency upon a GranteeManager is undesirable. Hopefully we can get rid of this dependency with an IOC or Listener re-design.




Method Detail
allRolesString
public String allRolesString()(Code)



check
void check(HsqlName dbobject, int rights) throws HsqlException(Code)
Checks if any of the rights represented by the rights argument have been granted on the specified database object.

This is done by checking that a mapping exists in the rights map from the dbobject argument for at least one of the rights contained in the rights argument. Otherwise, it throws.




check
void check(String dbobject) throws HsqlException(Code)



checkAdmin
void checkAdmin() throws HsqlException(Code)
Checks whether this Grantee has administrative privs either directly or indirectly. Otherwise it throws.



clearPrivileges
void clearPrivileges()(Code)
Revokes all rights from this Grantee object. The map is cleared and the database administrator role attribute is set false.



getAllRoles
public HashSet getAllRoles()(Code)
Gets direct and nested roles.



getAllRolesString
String getAllRolesString()(Code)



getDirectRoles
public HashSet getDirectRoles()(Code)
Gets direct roles, not roles nested within them.



getDirectRolesString
String getDirectRolesString()(Code)



getGrantedClassNames
HashSet getGrantedClassNames(boolean andToPublic) throws HsqlException(Code)
Retrieves the distinct set of Java Class FQNs for which this User object has been granted ALL (the Class execution privilege).


Parameters:
  andToPublic - if true, then the set includes thenames of classes accessible to this User objectthrough grants to its Roles + PUBLICUser object attribute, else only role grants+ direct grants are included. the distinct set of Java Class FQNs for which thisthis User object has been grantedALL.




getGrantedClassNamesDirect
HashSet getGrantedClassNamesDirect() throws HsqlException(Code)
Retrieves the distinct set of Java Class FQNs for which this User object has directly been granted ALL (the Class execution privilege). Does NOT check nested the pubGrantee nor nested roles. the distinct set of Java Class FQNs for which thisthis User object has been grantedALL.



getName
String getName()(Code)



getRights
IntValueHashMap getRights()(Code)
Retrieves the map object that represents the rights that have been granted on database objects.

The map has keys and values with the following interpretation:

  • The keys are generally (but not limited to) objects having an attribute or value equal to the name of an actual database object.
  • Specifically, the keys act as database object identifiers.
  • The values are always Integer objects, each formed by combining a set of flags, one for each of the access rights defined in UserManager: {SELECT, INSERT, UPDATE and DELETE}.



grant
public void grant(String role) throws HsqlException(Code)
Grant a role



grant
void grant(Object dbobject, int rights)(Code)
Grants the specified rights on the specified database object.

Keys stored in rightsMap for database tables are their HsqlName attribute. This allows rights to persist when a table is renamed.




hasRole
public boolean hasRole(String role)(Code)



hasRoleDirect
public boolean hasRoleDirect(String role)(Code)



isAccessible
boolean isAccessible(HsqlName dbObject, int rights) throws HsqlException(Code)
Returns true if any of the rights represented by the rights argument has been granted on the database object identified by the dbobject argument.

This is done by checking that a mapping exists in the rights map from the dbobject argument for at least one of the rights contained in the rights argument. Only does one level of recursion to check the PUBLIC role.




isAccessible
boolean isAccessible(String functionName) throws HsqlException(Code)
Returns true if any right at all has been granted to this User object on the database object identified by the dbObject argument.



isAccessible
boolean isAccessible(HsqlName dbObject) throws HsqlException(Code)
Returns true if any right at all has been granted to this User object on the database object identified by the dbObject argument.



isAdmin
boolean isAdmin()(Code)
Returns true if this Grantee has administrative privs either directly or indirectly.



isAdminDirect
boolean isAdminDirect()(Code)
Returns true if this grantee object is for a user with Direct database administrator privileges. I.e., if this User/Role has Admin priv. directly, not via a nested Role.



isDirectlyAccessible
protected boolean isDirectlyAccessible(Object dbObject, int rights) throws HsqlException(Code)
Returns true if any of the rights represented by the rights argument has been granted on the database object identified by the dbObject argument.

This is done by checking that a mapping exists in the rights map from the dbObject argument for at least one of the rights contained in the rights argument. Considers none of pubGranee, nested roles, admin privs, globally available Class object.




listGrantedTablePrivileges
String[] listGrantedTablePrivileges(HsqlName name)(Code)
Retrieves a string[] whose elements are the names of the rights explicitly granted with the GRANT command to this User object on the Table object identified by the name argument. array of Strings naming the rights granted to thisUser object on the Table objectidentified by the name argument.
Parameters:
  name - a Table object identifier



revoke
public void revoke(String role) throws HsqlException(Code)
Revoke a direct role only



revoke
void revoke(Object dbobject, int rights)(Code)
Revokes the specified rights on the specified database object.

If, after removing the specified rights, no rights remain on the database object, then the key/value pair for that object is removed from the rights map




revokeDbObject
void revokeDbObject(Object dbobject)(Code)
Revokes all rights on the specified database object.

This method removes any existing mapping from the rights map




setAdminDirect
void setAdminDirect()(Code)
Violates naming convention (for backward compatibility). Should be "setAdminDirect(boolean").



setToString
public String setToString(Set set)(Code)



updateAllRights
void updateAllRights()(Code)
Method used with all Grantee objects to set the full set of rights according to those inherited form ROLE Grantee objects and those granted to the object itself.



updateNestedRoles
boolean updateNestedRoles(String role)(Code)
Recursive method used with ROLE Grantee objects to set the fullRightsMap and admin flag for all the roles. If a new ROLE is granted to a ROLE Grantee object, the ROLE should first be added to the Set of ROLE Grantee objects (roles) for the grantee. The grantee will be the parameter. If the direct permissions granted to an existing ROLE Grentee is modified no extra initial action is necessary. The existing Grantee will b the parameter. If an existing ROLE is REVOKEed from a ROLE, it should first be removed from the set of ROLE Grantee objects in the containing ROLE. The containing ROLE will be the parameter. If an existing ROLE is DROPped, all its privileges should be cleared first. The ROLE will be the parameter. After calling this method on all other roles, the DROPped role should be removed from all grantees. After the initial modification, this method should be called iteratively on all the ROLE Grantee objects contained in RoleManager. The updateAllRights() method is then called iteratively on all the USER Grantee objects contained in UserManager.
Parameters:
  role - a modified, revoked or dropped role. true if this Grantee has possibly changed as a result



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.