Source Code Cross Referenced for TablePermsDescriptor.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » sql » dictionary » 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 » db derby 10.2 » org.apache.derby.iapi.sql.dictionary 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.iapi.sql.dictionary.TablePermsDescriptor
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.iapi.sql.dictionary;
023:
024:        import org.apache.derby.catalog.Dependable;
025:        import org.apache.derby.catalog.DependableFinder;
026:        import org.apache.derby.catalog.UUID;
027:
028:        import org.apache.derby.iapi.services.io.StoredFormatIds;
029:        import org.apache.derby.iapi.sql.dictionary.DataDictionary;
030:        import org.apache.derby.iapi.error.StandardException;
031:        import org.apache.derby.impl.sql.catalog.DDdependableFinder;
032:
033:        /**
034:         * This class describes a row in the SYS.SYSTABLEPERMS system table, which
035:         * stores the table permissions that have been granted but not revoked.
036:         */
037:        public class TablePermsDescriptor extends PermissionsDescriptor {
038:            private UUID tableUUID;
039:            private String tableName;
040:            private String selectPriv;
041:            private String deletePriv;
042:            private String insertPriv;
043:            private String updatePriv;
044:            private String referencesPriv;
045:            private String triggerPriv;
046:
047:            public TablePermsDescriptor(DataDictionary dd, String grantee,
048:                    String grantor, UUID tableUUID, String selectPriv,
049:                    String deletePriv, String insertPriv, String updatePriv,
050:                    String referencesPriv, String triggerPriv)
051:                    throws StandardException {
052:                super (dd, grantee, grantor);
053:                this .tableUUID = tableUUID;
054:                this .selectPriv = selectPriv;
055:                this .deletePriv = deletePriv;
056:                this .insertPriv = insertPriv;
057:                this .updatePriv = updatePriv;
058:                this .referencesPriv = referencesPriv;
059:                this .triggerPriv = triggerPriv;
060:                //tableUUID can be null only if the constructor with tablePermsUUID
061:                //has been invoked.
062:                if (tableUUID != null)
063:                    tableName = dd.getTableDescriptor(tableUUID).getName();
064:            }
065:
066:            /**
067:             * This constructor just sets up the key fields of a TablePermsDescriptor
068:             */
069:            public TablePermsDescriptor(DataDictionary dd, String grantee,
070:                    String grantor, UUID tableUUID) throws StandardException {
071:                this (dd, grantee, grantor, tableUUID, (String) null,
072:                        (String) null, (String) null, (String) null,
073:                        (String) null, (String) null);
074:            }
075:
076:            public TablePermsDescriptor(DataDictionary dd, UUID tablePermsUUID)
077:                    throws StandardException {
078:                this (dd, null, null, null, (String) null, (String) null,
079:                        (String) null, (String) null, (String) null,
080:                        (String) null);
081:                this .oid = tablePermsUUID;
082:            }
083:
084:            public int getCatalogNumber() {
085:                return DataDictionary.SYSTABLEPERMS_CATALOG_NUM;
086:            }
087:
088:            /*----- getter functions for rowfactory ------*/
089:            public UUID getTableUUID() {
090:                return tableUUID;
091:            }
092:
093:            public String getSelectPriv() {
094:                return selectPriv;
095:            }
096:
097:            public String getDeletePriv() {
098:                return deletePriv;
099:            }
100:
101:            public String getInsertPriv() {
102:                return insertPriv;
103:            }
104:
105:            public String getUpdatePriv() {
106:                return updatePriv;
107:            }
108:
109:            public String getReferencesPriv() {
110:                return referencesPriv;
111:            }
112:
113:            public String getTriggerPriv() {
114:                return triggerPriv;
115:            }
116:
117:            public String toString() {
118:                return "tablePerms: grantee=" + getGrantee()
119:                        + ",tablePermsUUID=" + getUUID() + ",grantor="
120:                        + getGrantor() + ",tableUUID=" + getTableUUID()
121:                        + ",selectPriv=" + getSelectPriv() + ",deletePriv="
122:                        + getDeletePriv() + ",insertPriv=" + getInsertPriv()
123:                        + ",updatePriv=" + getUpdatePriv() + ",referencesPriv="
124:                        + getReferencesPriv() + ",triggerPriv="
125:                        + getTriggerPriv();
126:            }
127:
128:            /**
129:             * @return true iff the key part of this permissions descriptor equals the key part of another permissions
130:             *         descriptor.
131:             */
132:            public boolean equals(Object other) {
133:                if (!(other instanceof  TablePermsDescriptor))
134:                    return false;
135:                TablePermsDescriptor otherTablePerms = (TablePermsDescriptor) other;
136:                return super .keyEquals(otherTablePerms)
137:                        && tableUUID.equals(otherTablePerms.tableUUID);
138:            }
139:
140:            /**
141:             * @return the hashCode for the key part of this permissions descriptor
142:             */
143:            public int hashCode() {
144:                return super .keyHashCode() + tableUUID.hashCode();
145:            }
146:
147:            /**
148:             * @see PermissionsDescriptor#checkOwner
149:             */
150:            public boolean checkOwner(String authorizationId)
151:                    throws StandardException {
152:                TableDescriptor td = getDataDictionary().getTableDescriptor(
153:                        tableUUID);
154:                if (td.getSchemaDescriptor().getAuthorizationId().equals(
155:                        authorizationId))
156:                    return true;
157:                else
158:                    return false;
159:            }
160:
161:            //////////////////////////////////////////////
162:            //
163:            // PROVIDER INTERFACE
164:            //
165:            //////////////////////////////////////////////
166:
167:            /**
168:             * Return the name of this Provider.  (Useful for errors.)
169:             *
170:             * @return String	The name of this provider.
171:             */
172:            public String getObjectName() {
173:                return "Table Privilege on " + tableName;
174:            }
175:
176:            /**
177:             * Get the provider's type.
178:             *
179:             * @return char		The provider's type.
180:             */
181:            public String getClassType() {
182:                return Dependable.TABLE_PERMISSION;
183:            }
184:
185:            /**		
186:            	@return the stored form of this provider
187:
188:            		@see Dependable#getDependableFinder
189:             */
190:            public DependableFinder getDependableFinder() {
191:                return new DDdependableFinder(
192:                        StoredFormatIds.TABLE_PERMISSION_FINDER_V01_ID);
193:            }
194:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.