public TSentryActiveRoleSet deepCopy() { return new TSentryActiveRoleSet(this); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TSentryActiveRoleSet) return this.equals((TSentryActiveRoleSet)that); return false; }
public void setFieldValue(_Fields field, Object value) { switch (field) { case ALL: if (value == null) { unsetAll(); } else { setAll((Boolean)value); } break; case ROLES: if (value == null) { unsetRoles(); } else { setRoles((Set<String>)value); } break; } }
/** 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 ALL: return isSetAll(); case ROLES: return isSetRoles(); } throw new IllegalStateException(); }
case 7: // ROLE_SET if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.roleSet = new TSentryActiveRoleSet(); struct.roleSet.read(iprot); struct.setRoleSetIsSet(true); } else {
public void validate() throws org.apache.thrift.TException { // check for required fields if (!isSetAll()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'all' is unset! Struct:" + toString()); } if (!isSetRoles()) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'roles' is unset! Struct:" + toString()); } // check for sub-struct validity }
if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { struct.all = iprot.readBool(); struct.setAllIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setRolesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
@Override public void read(org.apache.thrift.protocol.TProtocol prot, TSentryActiveRoleSet struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; struct.all = iprot.readBool(); struct.setAllIsSet(true); { org.apache.thrift.protocol.TSet _set77 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.roles = new HashSet<String>(2*_set77.size); String _elem78; for (int _i79 = 0; _i79 < _set77.size; ++_i79) { _elem78 = iprot.readString(); struct.roles.add(_elem78); } } struct.setRolesIsSet(true); } }
@Override public void clear() { setAllIsSet(false); this.all = false; this.roles = null; }
/** * Performs a deep copy on <i>other</i>. */ public TSentryActiveRoleSet(TSentryActiveRoleSet other) { __isset_bitfield = other.__isset_bitfield; this.all = other.all; if (other.isSetRoles()) { Set<String> __this__roles = new HashSet<String>(other.roles); this.roles = __this__roles; } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
case 5: // ROLE_SET if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.roleSet = new TSentryActiveRoleSet(); struct.roleSet.read(iprot); struct.setRoleSetIsSet(true); } else {
@Override public int compareTo(TSentryActiveRoleSet other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetAll()).compareTo(other.isSetAll()); if (lastComparison != 0) { return lastComparison; } if (isSetAll()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.all, other.all); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetRoles()).compareTo(other.isSetRoles()); if (lastComparison != 0) { return lastComparison; } if (isSetRoles()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roles, other.roles); if (lastComparison != 0) { return lastComparison; } } return 0; }
public void setAll(boolean all) { this.all = all; setAllIsSet(true); }
public boolean equals(TSentryActiveRoleSet that) { if (that == null) return false; boolean this_present_all = true; boolean that_present_all = true; if (this_present_all || that_present_all) { if (!(this_present_all && that_present_all)) return false; if (this.all != that.all) return false; } boolean this_present_roles = true && this.isSetRoles(); boolean that_present_roles = true && that.isSetRoles(); if (this_present_roles || that_present_roles) { if (!(this_present_roles && that_present_roles)) return false; if (!this.roles.equals(that.roles)) return false; } return true; }
@Override public Response<Set<String>> handle() throws Exception { validateClientVersion(request.getProtocol_version()); Set<String> activeRoleNames = toTrimmedLower(request.getRoleSet().getRoles()); Set<String> roleNamesForGroups = store.getRolesByGroups(request.getComponent(), request.getGroups()); Set<String> rolesToQuery = request.getRoleSet().isAll() ? roleNamesForGroups : Sets.intersection(activeRoleNames, roleNamesForGroups); Set<PrivilegeObject> privileges = store.getPrivilegesByProvider(request.getComponent(), request.getServiceName(), rolesToQuery, null, toAuthorizables(request.getAuthorizables())); return new Response<Set<String>>(Status.OK(), buildPermissions(privileges)); } });
struct.roleSet = new TSentryActiveRoleSet(); struct.roleSet.read(iprot); struct.setRoleSetIsSet(true); BitSet incoming = iprot.readBitSet(1);
/** * 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.isSetComponent()) { this.component = other.component; } if (other.isSetServiceName()) { this.serviceName = other.serviceName; } 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.isSetAuthorizables()) { List<TAuthorizable> __this__authorizables = new ArrayList<TAuthorizable>(other.authorizables.size()); for (TAuthorizable other_element : other.authorizables) { __this__authorizables.add(new TAuthorizable(other_element)); } this.authorizables = __this__authorizables; } }
public TSentryActiveRoleSet( boolean all, Set<String> roles) { this(); this.all = all; setAllIsSet(true); this.roles = roles; }