public TListSentryRolesRequest deepCopy() { return new TListSentryRolesRequest(this); }
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_roles_by_group_args(list_sentry_roles_by_group_args other) { if (other.isSetRequest()) { this.request = new TListSentryRolesRequest(other.request); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_roles_by_group_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryRolesRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_roles_by_group_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 TListSentryRolesRequest(); 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(); }
/** * Gets sentry role objects for a given groupName using the Sentry service * @param requestorUserName : user on whose behalf the request is issued * @param groupName : groupName to look up ( if null returns all roles for all groups) * @return Set of thrift sentry role objects * @throws SentryUserException */ public synchronized Set<TSentryRole> listRolesByGroupName( String requestorUserName, String groupName) throws SentryUserException { TListSentryRolesRequest request = new TListSentryRolesRequest(); request.setProtocol_version(ThriftConstants.TSENTRY_SERVICE_VERSION_CURRENT); request.setRequestorUserName(requestorUserName); request.setGroupName(groupName); TListSentryRolesResponse response; try { response = client.list_sentry_roles_by_group(request); Status.throwIfNotOk(response.getStatus()); return response.getRoles(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }