public TListSentryPrivilegesRequest deepCopy() { return new TListSentryPrivilegesRequest(this); }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_by_role_args(list_sentry_privileges_by_role_args other) { if (other.isSetRequest()) { this.request = new TListSentryPrivilegesRequest(other.request); } }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_by_user_args(list_sentry_privileges_by_user_args other) { if (other.isSetRequest()) { this.request = new TListSentryPrivilegesRequest(other.request); } }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_by_user_and_itsgroups_args(list_sentry_privileges_by_user_and_itsgroups_args other) { if (other.isSetRequest()) { this.request = new TListSentryPrivilegesRequest(other.request); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_by_user_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_by_role_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_by_user_and_itsgroups_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_by_user_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_by_role_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_by_user_and_itsgroups_args struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); while (true) { schemeField = iprot.readFieldBegin(); if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { break; } switch (schemeField.id) { case 1: // REQUEST if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.request = new TListSentryPrivilegesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); struct.validate(); }
private TListSentryPrivilegesRequest newPrivilegesRequest(String requestorUser, String principalName, TSentryAuthorizable authorizable) { TListSentryPrivilegesRequest request = new TListSentryPrivilegesRequest(); request.setRequestorUserName(requestorUser); request.setPrincipalName(principalName); request.setAuthorizableHierarchy(authorizable); return request; }
String roleName, List<? extends Authorizable> authorizable) throws SentryUserException { TListSentryPrivilegesRequest request = new TListSentryPrivilegesRequest(); request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT); request.setRequestorUserName(requestorUserName);
@Override public Set<TSentryPrivilege> listPrivilegesByUserName(String requestorUserName, String userName, List<? extends Authorizable> authorizable) throws SentryUserException { TListSentryPrivilegesRequest request = new TListSentryPrivilegesRequest(); request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT); request.setRequestorUserName(requestorUserName); // TODO: Remove setRoleName() once the required field is removed request.setRoleName(""); // roleName is unused by it is required by Thrift request.setPrincipalName(userName); if (authorizable != null && !authorizable.isEmpty()) { TSentryAuthorizable tSentryAuthorizable = setupSentryAuthorizable(authorizable); request.setAuthorizableHierarchy(tSentryAuthorizable); } TListSentryPrivilegesResponse response; try { response = client.list_sentry_privileges_by_user(request); if (response == null) { throw new SentryUserException("The Sentry server has returned a NULL response. " + "See the Sentry server logs for more information about the error."); } Status.throwIfNotOk(response.getStatus()); return response.getPrivileges(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }