| /** |
| * 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.provider.db.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 TStoreSnapshot implements org.apache.thrift.TBase<TStoreSnapshot, TStoreSnapshot._Fields>, java.io.Serializable, Cloneable { |
| private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TStoreSnapshot"); |
| |
| private static final org.apache.thrift.protocol.TField ROOT_AUTHORIZABLE_FIELD_DESC = new org.apache.thrift.protocol.TField("rootAuthorizable", org.apache.thrift.protocol.TType.MAP, (short)1); |
| private static final org.apache.thrift.protocol.TField ROLE_TO_GROUPS_FIELD_DESC = new org.apache.thrift.protocol.TField("roleToGroups", org.apache.thrift.protocol.TType.MAP, (short)2); |
| private static final org.apache.thrift.protocol.TField OBJ_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("objIds", org.apache.thrift.protocol.TType.MAP, (short)3); |
| |
| private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); |
| static { |
| schemes.put(StandardScheme.class, new TStoreSnapshotStandardSchemeFactory()); |
| schemes.put(TupleScheme.class, new TStoreSnapshotTupleSchemeFactory()); |
| } |
| |
| private Map<String,TStoreAuthorizable> rootAuthorizable; // required |
| private Map<String,Set<String>> roleToGroups; // required |
| private Map<Integer,TStoreAuthorizable> objIds; // 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 { |
| ROOT_AUTHORIZABLE((short)1, "rootAuthorizable"), |
| ROLE_TO_GROUPS((short)2, "roleToGroups"), |
| OBJ_IDS((short)3, "objIds"); |
| |
| 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: // ROOT_AUTHORIZABLE |
| return ROOT_AUTHORIZABLE; |
| case 2: // ROLE_TO_GROUPS |
| return ROLE_TO_GROUPS; |
| case 3: // OBJ_IDS |
| return OBJ_IDS; |
| 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.ROOT_AUTHORIZABLE, new org.apache.thrift.meta_data.FieldMetaData("rootAuthorizable", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStoreAuthorizable.class)))); |
| tmpMap.put(_Fields.ROLE_TO_GROUPS, new org.apache.thrift.meta_data.FieldMetaData("roleToGroups", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), |
| 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.STRING))))); |
| tmpMap.put(_Fields.OBJ_IDS, new org.apache.thrift.meta_data.FieldMetaData("objIds", org.apache.thrift.TFieldRequirementType.REQUIRED, |
| new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, |
| new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32), |
| new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TStoreAuthorizable.class)))); |
| metaDataMap = Collections.unmodifiableMap(tmpMap); |
| org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TStoreSnapshot.class, metaDataMap); |
| } |
| |
| public TStoreSnapshot() { |
| } |
| |
| public TStoreSnapshot( |
| Map<String,TStoreAuthorizable> rootAuthorizable, |
| Map<String,Set<String>> roleToGroups, |
| Map<Integer,TStoreAuthorizable> objIds) |
| { |
| this(); |
| this.rootAuthorizable = rootAuthorizable; |
| this.roleToGroups = roleToGroups; |
| this.objIds = objIds; |
| } |
| |
| /** |
| * Performs a deep copy on <i>other</i>. |
| */ |
| public TStoreSnapshot(TStoreSnapshot other) { |
| if (other.isSetRootAuthorizable()) { |
| Map<String,TStoreAuthorizable> __this__rootAuthorizable = new HashMap<String,TStoreAuthorizable>(); |
| for (Map.Entry<String, TStoreAuthorizable> other_element : other.rootAuthorizable.entrySet()) { |
| |
| String other_element_key = other_element.getKey(); |
| TStoreAuthorizable other_element_value = other_element.getValue(); |
| |
| String __this__rootAuthorizable_copy_key = other_element_key; |
| |
| TStoreAuthorizable __this__rootAuthorizable_copy_value = new TStoreAuthorizable(other_element_value); |
| |
| __this__rootAuthorizable.put(__this__rootAuthorizable_copy_key, __this__rootAuthorizable_copy_value); |
| } |
| this.rootAuthorizable = __this__rootAuthorizable; |
| } |
| if (other.isSetRoleToGroups()) { |
| Map<String,Set<String>> __this__roleToGroups = new HashMap<String,Set<String>>(); |
| for (Map.Entry<String, Set<String>> other_element : other.roleToGroups.entrySet()) { |
| |
| String other_element_key = other_element.getKey(); |
| Set<String> other_element_value = other_element.getValue(); |
| |
| String __this__roleToGroups_copy_key = other_element_key; |
| |
| Set<String> __this__roleToGroups_copy_value = new HashSet<String>(); |
| for (String other_element_value_element : other_element_value) { |
| __this__roleToGroups_copy_value.add(other_element_value_element); |
| } |
| |
| __this__roleToGroups.put(__this__roleToGroups_copy_key, __this__roleToGroups_copy_value); |
| } |
| this.roleToGroups = __this__roleToGroups; |
| } |
| if (other.isSetObjIds()) { |
| Map<Integer,TStoreAuthorizable> __this__objIds = new HashMap<Integer,TStoreAuthorizable>(); |
| for (Map.Entry<Integer, TStoreAuthorizable> other_element : other.objIds.entrySet()) { |
| |
| Integer other_element_key = other_element.getKey(); |
| TStoreAuthorizable other_element_value = other_element.getValue(); |
| |
| Integer __this__objIds_copy_key = other_element_key; |
| |
| TStoreAuthorizable __this__objIds_copy_value = new TStoreAuthorizable(other_element_value); |
| |
| __this__objIds.put(__this__objIds_copy_key, __this__objIds_copy_value); |
| } |
| this.objIds = __this__objIds; |
| } |
| } |
| |
| public TStoreSnapshot deepCopy() { |
| return new TStoreSnapshot(this); |
| } |
| |
| @Override |
| public void clear() { |
| this.rootAuthorizable = null; |
| this.roleToGroups = null; |
| this.objIds = null; |
| } |
| |
| public int getRootAuthorizableSize() { |
| return (this.rootAuthorizable == null) ? 0 : this.rootAuthorizable.size(); |
| } |
| |
| public void putToRootAuthorizable(String key, TStoreAuthorizable val) { |
| if (this.rootAuthorizable == null) { |
| this.rootAuthorizable = new HashMap<String,TStoreAuthorizable>(); |
| } |
| this.rootAuthorizable.put(key, val); |
| } |
| |
| public Map<String,TStoreAuthorizable> getRootAuthorizable() { |
| return this.rootAuthorizable; |
| } |
| |
| public void setRootAuthorizable(Map<String,TStoreAuthorizable> rootAuthorizable) { |
| this.rootAuthorizable = rootAuthorizable; |
| } |
| |
| public void unsetRootAuthorizable() { |
| this.rootAuthorizable = null; |
| } |
| |
| /** Returns true if field rootAuthorizable is set (has been assigned a value) and false otherwise */ |
| public boolean isSetRootAuthorizable() { |
| return this.rootAuthorizable != null; |
| } |
| |
| public void setRootAuthorizableIsSet(boolean value) { |
| if (!value) { |
| this.rootAuthorizable = null; |
| } |
| } |
| |
| public int getRoleToGroupsSize() { |
| return (this.roleToGroups == null) ? 0 : this.roleToGroups.size(); |
| } |
| |
| public void putToRoleToGroups(String key, Set<String> val) { |
| if (this.roleToGroups == null) { |
| this.roleToGroups = new HashMap<String,Set<String>>(); |
| } |
| this.roleToGroups.put(key, val); |
| } |
| |
| public Map<String,Set<String>> getRoleToGroups() { |
| return this.roleToGroups; |
| } |
| |
| public void setRoleToGroups(Map<String,Set<String>> roleToGroups) { |
| this.roleToGroups = roleToGroups; |
| } |
| |
| public void unsetRoleToGroups() { |
| this.roleToGroups = null; |
| } |
| |
| /** Returns true if field roleToGroups is set (has been assigned a value) and false otherwise */ |
| public boolean isSetRoleToGroups() { |
| return this.roleToGroups != null; |
| } |
| |
| public void setRoleToGroupsIsSet(boolean value) { |
| if (!value) { |
| this.roleToGroups = null; |
| } |
| } |
| |
| public int getObjIdsSize() { |
| return (this.objIds == null) ? 0 : this.objIds.size(); |
| } |
| |
| public void putToObjIds(int key, TStoreAuthorizable val) { |
| if (this.objIds == null) { |
| this.objIds = new HashMap<Integer,TStoreAuthorizable>(); |
| } |
| this.objIds.put(key, val); |
| } |
| |
| public Map<Integer,TStoreAuthorizable> getObjIds() { |
| return this.objIds; |
| } |
| |
| public void setObjIds(Map<Integer,TStoreAuthorizable> objIds) { |
| this.objIds = objIds; |
| } |
| |
| public void unsetObjIds() { |
| this.objIds = null; |
| } |
| |
| /** Returns true if field objIds is set (has been assigned a value) and false otherwise */ |
| public boolean isSetObjIds() { |
| return this.objIds != null; |
| } |
| |
| public void setObjIdsIsSet(boolean value) { |
| if (!value) { |
| this.objIds = null; |
| } |
| } |
| |
| public void setFieldValue(_Fields field, Object value) { |
| switch (field) { |
| case ROOT_AUTHORIZABLE: |
| if (value == null) { |
| unsetRootAuthorizable(); |
| } else { |
| setRootAuthorizable((Map<String,TStoreAuthorizable>)value); |
| } |
| break; |
| |
| case ROLE_TO_GROUPS: |
| if (value == null) { |
| unsetRoleToGroups(); |
| } else { |
| setRoleToGroups((Map<String,Set<String>>)value); |
| } |
| break; |
| |
| case OBJ_IDS: |
| if (value == null) { |
| unsetObjIds(); |
| } else { |
| setObjIds((Map<Integer,TStoreAuthorizable>)value); |
| } |
| break; |
| |
| } |
| } |
| |
| public Object getFieldValue(_Fields field) { |
| switch (field) { |
| case ROOT_AUTHORIZABLE: |
| return getRootAuthorizable(); |
| |
| case ROLE_TO_GROUPS: |
| return getRoleToGroups(); |
| |
| case OBJ_IDS: |
| return getObjIds(); |
| |
| } |
| 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 ROOT_AUTHORIZABLE: |
| return isSetRootAuthorizable(); |
| case ROLE_TO_GROUPS: |
| return isSetRoleToGroups(); |
| case OBJ_IDS: |
| return isSetObjIds(); |
| } |
| throw new IllegalStateException(); |
| } |
| |
| @Override |
| public boolean equals(Object that) { |
| if (that == null) |
| return false; |
| if (that instanceof TStoreSnapshot) |
| return this.equals((TStoreSnapshot)that); |
| return false; |
| } |
| |
| public boolean equals(TStoreSnapshot that) { |
| if (that == null) |
| return false; |
| |
| boolean this_present_rootAuthorizable = true && this.isSetRootAuthorizable(); |
| boolean that_present_rootAuthorizable = true && that.isSetRootAuthorizable(); |
| if (this_present_rootAuthorizable || that_present_rootAuthorizable) { |
| if (!(this_present_rootAuthorizable && that_present_rootAuthorizable)) |
| return false; |
| if (!this.rootAuthorizable.equals(that.rootAuthorizable)) |
| return false; |
| } |
| |
| boolean this_present_roleToGroups = true && this.isSetRoleToGroups(); |
| boolean that_present_roleToGroups = true && that.isSetRoleToGroups(); |
| if (this_present_roleToGroups || that_present_roleToGroups) { |
| if (!(this_present_roleToGroups && that_present_roleToGroups)) |
| return false; |
| if (!this.roleToGroups.equals(that.roleToGroups)) |
| return false; |
| } |
| |
| boolean this_present_objIds = true && this.isSetObjIds(); |
| boolean that_present_objIds = true && that.isSetObjIds(); |
| if (this_present_objIds || that_present_objIds) { |
| if (!(this_present_objIds && that_present_objIds)) |
| return false; |
| if (!this.objIds.equals(that.objIds)) |
| return false; |
| } |
| |
| return true; |
| } |
| |
| @Override |
| public int hashCode() { |
| HashCodeBuilder builder = new HashCodeBuilder(); |
| |
| boolean present_rootAuthorizable = true && (isSetRootAuthorizable()); |
| builder.append(present_rootAuthorizable); |
| if (present_rootAuthorizable) |
| builder.append(rootAuthorizable); |
| |
| boolean present_roleToGroups = true && (isSetRoleToGroups()); |
| builder.append(present_roleToGroups); |
| if (present_roleToGroups) |
| builder.append(roleToGroups); |
| |
| boolean present_objIds = true && (isSetObjIds()); |
| builder.append(present_objIds); |
| if (present_objIds) |
| builder.append(objIds); |
| |
| return builder.toHashCode(); |
| } |
| |
| public int compareTo(TStoreSnapshot other) { |
| if (!getClass().equals(other.getClass())) { |
| return getClass().getName().compareTo(other.getClass().getName()); |
| } |
| |
| int lastComparison = 0; |
| TStoreSnapshot typedOther = (TStoreSnapshot)other; |
| |
| lastComparison = Boolean.valueOf(isSetRootAuthorizable()).compareTo(typedOther.isSetRootAuthorizable()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetRootAuthorizable()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rootAuthorizable, typedOther.rootAuthorizable); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(isSetRoleToGroups()).compareTo(typedOther.isSetRoleToGroups()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetRoleToGroups()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.roleToGroups, typedOther.roleToGroups); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| } |
| lastComparison = Boolean.valueOf(isSetObjIds()).compareTo(typedOther.isSetObjIds()); |
| if (lastComparison != 0) { |
| return lastComparison; |
| } |
| if (isSetObjIds()) { |
| lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.objIds, typedOther.objIds); |
| 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("TStoreSnapshot("); |
| boolean first = true; |
| |
| sb.append("rootAuthorizable:"); |
| if (this.rootAuthorizable == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.rootAuthorizable); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("roleToGroups:"); |
| if (this.roleToGroups == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.roleToGroups); |
| } |
| first = false; |
| if (!first) sb.append(", "); |
| sb.append("objIds:"); |
| if (this.objIds == null) { |
| sb.append("null"); |
| } else { |
| sb.append(this.objIds); |
| } |
| first = false; |
| sb.append(")"); |
| return sb.toString(); |
| } |
| |
| public void validate() throws org.apache.thrift.TException { |
| // check for required fields |
| if (!isSetRootAuthorizable()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'rootAuthorizable' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetRoleToGroups()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'roleToGroups' is unset! Struct:" + toString()); |
| } |
| |
| if (!isSetObjIds()) { |
| throw new org.apache.thrift.protocol.TProtocolException("Required field 'objIds' 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 TStoreSnapshotStandardSchemeFactory implements SchemeFactory { |
| public TStoreSnapshotStandardScheme getScheme() { |
| return new TStoreSnapshotStandardScheme(); |
| } |
| } |
| |
| private static class TStoreSnapshotStandardScheme extends StandardScheme<TStoreSnapshot> { |
| |
| public void read(org.apache.thrift.protocol.TProtocol iprot, TStoreSnapshot 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: // ROOT_AUTHORIZABLE |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map18 = iprot.readMapBegin(); |
| struct.rootAuthorizable = new HashMap<String,TStoreAuthorizable>(2*_map18.size); |
| for (int _i19 = 0; _i19 < _map18.size; ++_i19) |
| { |
| String _key20; // required |
| TStoreAuthorizable _val21; // required |
| _key20 = iprot.readString(); |
| _val21 = new TStoreAuthorizable(); |
| _val21.read(iprot); |
| struct.rootAuthorizable.put(_key20, _val21); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.setRootAuthorizableIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 2: // ROLE_TO_GROUPS |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin(); |
| struct.roleToGroups = new HashMap<String,Set<String>>(2*_map22.size); |
| for (int _i23 = 0; _i23 < _map22.size; ++_i23) |
| { |
| String _key24; // required |
| Set<String> _val25; // required |
| _key24 = iprot.readString(); |
| { |
| org.apache.thrift.protocol.TSet _set26 = iprot.readSetBegin(); |
| _val25 = new HashSet<String>(2*_set26.size); |
| for (int _i27 = 0; _i27 < _set26.size; ++_i27) |
| { |
| String _elem28; // required |
| _elem28 = iprot.readString(); |
| _val25.add(_elem28); |
| } |
| iprot.readSetEnd(); |
| } |
| struct.roleToGroups.put(_key24, _val25); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.setRoleToGroupsIsSet(true); |
| } else { |
| org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); |
| } |
| break; |
| case 3: // OBJ_IDS |
| if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { |
| { |
| org.apache.thrift.protocol.TMap _map29 = iprot.readMapBegin(); |
| struct.objIds = new HashMap<Integer,TStoreAuthorizable>(2*_map29.size); |
| for (int _i30 = 0; _i30 < _map29.size; ++_i30) |
| { |
| int _key31; // required |
| TStoreAuthorizable _val32; // required |
| _key31 = iprot.readI32(); |
| _val32 = new TStoreAuthorizable(); |
| _val32.read(iprot); |
| struct.objIds.put(_key31, _val32); |
| } |
| iprot.readMapEnd(); |
| } |
| struct.setObjIdsIsSet(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, TStoreSnapshot struct) throws org.apache.thrift.TException { |
| struct.validate(); |
| |
| oprot.writeStructBegin(STRUCT_DESC); |
| if (struct.rootAuthorizable != null) { |
| oprot.writeFieldBegin(ROOT_AUTHORIZABLE_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.rootAuthorizable.size())); |
| for (Map.Entry<String, TStoreAuthorizable> _iter33 : struct.rootAuthorizable.entrySet()) |
| { |
| oprot.writeString(_iter33.getKey()); |
| _iter33.getValue().write(oprot); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| if (struct.roleToGroups != null) { |
| oprot.writeFieldBegin(ROLE_TO_GROUPS_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, struct.roleToGroups.size())); |
| for (Map.Entry<String, Set<String>> _iter34 : struct.roleToGroups.entrySet()) |
| { |
| oprot.writeString(_iter34.getKey()); |
| { |
| oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, _iter34.getValue().size())); |
| for (String _iter35 : _iter34.getValue()) |
| { |
| oprot.writeString(_iter35); |
| } |
| oprot.writeSetEnd(); |
| } |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| if (struct.objIds != null) { |
| oprot.writeFieldBegin(OBJ_IDS_FIELD_DESC); |
| { |
| oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, struct.objIds.size())); |
| for (Map.Entry<Integer, TStoreAuthorizable> _iter36 : struct.objIds.entrySet()) |
| { |
| oprot.writeI32(_iter36.getKey()); |
| _iter36.getValue().write(oprot); |
| } |
| oprot.writeMapEnd(); |
| } |
| oprot.writeFieldEnd(); |
| } |
| oprot.writeFieldStop(); |
| oprot.writeStructEnd(); |
| } |
| |
| } |
| |
| private static class TStoreSnapshotTupleSchemeFactory implements SchemeFactory { |
| public TStoreSnapshotTupleScheme getScheme() { |
| return new TStoreSnapshotTupleScheme(); |
| } |
| } |
| |
| private static class TStoreSnapshotTupleScheme extends TupleScheme<TStoreSnapshot> { |
| |
| @Override |
| public void write(org.apache.thrift.protocol.TProtocol prot, TStoreSnapshot struct) throws org.apache.thrift.TException { |
| TTupleProtocol oprot = (TTupleProtocol) prot; |
| { |
| oprot.writeI32(struct.rootAuthorizable.size()); |
| for (Map.Entry<String, TStoreAuthorizable> _iter37 : struct.rootAuthorizable.entrySet()) |
| { |
| oprot.writeString(_iter37.getKey()); |
| _iter37.getValue().write(oprot); |
| } |
| } |
| { |
| oprot.writeI32(struct.roleToGroups.size()); |
| for (Map.Entry<String, Set<String>> _iter38 : struct.roleToGroups.entrySet()) |
| { |
| oprot.writeString(_iter38.getKey()); |
| { |
| oprot.writeI32(_iter38.getValue().size()); |
| for (String _iter39 : _iter38.getValue()) |
| { |
| oprot.writeString(_iter39); |
| } |
| } |
| } |
| } |
| { |
| oprot.writeI32(struct.objIds.size()); |
| for (Map.Entry<Integer, TStoreAuthorizable> _iter40 : struct.objIds.entrySet()) |
| { |
| oprot.writeI32(_iter40.getKey()); |
| _iter40.getValue().write(oprot); |
| } |
| } |
| } |
| |
| @Override |
| public void read(org.apache.thrift.protocol.TProtocol prot, TStoreSnapshot struct) throws org.apache.thrift.TException { |
| TTupleProtocol iprot = (TTupleProtocol) prot; |
| { |
| org.apache.thrift.protocol.TMap _map41 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); |
| struct.rootAuthorizable = new HashMap<String,TStoreAuthorizable>(2*_map41.size); |
| for (int _i42 = 0; _i42 < _map41.size; ++_i42) |
| { |
| String _key43; // required |
| TStoreAuthorizable _val44; // required |
| _key43 = iprot.readString(); |
| _val44 = new TStoreAuthorizable(); |
| _val44.read(iprot); |
| struct.rootAuthorizable.put(_key43, _val44); |
| } |
| } |
| struct.setRootAuthorizableIsSet(true); |
| { |
| org.apache.thrift.protocol.TMap _map45 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.SET, iprot.readI32()); |
| struct.roleToGroups = new HashMap<String,Set<String>>(2*_map45.size); |
| for (int _i46 = 0; _i46 < _map45.size; ++_i46) |
| { |
| String _key47; // required |
| Set<String> _val48; // required |
| _key47 = iprot.readString(); |
| { |
| org.apache.thrift.protocol.TSet _set49 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); |
| _val48 = new HashSet<String>(2*_set49.size); |
| for (int _i50 = 0; _i50 < _set49.size; ++_i50) |
| { |
| String _elem51; // required |
| _elem51 = iprot.readString(); |
| _val48.add(_elem51); |
| } |
| } |
| struct.roleToGroups.put(_key47, _val48); |
| } |
| } |
| struct.setRoleToGroupsIsSet(true); |
| { |
| org.apache.thrift.protocol.TMap _map52 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.I32, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); |
| struct.objIds = new HashMap<Integer,TStoreAuthorizable>(2*_map52.size); |
| for (int _i53 = 0; _i53 < _map52.size; ++_i53) |
| { |
| int _key54; // required |
| TStoreAuthorizable _val55; // required |
| _key54 = iprot.readI32(); |
| _val55 = new TStoreAuthorizable(); |
| _val55.read(iprot); |
| struct.objIds.put(_key54, _val55); |
| } |
| } |
| struct.setObjIdsIsSet(true); |
| } |
| } |
| |
| } |
| |