PageRenderTime 49ms CodeModel.GetById 14ms RepoModel.GetById 0ms 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
Possible License(s): Apache-2.0, BSD-3-Clause, JSON, CPL-1.0
  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. package org.apache.hadoop.hive.ql.plan;
  19. import java.io.Serializable;
  20. import java.util.List;
  21. import org.apache.hadoop.hive.metastore.api.PrincipalType;
  22. @Explain(displayName = "Grant")
  23. public class GrantDesc extends DDLDesc implements Serializable, Cloneable {
  24. private static final long serialVersionUID = 1L;
  25. private List<PrivilegeDesc> privileges;
  26. private List<PrincipalDesc> principals;
  27. private boolean grantOption;
  28. private String grantor;
  29. private PrincipalType grantorType;
  30. private PrivilegeObjectDesc privilegeSubjectDesc;
  31. public GrantDesc(PrivilegeObjectDesc privilegeSubject,
  32. List<PrivilegeDesc> privilegeDesc, List<PrincipalDesc> principalDesc,
  33. String grantor, PrincipalType grantorType, boolean grantOption) {
  34. super();
  35. this.privilegeSubjectDesc = privilegeSubject;
  36. this.privileges = privilegeDesc;
  37. this.principals = principalDesc;
  38. this.grantor = grantor;
  39. this.grantorType = grantorType;
  40. this.grantOption = grantOption;
  41. }
  42. /**
  43. * @return privileges
  44. */
  45. @Explain(displayName = "Privileges")
  46. public List<PrivilegeDesc> getPrivileges() {
  47. return privileges;
  48. }
  49. /**
  50. * @param privileges
  51. */
  52. public void setPrivileges(List<PrivilegeDesc> privileges) {
  53. this.privileges = privileges;
  54. }
  55. /**
  56. * @return principals
  57. */
  58. @Explain(displayName = "Principals")
  59. public List<PrincipalDesc> getPrincipals() {
  60. return principals;
  61. }
  62. /**
  63. * @param principals
  64. */
  65. public void setPrincipals(List<PrincipalDesc> principals) {
  66. this.principals = principals;
  67. }
  68. /**
  69. * @return grant option
  70. */
  71. @Explain(displayName = "grant option")
  72. public boolean isGrantOption() {
  73. return grantOption;
  74. }
  75. /**
  76. * @param grantOption
  77. */
  78. public void setGrantOption(boolean grantOption) {
  79. this.grantOption = grantOption;
  80. }
  81. /**
  82. * @return privilege subject
  83. */
  84. @Explain(displayName="privilege subject")
  85. public PrivilegeObjectDesc getPrivilegeSubjectDesc() {
  86. return privilegeSubjectDesc;
  87. }
  88. /**
  89. * @param privilegeSubjectDesc
  90. */
  91. public void setPrivilegeSubjectDesc(PrivilegeObjectDesc privilegeSubjectDesc) {
  92. this.privilegeSubjectDesc = privilegeSubjectDesc;
  93. }
  94. public String getGrantor() {
  95. return grantor;
  96. }
  97. public void setGrantor(String grantor) {
  98. this.grantor = grantor;
  99. }
  100. public PrincipalType getGrantorType() {
  101. return grantorType;
  102. }
  103. public void setGrantorType(PrincipalType grantorType) {
  104. this.grantorType = grantorType;
  105. }
  106. }