public Object getFieldValue(_Fields field) { switch (field) { case PROTOCOL_VERSION: return getProtocol_version(); case GROUPS: return getGroups(); case ROLE_SET: return getRoleSet(); case AUTHORIZABLE_HIERARCHY: return getAuthorizableHierarchy(); case USERS: return getUsers(); } throw new IllegalStateException(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, list_sentry_privileges_for_provider_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.request = new TListSentryPrivilegesForProviderRequest(); struct.request.read(iprot); struct.setRequestIsSet(true); } } }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TListSentryPrivilegesForProviderRequest) return this.equals((TListSentryPrivilegesForProviderRequest)that); return false; }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case PROTOCOL_VERSION: return isSetProtocol_version(); case GROUPS: return isSetGroups(); case ROLE_SET: return isSetRoleSet(); case AUTHORIZABLE_HIERARCHY: return isSetAuthorizableHierarchy(); case USERS: return isSetUsers(); } throw new IllegalStateException(); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetProtocol_version()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'protocol_version' is unset! Struct:" + toString()); } if (!isSetGroups()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'groups' is unset! Struct:" + toString()); } if (!isSetRoleSet()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleSet' is unset! Struct:" + toString()); } // check for sub-struct validity if (roleSet != null) { roleSet.validate(); } if (authorizableHierarchy != null) { authorizableHierarchy.validate(); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TListSentryPrivilegesForProviderRequest struct) throws org.apache.thrift.TException { struct.validate(); if (struct.isSetAuthorizableHierarchy()) { oprot.writeFieldBegin(AUTHORIZABLE_HIERARCHY_FIELD_DESC); struct.authorizableHierarchy.write(oprot); if (struct.isSetUsers()) { oprot.writeFieldBegin(USERS_FIELD_DESC);
@Override public Set<String> listPrivilegesForProvider (Set<String> groups, Set<String> users, ActiveRoleSet roleSet, Authorizable... authorizable) throws SentryUserException { TSentryActiveRoleSet thriftRoleSet = new TSentryActiveRoleSet(roleSet.isAll(), roleSet.getRoles()); TListSentryPrivilegesForProviderRequest request = new TListSentryPrivilegesForProviderRequest(ThriftConstants. TSENTRY_SERVICE_VERSION_CURRENT, groups, thriftRoleSet); if (authorizable != null && authorizable.length > 0) { TSentryAuthorizable tSentryAuthorizable = setupSentryAuthorizable(Lists .newArrayList(authorizable)); request.setAuthorizableHierarchy(tSentryAuthorizable); } if (users != null) { request.setUsers(users); } try { TListSentryPrivilegesForProviderResponse response = client.list_sentry_privileges_for_provider(request); Status.throwIfNotOk(response.getStatus()); return response.getPrivileges(); } catch (TException e) { throw new SentryUserException(THRIFT_EXCEPTION_MESSAGE, e); } }
if (isSetAuthorizableHierarchy()) { if (!first) sb.append(", "); sb.append("authorizableHierarchy:"); if (isSetUsers()) { if (!first) sb.append(", "); sb.append("users:");
public TListSentryPrivilegesForProviderRequest deepCopy() { return new TListSentryPrivilegesForProviderRequest(this); }
/** * Performs a deep copy on <i>other</i>. */ public TListSentryPrivilegesForProviderRequest(TListSentryPrivilegesForProviderRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetGroups()) { Set<String> __this__groups = new HashSet<String>(other.groups); this.groups = __this__groups; } if (other.isSetRoleSet()) { this.roleSet = new TSentryActiveRoleSet(other.roleSet); } if (other.isSetAuthorizableHierarchy()) { this.authorizableHierarchy = new TSentryAuthorizable(other.authorizableHierarchy); } if (other.isSetUsers()) { Set<String> __this__users = new HashSet<String>(other.users); this.users = __this__users; } }
if (struct.isSetAuthorizableHierarchy()) { optionals.set(0); if (struct.isSetUsers()) { optionals.set(1); if (struct.isSetAuthorizableHierarchy()) { struct.authorizableHierarchy.write(oprot); if (struct.isSetUsers()) {
/** * Performs a deep copy on <i>other</i>. */ public list_sentry_privileges_for_provider_args(list_sentry_privileges_for_provider_args other) { if (other.isSetRequest()) { this.request = new TListSentryPrivilegesForProviderRequest(other.request); } }
response.setPrivileges(new HashSet<String>()); try { validateClientVersion(request.getProtocol_version()); Set<String> privilegesForProvider = sentryStore.listSentryPrivilegesForProvider(request.getGroups(), request.getUsers(), request.getRoleSet(), request.getAuthorizableHierarchy()); response.setPrivileges(privilegesForProvider); if (privilegesForProvider == null || privilegesForProvider.size() == 0 && request.getAuthorizableHierarchy() != null && sentryStore.hasAnyServerPrivileges(request.getGroups(), request.getUsers(), request.getRoleSet(), request.getAuthorizableHierarchy().getServer())) {
boolean this_present_groups = true && this.isSetGroups(); boolean that_present_groups = true && that.isSetGroups(); if (this_present_groups || that_present_groups) { if (!(this_present_groups && that_present_groups)) boolean this_present_roleSet = true && this.isSetRoleSet(); boolean that_present_roleSet = true && that.isSetRoleSet(); if (this_present_roleSet || that_present_roleSet) { if (!(this_present_roleSet && that_present_roleSet)) boolean this_present_authorizableHierarchy = true && this.isSetAuthorizableHierarchy(); boolean that_present_authorizableHierarchy = true && that.isSetAuthorizableHierarchy(); if (this_present_authorizableHierarchy || that_present_authorizableHierarchy) { if (!(this_present_authorizableHierarchy && that_present_authorizableHierarchy)) boolean this_present_users = true && this.isSetUsers(); boolean that_present_users = true && that.isSetUsers(); if (this_present_users || that_present_users) { if (!(this_present_users && that_present_users))
public void read(org.apache.thrift.protocol.TProtocol iprot, list_sentry_privileges_for_provider_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 TListSentryPrivilegesForProviderRequest(); 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 boolean equals(list_sentry_privileges_for_provider_args that) { if (that == null) return false; boolean this_present_request = true && this.isSetRequest(); boolean that_present_request = true && that.isSetRequest(); if (this_present_request || that_present_request) { if (!(this_present_request && that_present_request)) return false; if (!this.request.equals(that.request)) return false; } return true; }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_protocol_version = true; list.add(present_protocol_version); if (present_protocol_version) list.add(protocol_version); boolean present_groups = true && (isSetGroups()); list.add(present_groups); if (present_groups) list.add(groups); boolean present_roleSet = true && (isSetRoleSet()); list.add(present_roleSet); if (present_roleSet) list.add(roleSet); boolean present_authorizableHierarchy = true && (isSetAuthorizableHierarchy()); list.add(present_authorizableHierarchy); if (present_authorizableHierarchy) list.add(authorizableHierarchy); boolean present_users = true && (isSetUsers()); list.add(present_users); if (present_users) list.add(users); return list.hashCode(); }
lastComparison = Boolean.valueOf(isSetProtocol_version()).compareTo(other.isSetProtocol_version()); if (lastComparison != 0) { return lastComparison; if (isSetProtocol_version()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.protocol_version, other.protocol_version); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetGroups()).compareTo(other.isSetGroups()); if (lastComparison != 0) { return lastComparison; if (isSetGroups()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.groups, other.groups); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetRoleSet()).compareTo(other.isSetRoleSet()); if (lastComparison != 0) { return lastComparison; if (isSetRoleSet()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleSet, other.roleSet); if (lastComparison != 0) { lastComparison = Boolean.valueOf(isSetAuthorizableHierarchy()).compareTo(other.isSetAuthorizableHierarchy()); if (lastComparison != 0) { return lastComparison; if (isSetAuthorizableHierarchy()) {