PageRenderTime 37ms CodeModel.GetById 14ms app.highlight 17ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/release-0.1-rc2/hive/external/ql/src/java/org/apache/hadoop/hive/ql/plan/GrantDesc.java

#
Java | 131 lines | 65 code | 25 blank | 41 comment | 0 complexity | 0d563c1b365cf88aeccdd2e1617983cd MD5 | raw file
  1/**
  2 * Licensed to the Apache Software Foundation (ASF) under one
  3 * or more contributor license agreements.  See the NOTICE file
  4 * distributed with this work for additional information
  5 * regarding copyright ownership.  The ASF licenses this file
  6 * to you under the Apache License, Version 2.0 (the
  7 * "License"); you may not use this file except in compliance
  8 * with the License.  You may obtain a copy of the License at
  9 *
 10 *     http://www.apache.org/licenses/LICENSE-2.0
 11 *
 12 * Unless required by applicable law or agreed to in writing, software
 13 * distributed under the License is distributed on an "AS IS" BASIS,
 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 15 * See the License for the specific language governing permissions and
 16 * limitations under the License.
 17 */
 18
 19package org.apache.hadoop.hive.ql.plan;
 20
 21import java.io.Serializable;
 22import java.util.List;
 23
 24import org.apache.hadoop.hive.metastore.api.PrincipalType;
 25
 26@Explain(displayName = "Grant")
 27public class GrantDesc extends DDLDesc implements Serializable, Cloneable {
 28
 29  private static final long serialVersionUID = 1L;
 30
 31  private List<PrivilegeDesc> privileges;
 32
 33  private List<PrincipalDesc> principals;
 34
 35  private boolean grantOption;
 36  
 37  private String grantor;
 38  
 39  private PrincipalType grantorType;
 40
 41  private PrivilegeObjectDesc privilegeSubjectDesc;
 42
 43  public GrantDesc(PrivilegeObjectDesc privilegeSubject,
 44      List<PrivilegeDesc> privilegeDesc, List<PrincipalDesc> principalDesc,
 45      String grantor, PrincipalType grantorType, boolean grantOption) {
 46    super();
 47    this.privilegeSubjectDesc = privilegeSubject;
 48    this.privileges = privilegeDesc;
 49    this.principals = principalDesc;
 50    this.grantor = grantor;
 51    this.grantorType = grantorType;
 52    this.grantOption = grantOption;
 53  }
 54
 55  /**
 56   * @return privileges
 57   */
 58  @Explain(displayName = "Privileges")
 59  public List<PrivilegeDesc> getPrivileges() {
 60    return privileges;
 61  }
 62
 63  /**
 64   * @param privileges
 65   */
 66  public void setPrivileges(List<PrivilegeDesc> privileges) {
 67    this.privileges = privileges;
 68  }
 69
 70  /**
 71   * @return principals 
 72   */
 73  @Explain(displayName = "Principals")
 74  public List<PrincipalDesc> getPrincipals() {
 75    return principals;
 76  }
 77
 78  /**
 79   * @param principals
 80   */
 81  public void setPrincipals(List<PrincipalDesc> principals) {
 82    this.principals = principals;
 83  }
 84
 85  /**
 86   * @return grant option
 87   */
 88  @Explain(displayName = "grant option")
 89  public boolean isGrantOption() {
 90    return grantOption;
 91  }
 92
 93  /**
 94   * @param grantOption
 95   */
 96  public void setGrantOption(boolean grantOption) {
 97    this.grantOption = grantOption;
 98  }
 99
100  /**
101   * @return privilege subject
102   */
103  @Explain(displayName="privilege subject")
104  public PrivilegeObjectDesc getPrivilegeSubjectDesc() {
105    return privilegeSubjectDesc;
106  }
107
108  /**
109   * @param privilegeSubjectDesc
110   */
111  public void setPrivilegeSubjectDesc(PrivilegeObjectDesc privilegeSubjectDesc) {
112    this.privilegeSubjectDesc = privilegeSubjectDesc;
113  }
114
115  public String getGrantor() {
116    return grantor;
117  }
118
119  public void setGrantor(String grantor) {
120    this.grantor = grantor;
121  }
122
123  public PrincipalType getGrantorType() {
124    return grantorType;
125  }
126
127  public void setGrantorType(PrincipalType grantorType) {
128    this.grantorType = grantorType;
129  }
130
131}