case 2: // CODE if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.code = org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode.findByValue(iprot.readI32()); struct.setCodeIsSet(true); } else {
public void write(org.apache.thrift.protocol.TProtocol oprot, ThriftSecurityException struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.user != null) { oprot.writeFieldBegin(USER_FIELD_DESC); oprot.writeString(struct.user); oprot.writeFieldEnd(); } if (struct.code != null) { oprot.writeFieldBegin(CODE_FIELD_DESC); oprot.writeI32(struct.code.getValue()); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
/** * @return the specific reason for this exception * @since 1.5.0 */ public org.apache.accumulo.core.client.security.SecurityErrorCode getSecurityErrorCode() { return org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(errorCode.name()); }
} catch (AccumuloSecurityException e) { updateAuthorizationFailures(Collections.singletonMap(new KeyExtent(tableId, null, null), SecurityErrorCode.valueOf(e.getSecurityErrorCode().name()))); } catch (TableDeletedException | TableNotFoundException | TableOfflineException e) { updateUnknownErrors(e.getMessage(), e);
public boolean equals(ThriftSecurityException that) { if (that == null) return false; if (this == that) return true; boolean this_present_user = true && this.isSetUser(); boolean that_present_user = true && that.isSetUser(); if (this_present_user || that_present_user) { if (!(this_present_user && that_present_user)) return false; if (!this.user.equals(that.user)) return false; } boolean this_present_code = true && this.isSetCode(); boolean that_present_code = true && that.isSetCode(); if (this_present_code || that_present_code) { if (!(this_present_code && that_present_code)) return false; if (!this.code.equals(that.code)) return false; } return true; }
/** * If this method throws an exception, then its possible the mutation is still being actively * processed. Therefore if code chooses to continue after seeing an exception it should take * this into consideration. * * @return status of a conditional mutation */ public Status getStatus() throws AccumuloException, AccumuloSecurityException { if (status == null) { if (exception instanceof AccumuloException) throw new AccumuloException(exception); if (exception instanceof AccumuloSecurityException) { AccumuloSecurityException ase = (AccumuloSecurityException) exception; throw new AccumuloSecurityException(ase.getUser(), SecurityErrorCode.valueOf(ase.getSecurityErrorCode().name()), ase.getTableInfo(), ase); } else throw new AccumuloException(exception); } return status; }
@Override public int hashCode() { int hashCode = 1; hashCode = hashCode * 8191 + ((isSetUser()) ? 131071 : 524287); if (isSetUser()) hashCode = hashCode * 8191 + user.hashCode(); hashCode = hashCode * 8191 + ((isSetCode()) ? 131071 : 524287); if (isSetCode()) hashCode = hashCode * 8191 + code.getValue(); return hashCode; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, ThriftSecurityException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.user = iprot.readString(); struct.setUserIsSet(true); } if (incoming.get(1)) { struct.code = org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode.findByValue(iprot.readI32()); struct.setCodeIsSet(true); } } }
private void checkForFailures() throws MutationsRejectedException { if (somethingFailed) { List<ConstraintViolationSummary> cvsList = violations.asList(); HashMap<TabletId,Set<org.apache.accumulo.core.client.security.SecurityErrorCode>> af = new HashMap<>(); for (Entry<KeyExtent,Set<SecurityErrorCode>> entry : authorizationFailures.entrySet()) { HashSet<org.apache.accumulo.core.client.security.SecurityErrorCode> codes = new HashSet<>(); for (SecurityErrorCode sce : entry.getValue()) { codes.add(org.apache.accumulo.core.client.security.SecurityErrorCode.valueOf(sce.name())); } af.put(new TabletIdImpl(entry.getKey()), codes); } throw new MutationsRejectedException(context, cvsList, af, serverSideErrors, unknownErrors, lastUnknownError); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, ThriftSecurityException struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot; java.util.BitSet optionals = new java.util.BitSet(); if (struct.isSetUser()) { optionals.set(0); } if (struct.isSetCode()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetUser()) { oprot.writeString(struct.user); } if (struct.isSetCode()) { oprot.writeI32(struct.code.getValue()); } }
_val67 = org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode.findByValue(iprot.readI32()); struct.authorizationFailures.put(_key66, _val67);
oprot.writeI32(_iter71.getValue().getValue());
_val84 = org.apache.accumulo.core.clientImpl.thrift.SecurityErrorCode.findByValue(iprot.readI32()); struct.authorizationFailures.put(_key83, _val84);
oprot.writeI32(_iter74.getValue().getValue());