KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > sql > execute > GrantRevokeConstantAction


1 /*
2
3    Derby - Class org.apache.derby.impl.sql.execute.GrantRevokeConstantAction
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.sql.execute;
23
24 import org.apache.derby.iapi.services.sanity.SanityManager;
25 import org.apache.derby.catalog.UUID;
26 import org.apache.derby.iapi.error.StandardException;
27 import org.apache.derby.iapi.sql.Activation;
28
29 import java.util.List JavaDoc;
30
31 class GrantRevokeConstantAction extends GenericConstantAction
32 {
33     private boolean grant;
34     private PrivilegeInfo privileges;
35     private List JavaDoc grantees;
36
37     GrantRevokeConstantAction( boolean grant,
38                                PrivilegeInfo privileges,
39                                List JavaDoc grantees)
40     {
41         this.grant = grant;
42         this.privileges = privileges;
43         this.grantees = grantees;
44     }
45
46     public String JavaDoc toString()
47     {
48         return grant ? "GRANT" : "REVOKE";
49     }
50
51
52     /**
53      * This is the guts of the Execution-time logic for GRANT/REVOKE
54      *
55      * See ConstantAction#executeConstantAction
56      *
57      * @exception StandardException Thrown on failure
58      */

59     public void executeConstantAction( Activation activation )
60                         throws StandardException
61     {
62         privileges.executeGrantRevoke( activation, grant, grantees);
63     }
64 }
65
Popular Tags