public TAuthzUpdateResponse deepCopy() { return new TAuthzUpdateResponse(this); }
public Object getFieldValue(_Fields field) { switch (field) { case AUTHZ_PATH_UPDATE: return getAuthzPathUpdate(); case AUTHZ_PERM_UPDATE: return getAuthzPermUpdate(); } throw new IllegalStateException(); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case AUTHZ_PATH_UPDATE: if (value == null) { unsetAuthzPathUpdate(); } else { setAuthzPathUpdate((List<TPathsUpdate>)value); } break; case AUTHZ_PERM_UPDATE: if (value == null) { unsetAuthzPermUpdate(); } else { setAuthzPermUpdate((List<TPermissionsUpdate>)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 AUTHZ_PATH_UPDATE: return isSetAuthzPathUpdate(); case AUTHZ_PERM_UPDATE: return isSetAuthzPermUpdate(); } throw new IllegalStateException(); }
@Override public TAuthzUpdateResponse get_all_authz_updates_from(long permSeqNum, long pathSeqNum) throws TException { TAuthzUpdateResponse retVal = new TAuthzUpdateResponse(); retVal.setAuthzPathUpdate(new LinkedList<TPathsUpdate>()); retVal.setAuthzPermUpdate(new LinkedList<TPermissionsUpdate>()); if (SentryPlugin.instance != null) { if (SentryPlugin.instance.isOutOfSync()) { LOGGER.debug("### Sending PATH preUpdate [" + update.toThrift() + "] ###"); retVal.getAuthzPathUpdate().add(update.toThrift()); LOGGER.debug("### Sending PERM preUpdate [" + update.toThrift() + "] ###"); retVal.getAuthzPermUpdate().add(update.toThrift());
@Override public void read(org.apache.thrift.protocol.TProtocol prot, get_all_authz_updates_from_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.success = new TAuthzUpdateResponse(); struct.success.read(iprot); struct.setSuccessIsSet(true); } } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TAuthzUpdateResponse struct) throws org.apache.thrift.TException { struct.validate(); if (struct.isSetAuthzPathUpdate()) { oprot.writeFieldBegin(AUTHZ_PATH_UPDATE_FIELD_DESC); if (struct.isSetAuthzPermUpdate()) { oprot.writeFieldBegin(AUTHZ_PERM_UPDATE_FIELD_DESC);
struct.setAuthzPathUpdateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.setAuthzPermUpdateIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); struct.validate();
struct.setAuthzPathUpdateIsSet(true); struct.setAuthzPermUpdateIsSet(true);
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof TAuthzUpdateResponse) return this.equals((TAuthzUpdateResponse)that); return false; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { 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); } }
public boolean equals(TAuthzUpdateResponse that) { if (that == null) return false; boolean this_present_authzPathUpdate = true && this.isSetAuthzPathUpdate(); boolean that_present_authzPathUpdate = true && that.isSetAuthzPathUpdate(); if (this_present_authzPathUpdate || that_present_authzPathUpdate) { if (!(this_present_authzPathUpdate && that_present_authzPathUpdate)) return false; if (!this.authzPathUpdate.equals(that.authzPathUpdate)) return false; } boolean this_present_authzPermUpdate = true && this.isSetAuthzPermUpdate(); boolean that_present_authzPermUpdate = true && that.isSetAuthzPermUpdate(); if (this_present_authzPermUpdate || that_present_authzPermUpdate) { if (!(this_present_authzPermUpdate && that_present_authzPermUpdate)) return false; if (!this.authzPermUpdate.equals(that.authzPermUpdate)) return false; } return true; }
public void read(org.apache.thrift.protocol.TProtocol iprot, get_all_authz_updates_from_result 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 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.success = new TAuthzUpdateResponse(); struct.success.read(iprot); struct.setSuccessIsSet(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(get_all_authz_updates_from_result that) { if (that == null) return false; boolean this_present_success = true && this.isSetSuccess(); boolean that_present_success = true && that.isSetSuccess(); if (this_present_success || that_present_success) { if (!(this_present_success && that_present_success)) return false; if (!this.success.equals(that.success)) return false; } return true; }
public synchronized SentryAuthzUpdate getAllUpdatesFrom(long permSeqNum, long pathSeqNum) throws SentryHdfsServiceException { SentryAuthzUpdate retVal = new SentryAuthzUpdate(new LinkedList<PermissionsUpdate>(), new LinkedList<PathsUpdate>()); try { TAuthzUpdateResponse sentryUpdates = client.get_all_authz_updates_from(permSeqNum, pathSeqNum); if (sentryUpdates.getAuthzPathUpdate() != null) { for (TPathsUpdate pathsUpdate : sentryUpdates.getAuthzPathUpdate()) { retVal.getPathUpdates().add(new PathsUpdate(pathsUpdate)); } } if (sentryUpdates.getAuthzPermUpdate() != null) { for (TPermissionsUpdate permsUpdate : sentryUpdates.getAuthzPermUpdate()) { retVal.getPermUpdates().add(new PermissionsUpdate(permsUpdate)); } } } catch (Exception e) { throw new SentryHdfsServiceException("Thrift Exception occurred !!", e); } return retVal; }
@Override public int hashCode() { HashCodeBuilder builder = new HashCodeBuilder(); boolean present_authzPathUpdate = true && (isSetAuthzPathUpdate()); builder.append(present_authzPathUpdate); if (present_authzPathUpdate) builder.append(authzPathUpdate); boolean present_authzPermUpdate = true && (isSetAuthzPermUpdate()); builder.append(present_authzPermUpdate); if (present_authzPermUpdate) builder.append(authzPermUpdate); return builder.toHashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public get_all_authz_updates_from_result(get_all_authz_updates_from_result other) { if (other.isSetSuccess()) { this.success = new TAuthzUpdateResponse(other.success); } }
public int compareTo(TAuthzUpdateResponse other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; TAuthzUpdateResponse typedOther = (TAuthzUpdateResponse)other; lastComparison = Boolean.valueOf(isSetAuthzPathUpdate()).compareTo(typedOther.isSetAuthzPathUpdate()); if (lastComparison != 0) { return lastComparison; } if (isSetAuthzPathUpdate()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzPathUpdate, typedOther.authzPathUpdate); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAuthzPermUpdate()).compareTo(typedOther.isSetAuthzPermUpdate()); if (lastComparison != 0) { return lastComparison; } if (isSetAuthzPermUpdate()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzPermUpdate, typedOther.authzPermUpdate); if (lastComparison != 0) { return lastComparison; } } return 0; }
@Override public String toString() { StringBuilder sb = new StringBuilder("TAuthzUpdateResponse("); boolean first = true; if (isSetAuthzPathUpdate()) { sb.append("authzPathUpdate:"); if (this.authzPathUpdate == null) { sb.append("null"); } else { sb.append(this.authzPathUpdate); } first = false; } if (isSetAuthzPermUpdate()) { if (!first) sb.append(", "); sb.append("authzPermUpdate:"); if (this.authzPermUpdate == null) { sb.append("null"); } else { sb.append(this.authzPermUpdate); } first = false; } sb.append(")"); return sb.toString(); }
/** * Performs a deep copy on <i>other</i>. */ public TAuthzUpdateResponse(TAuthzUpdateResponse other) { if (other.isSetAuthzPathUpdate()) { List<TPathsUpdate> __this__authzPathUpdate = new ArrayList<TPathsUpdate>(); for (TPathsUpdate other_element : other.authzPathUpdate) { __this__authzPathUpdate.add(new TPathsUpdate(other_element)); } this.authzPathUpdate = __this__authzPathUpdate; } if (other.isSetAuthzPermUpdate()) { List<TPermissionsUpdate> __this__authzPermUpdate = new ArrayList<TPermissionsUpdate>(); for (TPermissionsUpdate other_element : other.authzPermUpdate) { __this__authzPermUpdate.add(new TPermissionsUpdate(other_element)); } this.authzPermUpdate = __this__authzPermUpdate; } }