http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/b86a53d1/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java ---------------------------------------------------------------------- diff --git a/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java new file mode 100644 index 0000000..480c264 --- /dev/null +++ b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TAuthzUpdateResponse.java @@ -0,0 +1,603 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.hdfs.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TAuthzUpdateResponse implements org.apache.thrift.TBase<TAuthzUpdateResponse, TAuthzUpdateResponse._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TAuthzUpdateResponse"); + + private static final org.apache.thrift.protocol.TField AUTHZ_PATH_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("authzPathUpdate", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField AUTHZ_PERM_UPDATE_FIELD_DESC = new org.apache.thrift.protocol.TField("authzPermUpdate", org.apache.thrift.protocol.TType.LIST, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TAuthzUpdateResponseStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TAuthzUpdateResponseTupleSchemeFactory()); + } + + private List<TPathsUpdate> authzPathUpdate; // optional + private List<TPermissionsUpdate> authzPermUpdate; // optional + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AUTHZ_PATH_UPDATE((short)1, "authzPathUpdate"), + AUTHZ_PERM_UPDATE((short)2, "authzPermUpdate"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // AUTHZ_PATH_UPDATE + return AUTHZ_PATH_UPDATE; + case 2: // AUTHZ_PERM_UPDATE + return AUTHZ_PERM_UPDATE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private _Fields optionals[] = {_Fields.AUTHZ_PATH_UPDATE,_Fields.AUTHZ_PERM_UPDATE}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.AUTHZ_PATH_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("authzPathUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPathsUpdate.class)))); + tmpMap.put(_Fields.AUTHZ_PERM_UPDATE, new org.apache.thrift.meta_data.FieldMetaData("authzPermUpdate", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TPermissionsUpdate.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TAuthzUpdateResponse.class, metaDataMap); + } + + public TAuthzUpdateResponse() { + } + + /** + * 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; + } + } + + public TAuthzUpdateResponse deepCopy() { + return new TAuthzUpdateResponse(this); + } + + @Override + public void clear() { + this.authzPathUpdate = null; + this.authzPermUpdate = null; + } + + public int getAuthzPathUpdateSize() { + return (this.authzPathUpdate == null) ? 0 : this.authzPathUpdate.size(); + } + + public java.util.Iterator<TPathsUpdate> getAuthzPathUpdateIterator() { + return (this.authzPathUpdate == null) ? null : this.authzPathUpdate.iterator(); + } + + public void addToAuthzPathUpdate(TPathsUpdate elem) { + if (this.authzPathUpdate == null) { + this.authzPathUpdate = new ArrayList<TPathsUpdate>(); + } + this.authzPathUpdate.add(elem); + } + + public List<TPathsUpdate> getAuthzPathUpdate() { + return this.authzPathUpdate; + } + + public void setAuthzPathUpdate(List<TPathsUpdate> authzPathUpdate) { + this.authzPathUpdate = authzPathUpdate; + } + + public void unsetAuthzPathUpdate() { + this.authzPathUpdate = null; + } + + /** Returns true if field authzPathUpdate is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthzPathUpdate() { + return this.authzPathUpdate != null; + } + + public void setAuthzPathUpdateIsSet(boolean value) { + if (!value) { + this.authzPathUpdate = null; + } + } + + public int getAuthzPermUpdateSize() { + return (this.authzPermUpdate == null) ? 0 : this.authzPermUpdate.size(); + } + + public java.util.Iterator<TPermissionsUpdate> getAuthzPermUpdateIterator() { + return (this.authzPermUpdate == null) ? null : this.authzPermUpdate.iterator(); + } + + public void addToAuthzPermUpdate(TPermissionsUpdate elem) { + if (this.authzPermUpdate == null) { + this.authzPermUpdate = new ArrayList<TPermissionsUpdate>(); + } + this.authzPermUpdate.add(elem); + } + + public List<TPermissionsUpdate> getAuthzPermUpdate() { + return this.authzPermUpdate; + } + + public void setAuthzPermUpdate(List<TPermissionsUpdate> authzPermUpdate) { + this.authzPermUpdate = authzPermUpdate; + } + + public void unsetAuthzPermUpdate() { + this.authzPermUpdate = null; + } + + /** Returns true if field authzPermUpdate is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthzPermUpdate() { + return this.authzPermUpdate != null; + } + + public void setAuthzPermUpdateIsSet(boolean value) { + if (!value) { + this.authzPermUpdate = null; + } + } + + 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; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTHZ_PATH_UPDATE: + return getAuthzPathUpdate(); + + case AUTHZ_PERM_UPDATE: + return getAuthzPermUpdate(); + + } + throw new IllegalStateException(); + } + + /** 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 boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TAuthzUpdateResponse) + return this.equals((TAuthzUpdateResponse)that); + return false; + } + + 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; + } + + @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(); + } + + 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; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @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(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + } + } + + private static class TAuthzUpdateResponseStandardSchemeFactory implements SchemeFactory { + public TAuthzUpdateResponseStandardScheme getScheme() { + return new TAuthzUpdateResponseStandardScheme(); + } + } + + private static class TAuthzUpdateResponseStandardScheme extends StandardScheme<TAuthzUpdateResponse> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TAuthzUpdateResponse 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: // AUTHZ_PATH_UPDATE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list114 = iprot.readListBegin(); + struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list114.size); + for (int _i115 = 0; _i115 < _list114.size; ++_i115) + { + TPathsUpdate _elem116; // required + _elem116 = new TPathsUpdate(); + _elem116.read(iprot); + struct.authzPathUpdate.add(_elem116); + } + iprot.readListEnd(); + } + struct.setAuthzPathUpdateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // AUTHZ_PERM_UPDATE + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list117 = iprot.readListBegin(); + struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list117.size); + for (int _i118 = 0; _i118 < _list117.size; ++_i118) + { + TPermissionsUpdate _elem119; // required + _elem119 = new TPermissionsUpdate(); + _elem119.read(iprot); + struct.authzPermUpdate.add(_elem119); + } + iprot.readListEnd(); + } + struct.setAuthzPermUpdateIsSet(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 void write(org.apache.thrift.protocol.TProtocol oprot, TAuthzUpdateResponse struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.authzPathUpdate != null) { + if (struct.isSetAuthzPathUpdate()) { + oprot.writeFieldBegin(AUTHZ_PATH_UPDATE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authzPathUpdate.size())); + for (TPathsUpdate _iter120 : struct.authzPathUpdate) + { + _iter120.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.authzPermUpdate != null) { + if (struct.isSetAuthzPermUpdate()) { + oprot.writeFieldBegin(AUTHZ_PERM_UPDATE_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.authzPermUpdate.size())); + for (TPermissionsUpdate _iter121 : struct.authzPermUpdate) + { + _iter121.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TAuthzUpdateResponseTupleSchemeFactory implements SchemeFactory { + public TAuthzUpdateResponseTupleScheme getScheme() { + return new TAuthzUpdateResponseTupleScheme(); + } + } + + private static class TAuthzUpdateResponseTupleScheme extends TupleScheme<TAuthzUpdateResponse> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TAuthzUpdateResponse struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAuthzPathUpdate()) { + optionals.set(0); + } + if (struct.isSetAuthzPermUpdate()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetAuthzPathUpdate()) { + { + oprot.writeI32(struct.authzPathUpdate.size()); + for (TPathsUpdate _iter122 : struct.authzPathUpdate) + { + _iter122.write(oprot); + } + } + } + if (struct.isSetAuthzPermUpdate()) { + { + oprot.writeI32(struct.authzPermUpdate.size()); + for (TPermissionsUpdate _iter123 : struct.authzPermUpdate) + { + _iter123.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TAuthzUpdateResponse struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list124 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.authzPathUpdate = new ArrayList<TPathsUpdate>(_list124.size); + for (int _i125 = 0; _i125 < _list124.size; ++_i125) + { + TPathsUpdate _elem126; // required + _elem126 = new TPathsUpdate(); + _elem126.read(iprot); + struct.authzPathUpdate.add(_elem126); + } + } + struct.setAuthzPathUpdateIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list127 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.authzPermUpdate = new ArrayList<TPermissionsUpdate>(_list127.size); + for (int _i128 = 0; _i128 < _list127.size; ++_i128) + { + TPermissionsUpdate _elem129; // required + _elem129 = new TPermissionsUpdate(); + _elem129.read(iprot); + struct.authzPermUpdate.add(_elem129); + } + } + struct.setAuthzPermUpdateIsSet(true); + } + } + } + +} +
http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/b86a53d1/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java ---------------------------------------------------------------------- diff --git a/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java new file mode 100644 index 0000000..85254d7 --- /dev/null +++ b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathChanges.java @@ -0,0 +1,765 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.hdfs.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TPathChanges implements org.apache.thrift.TBase<TPathChanges, TPathChanges._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathChanges"); + + private static final org.apache.thrift.protocol.TField AUTHZ_OBJ_FIELD_DESC = new org.apache.thrift.protocol.TField("authzObj", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField ADD_PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("addPaths", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField DEL_PATHS_FIELD_DESC = new org.apache.thrift.protocol.TField("delPaths", org.apache.thrift.protocol.TType.LIST, (short)3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathChangesStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathChangesTupleSchemeFactory()); + } + + private String authzObj; // required + private List<List<String>> addPaths; // required + private List<List<String>> delPaths; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + AUTHZ_OBJ((short)1, "authzObj"), + ADD_PATHS((short)2, "addPaths"), + DEL_PATHS((short)3, "delPaths"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // AUTHZ_OBJ + return AUTHZ_OBJ; + case 2: // ADD_PATHS + return ADD_PATHS; + case 3: // DEL_PATHS + return DEL_PATHS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.AUTHZ_OBJ, new org.apache.thrift.meta_data.FieldMetaData("authzObj", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.ADD_PATHS, new org.apache.thrift.meta_data.FieldMetaData("addPaths", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + tmpMap.put(_Fields.DEL_PATHS, new org.apache.thrift.meta_data.FieldMetaData("delPaths", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathChanges.class, metaDataMap); + } + + public TPathChanges() { + } + + public TPathChanges( + String authzObj, + List<List<String>> addPaths, + List<List<String>> delPaths) + { + this(); + this.authzObj = authzObj; + this.addPaths = addPaths; + this.delPaths = delPaths; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public TPathChanges(TPathChanges other) { + if (other.isSetAuthzObj()) { + this.authzObj = other.authzObj; + } + if (other.isSetAddPaths()) { + List<List<String>> __this__addPaths = new ArrayList<List<String>>(); + for (List<String> other_element : other.addPaths) { + List<String> __this__addPaths_copy = new ArrayList<String>(); + for (String other_element_element : other_element) { + __this__addPaths_copy.add(other_element_element); + } + __this__addPaths.add(__this__addPaths_copy); + } + this.addPaths = __this__addPaths; + } + if (other.isSetDelPaths()) { + List<List<String>> __this__delPaths = new ArrayList<List<String>>(); + for (List<String> other_element : other.delPaths) { + List<String> __this__delPaths_copy = new ArrayList<String>(); + for (String other_element_element : other_element) { + __this__delPaths_copy.add(other_element_element); + } + __this__delPaths.add(__this__delPaths_copy); + } + this.delPaths = __this__delPaths; + } + } + + public TPathChanges deepCopy() { + return new TPathChanges(this); + } + + @Override + public void clear() { + this.authzObj = null; + this.addPaths = null; + this.delPaths = null; + } + + public String getAuthzObj() { + return this.authzObj; + } + + public void setAuthzObj(String authzObj) { + this.authzObj = authzObj; + } + + public void unsetAuthzObj() { + this.authzObj = null; + } + + /** Returns true if field authzObj is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthzObj() { + return this.authzObj != null; + } + + public void setAuthzObjIsSet(boolean value) { + if (!value) { + this.authzObj = null; + } + } + + public int getAddPathsSize() { + return (this.addPaths == null) ? 0 : this.addPaths.size(); + } + + public java.util.Iterator<List<String>> getAddPathsIterator() { + return (this.addPaths == null) ? null : this.addPaths.iterator(); + } + + public void addToAddPaths(List<String> elem) { + if (this.addPaths == null) { + this.addPaths = new ArrayList<List<String>>(); + } + this.addPaths.add(elem); + } + + public List<List<String>> getAddPaths() { + return this.addPaths; + } + + public void setAddPaths(List<List<String>> addPaths) { + this.addPaths = addPaths; + } + + public void unsetAddPaths() { + this.addPaths = null; + } + + /** Returns true if field addPaths is set (has been assigned a value) and false otherwise */ + public boolean isSetAddPaths() { + return this.addPaths != null; + } + + public void setAddPathsIsSet(boolean value) { + if (!value) { + this.addPaths = null; + } + } + + public int getDelPathsSize() { + return (this.delPaths == null) ? 0 : this.delPaths.size(); + } + + public java.util.Iterator<List<String>> getDelPathsIterator() { + return (this.delPaths == null) ? null : this.delPaths.iterator(); + } + + public void addToDelPaths(List<String> elem) { + if (this.delPaths == null) { + this.delPaths = new ArrayList<List<String>>(); + } + this.delPaths.add(elem); + } + + public List<List<String>> getDelPaths() { + return this.delPaths; + } + + public void setDelPaths(List<List<String>> delPaths) { + this.delPaths = delPaths; + } + + public void unsetDelPaths() { + this.delPaths = null; + } + + /** Returns true if field delPaths is set (has been assigned a value) and false otherwise */ + public boolean isSetDelPaths() { + return this.delPaths != null; + } + + public void setDelPathsIsSet(boolean value) { + if (!value) { + this.delPaths = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case AUTHZ_OBJ: + if (value == null) { + unsetAuthzObj(); + } else { + setAuthzObj((String)value); + } + break; + + case ADD_PATHS: + if (value == null) { + unsetAddPaths(); + } else { + setAddPaths((List<List<String>>)value); + } + break; + + case DEL_PATHS: + if (value == null) { + unsetDelPaths(); + } else { + setDelPaths((List<List<String>>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTHZ_OBJ: + return getAuthzObj(); + + case ADD_PATHS: + return getAddPaths(); + + case DEL_PATHS: + return getDelPaths(); + + } + throw new IllegalStateException(); + } + + /** 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_OBJ: + return isSetAuthzObj(); + case ADD_PATHS: + return isSetAddPaths(); + case DEL_PATHS: + return isSetDelPaths(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathChanges) + return this.equals((TPathChanges)that); + return false; + } + + public boolean equals(TPathChanges that) { + if (that == null) + return false; + + boolean this_present_authzObj = true && this.isSetAuthzObj(); + boolean that_present_authzObj = true && that.isSetAuthzObj(); + if (this_present_authzObj || that_present_authzObj) { + if (!(this_present_authzObj && that_present_authzObj)) + return false; + if (!this.authzObj.equals(that.authzObj)) + return false; + } + + boolean this_present_addPaths = true && this.isSetAddPaths(); + boolean that_present_addPaths = true && that.isSetAddPaths(); + if (this_present_addPaths || that_present_addPaths) { + if (!(this_present_addPaths && that_present_addPaths)) + return false; + if (!this.addPaths.equals(that.addPaths)) + return false; + } + + boolean this_present_delPaths = true && this.isSetDelPaths(); + boolean that_present_delPaths = true && that.isSetDelPaths(); + if (this_present_delPaths || that_present_delPaths) { + if (!(this_present_delPaths && that_present_delPaths)) + return false; + if (!this.delPaths.equals(that.delPaths)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_authzObj = true && (isSetAuthzObj()); + builder.append(present_authzObj); + if (present_authzObj) + builder.append(authzObj); + + boolean present_addPaths = true && (isSetAddPaths()); + builder.append(present_addPaths); + if (present_addPaths) + builder.append(addPaths); + + boolean present_delPaths = true && (isSetDelPaths()); + builder.append(present_delPaths); + if (present_delPaths) + builder.append(delPaths); + + return builder.toHashCode(); + } + + public int compareTo(TPathChanges other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathChanges typedOther = (TPathChanges)other; + + lastComparison = Boolean.valueOf(isSetAuthzObj()).compareTo(typedOther.isSetAuthzObj()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthzObj()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzObj, typedOther.authzObj); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAddPaths()).compareTo(typedOther.isSetAddPaths()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAddPaths()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.addPaths, typedOther.addPaths); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDelPaths()).compareTo(typedOther.isSetDelPaths()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDelPaths()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.delPaths, typedOther.delPaths); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TPathChanges("); + boolean first = true; + + sb.append("authzObj:"); + if (this.authzObj == null) { + sb.append("null"); + } else { + sb.append(this.authzObj); + } + first = false; + if (!first) sb.append(", "); + sb.append("addPaths:"); + if (this.addPaths == null) { + sb.append("null"); + } else { + sb.append(this.addPaths); + } + first = false; + if (!first) sb.append(", "); + sb.append("delPaths:"); + if (this.delPaths == null) { + sb.append("null"); + } else { + sb.append(this.delPaths); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetAuthzObj()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'authzObj' is unset! Struct:" + toString()); + } + + if (!isSetAddPaths()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'addPaths' is unset! Struct:" + toString()); + } + + if (!isSetDelPaths()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'delPaths' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + } + } + + private static class TPathChangesStandardSchemeFactory implements SchemeFactory { + public TPathChangesStandardScheme getScheme() { + return new TPathChangesStandardScheme(); + } + } + + private static class TPathChangesStandardScheme extends StandardScheme<TPathChanges> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathChanges 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: // AUTHZ_OBJ + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ADD_PATHS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.addPaths = new ArrayList<List<String>>(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + List<String> _elem2; // required + { + org.apache.thrift.protocol.TList _list3 = iprot.readListBegin(); + _elem2 = new ArrayList<String>(_list3.size); + for (int _i4 = 0; _i4 < _list3.size; ++_i4) + { + String _elem5; // required + _elem5 = iprot.readString(); + _elem2.add(_elem5); + } + iprot.readListEnd(); + } + struct.addPaths.add(_elem2); + } + iprot.readListEnd(); + } + struct.setAddPathsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // DEL_PATHS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list6 = iprot.readListBegin(); + struct.delPaths = new ArrayList<List<String>>(_list6.size); + for (int _i7 = 0; _i7 < _list6.size; ++_i7) + { + List<String> _elem8; // required + { + org.apache.thrift.protocol.TList _list9 = iprot.readListBegin(); + _elem8 = new ArrayList<String>(_list9.size); + for (int _i10 = 0; _i10 < _list9.size; ++_i10) + { + String _elem11; // required + _elem11 = iprot.readString(); + _elem8.add(_elem11); + } + iprot.readListEnd(); + } + struct.delPaths.add(_elem8); + } + iprot.readListEnd(); + } + struct.setDelPathsIsSet(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 void write(org.apache.thrift.protocol.TProtocol oprot, TPathChanges struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.authzObj != null) { + oprot.writeFieldBegin(AUTHZ_OBJ_FIELD_DESC); + oprot.writeString(struct.authzObj); + oprot.writeFieldEnd(); + } + if (struct.addPaths != null) { + oprot.writeFieldBegin(ADD_PATHS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.addPaths.size())); + for (List<String> _iter12 : struct.addPaths) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter12.size())); + for (String _iter13 : _iter12) + { + oprot.writeString(_iter13); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.delPaths != null) { + oprot.writeFieldBegin(DEL_PATHS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, struct.delPaths.size())); + for (List<String> _iter14 : struct.delPaths) + { + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, _iter14.size())); + for (String _iter15 : _iter14) + { + oprot.writeString(_iter15); + } + oprot.writeListEnd(); + } + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathChangesTupleSchemeFactory implements SchemeFactory { + public TPathChangesTupleScheme getScheme() { + return new TPathChangesTupleScheme(); + } + } + + private static class TPathChangesTupleScheme extends TupleScheme<TPathChanges> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathChanges struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeString(struct.authzObj); + { + oprot.writeI32(struct.addPaths.size()); + for (List<String> _iter16 : struct.addPaths) + { + { + oprot.writeI32(_iter16.size()); + for (String _iter17 : _iter16) + { + oprot.writeString(_iter17); + } + } + } + } + { + oprot.writeI32(struct.delPaths.size()); + for (List<String> _iter18 : struct.delPaths) + { + { + oprot.writeI32(_iter18.size()); + for (String _iter19 : _iter18) + { + oprot.writeString(_iter19); + } + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathChanges struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + { + org.apache.thrift.protocol.TList _list20 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.addPaths = new ArrayList<List<String>>(_list20.size); + for (int _i21 = 0; _i21 < _list20.size; ++_i21) + { + List<String> _elem22; // required + { + org.apache.thrift.protocol.TList _list23 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem22 = new ArrayList<String>(_list23.size); + for (int _i24 = 0; _i24 < _list23.size; ++_i24) + { + String _elem25; // required + _elem25 = iprot.readString(); + _elem22.add(_elem25); + } + } + struct.addPaths.add(_elem22); + } + } + struct.setAddPathsIsSet(true); + { + org.apache.thrift.protocol.TList _list26 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.LIST, iprot.readI32()); + struct.delPaths = new ArrayList<List<String>>(_list26.size); + for (int _i27 = 0; _i27 < _list26.size; ++_i27) + { + List<String> _elem28; // required + { + org.apache.thrift.protocol.TList _list29 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + _elem28 = new ArrayList<String>(_list29.size); + for (int _i30 = 0; _i30 < _list29.size; ++_i30) + { + String _elem31; // required + _elem31 = iprot.readString(); + _elem28.add(_elem31); + } + } + struct.delPaths.add(_elem28); + } + } + struct.setDelPathsIsSet(true); + } + } + +} + http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/b86a53d1/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java ---------------------------------------------------------------------- diff --git a/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java new file mode 100644 index 0000000..a2a7f7b --- /dev/null +++ b/sentry-hdfs/src/gen/thrift/gen-javabean/org/apache/sentry/hdfs/service/thrift/TPathEntry.java @@ -0,0 +1,747 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.apache.sentry.hdfs.service.thrift; + +import org.apache.commons.lang.builder.HashCodeBuilder; +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TPathEntry implements org.apache.thrift.TBase<TPathEntry, TPathEntry._Fields>, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TPathEntry"); + + private static final org.apache.thrift.protocol.TField TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("type", org.apache.thrift.protocol.TType.BYTE, (short)1); + private static final org.apache.thrift.protocol.TField PATH_ELEMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("pathElement", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField AUTHZ_OBJ_FIELD_DESC = new org.apache.thrift.protocol.TField("authzObj", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.SET, (short)4); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TPathEntryStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TPathEntryTupleSchemeFactory()); + } + + private byte type; // required + private String pathElement; // required + private String authzObj; // optional + private Set<Integer> children; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + TYPE((short)1, "type"), + PATH_ELEMENT((short)2, "pathElement"), + AUTHZ_OBJ((short)3, "authzObj"), + CHILDREN((short)4, "children"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // TYPE + return TYPE; + case 2: // PATH_ELEMENT + return PATH_ELEMENT; + case 3: // AUTHZ_OBJ + return AUTHZ_OBJ; + case 4: // CHILDREN + return CHILDREN; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + private static final int __TYPE_ISSET_ID = 0; + private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.AUTHZ_OBJ}; + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.TYPE, new org.apache.thrift.meta_data.FieldMetaData("type", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BYTE))); + tmpMap.put(_Fields.PATH_ELEMENT, new org.apache.thrift.meta_data.FieldMetaData("pathElement", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.AUTHZ_OBJ, new org.apache.thrift.meta_data.FieldMetaData("authzObj", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.REQUIRED, + new org.apache.thrift.meta_data.SetMetaData(org.apache.thrift.protocol.TType.SET, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TPathEntry.class, metaDataMap); + } + + public TPathEntry() { + } + + public TPathEntry( + byte type, + String pathElement, + Set<Integer> children) + { + this(); + this.type = type; + setTypeIsSet(true); + this.pathElement = pathElement; + this.children = children; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public TPathEntry(TPathEntry other) { + __isset_bitfield = other.__isset_bitfield; + this.type = other.type; + if (other.isSetPathElement()) { + this.pathElement = other.pathElement; + } + if (other.isSetAuthzObj()) { + this.authzObj = other.authzObj; + } + if (other.isSetChildren()) { + Set<Integer> __this__children = new HashSet<Integer>(); + for (Integer other_element : other.children) { + __this__children.add(other_element); + } + this.children = __this__children; + } + } + + public TPathEntry deepCopy() { + return new TPathEntry(this); + } + + @Override + public void clear() { + setTypeIsSet(false); + this.type = 0; + this.pathElement = null; + this.authzObj = null; + this.children = null; + } + + public byte getType() { + return this.type; + } + + public void setType(byte type) { + this.type = type; + setTypeIsSet(true); + } + + public void unsetType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TYPE_ISSET_ID); + } + + /** Returns true if field type is set (has been assigned a value) and false otherwise */ + public boolean isSetType() { + return EncodingUtils.testBit(__isset_bitfield, __TYPE_ISSET_ID); + } + + public void setTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TYPE_ISSET_ID, value); + } + + public String getPathElement() { + return this.pathElement; + } + + public void setPathElement(String pathElement) { + this.pathElement = pathElement; + } + + public void unsetPathElement() { + this.pathElement = null; + } + + /** Returns true if field pathElement is set (has been assigned a value) and false otherwise */ + public boolean isSetPathElement() { + return this.pathElement != null; + } + + public void setPathElementIsSet(boolean value) { + if (!value) { + this.pathElement = null; + } + } + + public String getAuthzObj() { + return this.authzObj; + } + + public void setAuthzObj(String authzObj) { + this.authzObj = authzObj; + } + + public void unsetAuthzObj() { + this.authzObj = null; + } + + /** Returns true if field authzObj is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthzObj() { + return this.authzObj != null; + } + + public void setAuthzObjIsSet(boolean value) { + if (!value) { + this.authzObj = null; + } + } + + public int getChildrenSize() { + return (this.children == null) ? 0 : this.children.size(); + } + + public java.util.Iterator<Integer> getChildrenIterator() { + return (this.children == null) ? null : this.children.iterator(); + } + + public void addToChildren(int elem) { + if (this.children == null) { + this.children = new HashSet<Integer>(); + } + this.children.add(elem); + } + + public Set<Integer> getChildren() { + return this.children; + } + + public void setChildren(Set<Integer> children) { + this.children = children; + } + + public void unsetChildren() { + this.children = null; + } + + /** Returns true if field children is set (has been assigned a value) and false otherwise */ + public boolean isSetChildren() { + return this.children != null; + } + + public void setChildrenIsSet(boolean value) { + if (!value) { + this.children = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case TYPE: + if (value == null) { + unsetType(); + } else { + setType((Byte)value); + } + break; + + case PATH_ELEMENT: + if (value == null) { + unsetPathElement(); + } else { + setPathElement((String)value); + } + break; + + case AUTHZ_OBJ: + if (value == null) { + unsetAuthzObj(); + } else { + setAuthzObj((String)value); + } + break; + + case CHILDREN: + if (value == null) { + unsetChildren(); + } else { + setChildren((Set<Integer>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case TYPE: + return Byte.valueOf(getType()); + + case PATH_ELEMENT: + return getPathElement(); + + case AUTHZ_OBJ: + return getAuthzObj(); + + case CHILDREN: + return getChildren(); + + } + throw new IllegalStateException(); + } + + /** 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 TYPE: + return isSetType(); + case PATH_ELEMENT: + return isSetPathElement(); + case AUTHZ_OBJ: + return isSetAuthzObj(); + case CHILDREN: + return isSetChildren(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TPathEntry) + return this.equals((TPathEntry)that); + return false; + } + + public boolean equals(TPathEntry that) { + if (that == null) + return false; + + boolean this_present_type = true; + boolean that_present_type = true; + if (this_present_type || that_present_type) { + if (!(this_present_type && that_present_type)) + return false; + if (this.type != that.type) + return false; + } + + boolean this_present_pathElement = true && this.isSetPathElement(); + boolean that_present_pathElement = true && that.isSetPathElement(); + if (this_present_pathElement || that_present_pathElement) { + if (!(this_present_pathElement && that_present_pathElement)) + return false; + if (!this.pathElement.equals(that.pathElement)) + return false; + } + + boolean this_present_authzObj = true && this.isSetAuthzObj(); + boolean that_present_authzObj = true && that.isSetAuthzObj(); + if (this_present_authzObj || that_present_authzObj) { + if (!(this_present_authzObj && that_present_authzObj)) + return false; + if (!this.authzObj.equals(that.authzObj)) + return false; + } + + boolean this_present_children = true && this.isSetChildren(); + boolean that_present_children = true && that.isSetChildren(); + if (this_present_children || that_present_children) { + if (!(this_present_children && that_present_children)) + return false; + if (!this.children.equals(that.children)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + HashCodeBuilder builder = new HashCodeBuilder(); + + boolean present_type = true; + builder.append(present_type); + if (present_type) + builder.append(type); + + boolean present_pathElement = true && (isSetPathElement()); + builder.append(present_pathElement); + if (present_pathElement) + builder.append(pathElement); + + boolean present_authzObj = true && (isSetAuthzObj()); + builder.append(present_authzObj); + if (present_authzObj) + builder.append(authzObj); + + boolean present_children = true && (isSetChildren()); + builder.append(present_children); + if (present_children) + builder.append(children); + + return builder.toHashCode(); + } + + public int compareTo(TPathEntry other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + TPathEntry typedOther = (TPathEntry)other; + + lastComparison = Boolean.valueOf(isSetType()).compareTo(typedOther.isSetType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.type, typedOther.type); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPathElement()).compareTo(typedOther.isSetPathElement()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPathElement()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.pathElement, typedOther.pathElement); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAuthzObj()).compareTo(typedOther.isSetAuthzObj()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthzObj()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authzObj, typedOther.authzObj); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetChildren()).compareTo(typedOther.isSetChildren()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildren()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("TPathEntry("); + boolean first = true; + + sb.append("type:"); + sb.append(this.type); + first = false; + if (!first) sb.append(", "); + sb.append("pathElement:"); + if (this.pathElement == null) { + sb.append("null"); + } else { + sb.append(this.pathElement); + } + first = false; + if (isSetAuthzObj()) { + if (!first) sb.append(", "); + sb.append("authzObj:"); + if (this.authzObj == null) { + sb.append("null"); + } else { + sb.append(this.authzObj); + } + first = false; + } + if (!first) sb.append(", "); + sb.append("children:"); + if (this.children == null) { + sb.append("null"); + } else { + sb.append(this.children); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + if (!isSetType()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'type' is unset! Struct:" + toString()); + } + + if (!isSetPathElement()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'pathElement' is unset! Struct:" + toString()); + } + + if (!isSetChildren()) { + throw new org.apache.thrift.protocol.TProtocolException("Required field 'children' is unset! Struct:" + toString()); + } + + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + 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); + } + } + + private static class TPathEntryStandardSchemeFactory implements SchemeFactory { + public TPathEntryStandardScheme getScheme() { + return new TPathEntryStandardScheme(); + } + } + + private static class TPathEntryStandardScheme extends StandardScheme<TPathEntry> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TPathEntry 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: // TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.BYTE) { + struct.type = iprot.readByte(); + struct.setTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PATH_ELEMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.pathElement = iprot.readString(); + struct.setPathElementIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // AUTHZ_OBJ + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CHILDREN + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { + { + org.apache.thrift.protocol.TSet _set32 = iprot.readSetBegin(); + struct.children = new HashSet<Integer>(2*_set32.size); + for (int _i33 = 0; _i33 < _set32.size; ++_i33) + { + int _elem34; // required + _elem34 = iprot.readI32(); + struct.children.add(_elem34); + } + iprot.readSetEnd(); + } + struct.setChildrenIsSet(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 void write(org.apache.thrift.protocol.TProtocol oprot, TPathEntry struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TYPE_FIELD_DESC); + oprot.writeByte(struct.type); + oprot.writeFieldEnd(); + if (struct.pathElement != null) { + oprot.writeFieldBegin(PATH_ELEMENT_FIELD_DESC); + oprot.writeString(struct.pathElement); + oprot.writeFieldEnd(); + } + if (struct.authzObj != null) { + if (struct.isSetAuthzObj()) { + oprot.writeFieldBegin(AUTHZ_OBJ_FIELD_DESC); + oprot.writeString(struct.authzObj); + oprot.writeFieldEnd(); + } + } + if (struct.children != null) { + oprot.writeFieldBegin(CHILDREN_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.children.size())); + for (int _iter35 : struct.children) + { + oprot.writeI32(_iter35); + } + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TPathEntryTupleSchemeFactory implements SchemeFactory { + public TPathEntryTupleScheme getScheme() { + return new TPathEntryTupleScheme(); + } + } + + private static class TPathEntryTupleScheme extends TupleScheme<TPathEntry> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TPathEntry struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + oprot.writeByte(struct.type); + oprot.writeString(struct.pathElement); + { + oprot.writeI32(struct.children.size()); + for (int _iter36 : struct.children) + { + oprot.writeI32(_iter36); + } + } + BitSet optionals = new BitSet(); + if (struct.isSetAuthzObj()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetAuthzObj()) { + oprot.writeString(struct.authzObj); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TPathEntry struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + struct.type = iprot.readByte(); + struct.setTypeIsSet(true); + struct.pathElement = iprot.readString(); + struct.setPathElementIsSet(true); + { + org.apache.thrift.protocol.TSet _set37 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.children = new HashSet<Integer>(2*_set37.size); + for (int _i38 = 0; _i38 < _set37.size; ++_i38) + { + int _elem39; // required + _elem39 = iprot.readI32(); + struct.children.add(_elem39); + } + } + struct.setChildrenIsSet(true); + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.authzObj = iprot.readString(); + struct.setAuthzObjIsSet(true); + } + } + } + +} +