public Set<JsonLogEntity> createJsonLogEntities( TAlterSentryRoleRevokePrivilegeRequest request, TAlterSentryRoleRevokePrivilegeResponse response, Configuration conf) { ImmutableSet.Builder<JsonLogEntity> setBuilder = ImmutableSet.builder(); if (request.isSetPrivileges()) { for (TSentryPrivilege privilege : request.getPrivileges()) { JsonLogEntity logEntity = createJsonLogEntity(request, privilege, response, conf); setBuilder.add(logEntity); } } return setBuilder.build(); }
if (isSetPrivileges()) { if (!first) sb.append(", "); sb.append("privileges:");
@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_requestorUserName = true && (isSetRequestorUserName()); list.add(present_requestorUserName); if (present_requestorUserName) list.add(requestorUserName); boolean present_roleName = true && (isSetRoleName()); list.add(present_roleName); if (present_roleName) list.add(roleName); boolean present_privilege = true && (isSetPrivilege()); list.add(present_privilege); if (present_privilege) list.add(privilege); boolean present_privileges = true && (isSetPrivileges()); list.add(present_privileges); if (present_privileges) list.add(privileges); return list.hashCode(); }
/** * Validates privileges in input request by making sure mandatory fields like * server name and action in the privileges are not empty and see all the values in the * request are valid. * * @param request to be validated. * @throws SentryInvalidInputException If all the mandatory fields in the privileges are * not present [OR] invalid fields a provided in request. */ public static void validate(TAlterSentryRoleRevokePrivilegeRequest request) throws SentryInvalidInputException { if (request.isSetPrivileges() && (!request.getPrivileges().isEmpty())) { GrantPrivilegeRequestValidator.checkForMandatoryFieldsInPrivileges(request.getPrivileges()); } } }
if (struct.isSetPrivileges()) { oprot.writeFieldBegin(PRIVILEGES_FIELD_DESC);
/** 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 REQUESTOR_USER_NAME: return isSetRequestorUserName(); case ROLE_NAME: return isSetRoleName(); case PRIVILEGE: return isSetPrivilege(); case PRIVILEGES: return isSetPrivileges(); } throw new IllegalStateException(); }
/** * Performs a deep copy on <i>other</i>. */ public TAlterSentryRoleRevokePrivilegeRequest(TAlterSentryRoleRevokePrivilegeRequest other) { __isset_bitfield = other.__isset_bitfield; this.protocol_version = other.protocol_version; if (other.isSetRequestorUserName()) { this.requestorUserName = other.requestorUserName; } if (other.isSetRoleName()) { this.roleName = other.roleName; } if (other.isSetPrivilege()) { this.privilege = new TSentryPrivilege(other.privilege); } if (other.isSetPrivileges()) { Set<TSentryPrivilege> __this__privileges = new HashSet<TSentryPrivilege>(other.privileges.size()); for (TSentryPrivilege other_element : other.privileges) { __this__privileges.add(new TSentryPrivilege(other_element)); } this.privileges = __this__privileges; } }
lastComparison = Boolean.valueOf(isSetPrivileges()).compareTo(other.isSetPrivileges()); if (lastComparison != 0) { return lastComparison; if (isSetPrivileges()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.privileges, other.privileges); if (lastComparison != 0) {
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TAlterSentryRoleRevokePrivilegeRequest struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; oprot.writeI32(struct.protocol_version); oprot.writeString(struct.requestorUserName); oprot.writeString(struct.roleName); BitSet optionals = new BitSet(); if (struct.isSetPrivilege()) { optionals.set(0); } if (struct.isSetPrivileges()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetPrivilege()) { struct.privilege.write(oprot); } if (struct.isSetPrivileges()) { { oprot.writeI32(struct.privileges.size()); for (TSentryPrivilege _iter52 : struct.privileges) { _iter52.write(oprot); } } } }
boolean this_present_privileges = true && this.isSetPrivileges(); boolean that_present_privileges = true && that.isSetPrivileges(); if (this_present_privileges || that_present_privileges) { if (!(this_present_privileges && that_present_privileges))
validateClientVersion(request.getProtocol_version()); if ( !(request.isSetPrivileges()^request.isSetPrivilege()) ) { throw new SentryUserException("SENTRY API version is not right!");