diff options
author | Jonathan Bauer | 2016-01-18 17:44:47 +0100 |
---|---|---|
committer | Jonathan Bauer | 2016-01-18 17:44:47 +0100 |
commit | b4d75b70c37c076661632300363354ca9800e021 (patch) | |
tree | a0220cc3c6d695a7099a964f230f6f23cfff6959 | |
parent | Thrift(SAT): Add lecture is private only field to lecture struct (diff) | |
download | master-sync-shared-b4d75b70c37c076661632300363354ca9800e021.tar.gz master-sync-shared-b4d75b70c37c076661632300363354ca9800e021.tar.xz master-sync-shared-b4d75b70c37c076661632300363354ca9800e021.zip |
RPC update
added limitToLocations/limitToAllowedUsers to LectureRead
added parentLocationId to Location struct
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/LectureRead.java | 208 | ||||
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/Location.java | 109 | ||||
-rw-r--r-- | src/main/java/org/openslx/thrifthelper/Comparators.java | 1 | ||||
-rw-r--r-- | src/main/thrift/bwlp.thrift | 3 |
4 files changed, 310 insertions, 11 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/LectureRead.java b/src/main/java/org/openslx/bwlp/thrift/iface/LectureRead.java index 0fddbff..2d872f9 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/LectureRead.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/LectureRead.java @@ -34,7 +34,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-04") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-18") public class LectureRead implements org.apache.thrift.TBase<LectureRead, LectureRead._Fields>, java.io.Serializable, Cloneable, Comparable<LectureRead> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LectureRead"); @@ -62,6 +62,8 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture private static final org.apache.thrift.protocol.TField DEFAULT_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("defaultPermissions", org.apache.thrift.protocol.TType.STRUCT, (short)19); private static final org.apache.thrift.protocol.TField USER_PERMISSIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("userPermissions", org.apache.thrift.protocol.TType.STRUCT, (short)22); private static final org.apache.thrift.protocol.TField LOCATION_IDS_FIELD_DESC = new org.apache.thrift.protocol.TField("locationIds", org.apache.thrift.protocol.TType.LIST, (short)25); + private static final org.apache.thrift.protocol.TField LIMIT_TO_LOCATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("limitToLocations", org.apache.thrift.protocol.TType.BOOL, (short)26); + private static final org.apache.thrift.protocol.TField LIMIT_TO_ALLOWED_USERS_FIELD_DESC = new org.apache.thrift.protocol.TField("limitToAllowedUsers", org.apache.thrift.protocol.TType.BOOL, (short)27); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -93,6 +95,8 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture public LecturePermissions defaultPermissions; // required public LecturePermissions userPermissions; // optional public List<Integer> locationIds; // required + public boolean limitToLocations; // required + public boolean limitToAllowedUsers; // 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 { @@ -119,7 +123,9 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture HAS_INTERNET_ACCESS((short)18, "hasInternetAccess"), DEFAULT_PERMISSIONS((short)19, "defaultPermissions"), USER_PERMISSIONS((short)22, "userPermissions"), - LOCATION_IDS((short)25, "locationIds"); + LOCATION_IDS((short)25, "locationIds"), + LIMIT_TO_LOCATIONS((short)26, "limitToLocations"), + LIMIT_TO_ALLOWED_USERS((short)27, "limitToAllowedUsers"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -182,6 +188,10 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture return USER_PERMISSIONS; case 25: // LOCATION_IDS return LOCATION_IDS; + case 26: // LIMIT_TO_LOCATIONS + return LIMIT_TO_LOCATIONS; + case 27: // LIMIT_TO_ALLOWED_USERS + return LIMIT_TO_ALLOWED_USERS; default: return null; } @@ -232,6 +242,8 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture private static final int __UPDATETIME_ISSET_ID = 7; private static final int __ISEXAM_ISSET_ID = 8; private static final int __HASINTERNETACCESS_ISSET_ID = 9; + private static final int __LIMITTOLOCATIONS_ISSET_ID = 10; + private static final int __LIMITTOALLOWEDUSERS_ISSET_ID = 11; private short __isset_bitfield = 0; private static final _Fields optionals[] = {_Fields.USER_PERMISSIONS}; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; @@ -289,6 +301,10 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture tmpMap.put(_Fields.LOCATION_IDS, new org.apache.thrift.meta_data.FieldMetaData("locationIds", org.apache.thrift.TFieldRequirementType.DEFAULT, 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.I32)))); + tmpMap.put(_Fields.LIMIT_TO_LOCATIONS, new org.apache.thrift.meta_data.FieldMetaData("limitToLocations", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.LIMIT_TO_ALLOWED_USERS, new org.apache.thrift.meta_data.FieldMetaData("limitToAllowedUsers", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(LectureRead.class, metaDataMap); } @@ -319,7 +335,9 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture boolean isExam, boolean hasInternetAccess, LecturePermissions defaultPermissions, - List<Integer> locationIds) + List<Integer> locationIds, + boolean limitToLocations, + boolean limitToAllowedUsers) { this(); this.lectureId = lectureId; @@ -355,6 +373,10 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture setHasInternetAccessIsSet(true); this.defaultPermissions = defaultPermissions; this.locationIds = locationIds; + this.limitToLocations = limitToLocations; + setLimitToLocationsIsSet(true); + this.limitToAllowedUsers = limitToAllowedUsers; + setLimitToAllowedUsersIsSet(true); } /** @@ -421,6 +443,8 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture List<Integer> __this__locationIds = new ArrayList<Integer>(other.locationIds); this.locationIds = __this__locationIds; } + this.limitToLocations = other.limitToLocations; + this.limitToAllowedUsers = other.limitToAllowedUsers; } public LectureRead deepCopy() { @@ -463,6 +487,10 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture this.defaultPermissions = null; this.userPermissions = null; this.locationIds = null; + setLimitToLocationsIsSet(false); + this.limitToLocations = false; + setLimitToAllowedUsersIsSet(false); + this.limitToAllowedUsers = false; } public String getLectureId() { @@ -1091,6 +1119,52 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture } } + public boolean isLimitToLocations() { + return this.limitToLocations; + } + + public LectureRead setLimitToLocations(boolean limitToLocations) { + this.limitToLocations = limitToLocations; + setLimitToLocationsIsSet(true); + return this; + } + + public void unsetLimitToLocations() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIMITTOLOCATIONS_ISSET_ID); + } + + /** Returns true if field limitToLocations is set (has been assigned a value) and false otherwise */ + public boolean isSetLimitToLocations() { + return EncodingUtils.testBit(__isset_bitfield, __LIMITTOLOCATIONS_ISSET_ID); + } + + public void setLimitToLocationsIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIMITTOLOCATIONS_ISSET_ID, value); + } + + public boolean isLimitToAllowedUsers() { + return this.limitToAllowedUsers; + } + + public LectureRead setLimitToAllowedUsers(boolean limitToAllowedUsers) { + this.limitToAllowedUsers = limitToAllowedUsers; + setLimitToAllowedUsersIsSet(true); + return this; + } + + public void unsetLimitToAllowedUsers() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LIMITTOALLOWEDUSERS_ISSET_ID); + } + + /** Returns true if field limitToAllowedUsers is set (has been assigned a value) and false otherwise */ + public boolean isSetLimitToAllowedUsers() { + return EncodingUtils.testBit(__isset_bitfield, __LIMITTOALLOWEDUSERS_ISSET_ID); + } + + public void setLimitToAllowedUsersIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LIMITTOALLOWEDUSERS_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case LECTURE_ID: @@ -1285,6 +1359,22 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture } break; + case LIMIT_TO_LOCATIONS: + if (value == null) { + unsetLimitToLocations(); + } else { + setLimitToLocations((Boolean)value); + } + break; + + case LIMIT_TO_ALLOWED_USERS: + if (value == null) { + unsetLimitToAllowedUsers(); + } else { + setLimitToAllowedUsers((Boolean)value); + } + break; + } } @@ -1362,6 +1452,12 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture case LOCATION_IDS: return getLocationIds(); + case LIMIT_TO_LOCATIONS: + return isLimitToLocations(); + + case LIMIT_TO_ALLOWED_USERS: + return isLimitToAllowedUsers(); + } throw new IllegalStateException(); } @@ -1421,6 +1517,10 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture return isSetUserPermissions(); case LOCATION_IDS: return isSetLocationIds(); + case LIMIT_TO_LOCATIONS: + return isSetLimitToLocations(); + case LIMIT_TO_ALLOWED_USERS: + return isSetLimitToAllowedUsers(); } throw new IllegalStateException(); } @@ -1654,6 +1754,24 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture return false; } + boolean this_present_limitToLocations = true; + boolean that_present_limitToLocations = true; + if (this_present_limitToLocations || that_present_limitToLocations) { + if (!(this_present_limitToLocations && that_present_limitToLocations)) + return false; + if (this.limitToLocations != that.limitToLocations) + return false; + } + + boolean this_present_limitToAllowedUsers = true; + boolean that_present_limitToAllowedUsers = true; + if (this_present_limitToAllowedUsers || that_present_limitToAllowedUsers) { + if (!(this_present_limitToAllowedUsers && that_present_limitToAllowedUsers)) + return false; + if (this.limitToAllowedUsers != that.limitToAllowedUsers) + return false; + } + return true; } @@ -1781,6 +1899,16 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture if (present_locationIds) list.add(locationIds); + boolean present_limitToLocations = true; + list.add(present_limitToLocations); + if (present_limitToLocations) + list.add(limitToLocations); + + boolean present_limitToAllowedUsers = true; + list.add(present_limitToAllowedUsers); + if (present_limitToAllowedUsers) + list.add(limitToAllowedUsers); + return list.hashCode(); } @@ -2032,6 +2160,26 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture return lastComparison; } } + lastComparison = Boolean.valueOf(isSetLimitToLocations()).compareTo(other.isSetLimitToLocations()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLimitToLocations()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitToLocations, other.limitToLocations); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLimitToAllowedUsers()).compareTo(other.isSetLimitToAllowedUsers()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLimitToAllowedUsers()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.limitToAllowedUsers, other.limitToAllowedUsers); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -2205,6 +2353,14 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture sb.append(this.locationIds); } first = false; + if (!first) sb.append(", "); + sb.append("limitToLocations:"); + sb.append(this.limitToLocations); + first = false; + if (!first) sb.append(", "); + sb.append("limitToAllowedUsers:"); + sb.append(this.limitToAllowedUsers); + first = false; sb.append(")"); return sb.toString(); } @@ -2491,6 +2647,22 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 26: // LIMIT_TO_LOCATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.limitToLocations = iprot.readBool(); + struct.setLimitToLocationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 27: // LIMIT_TO_ALLOWED_USERS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.limitToAllowedUsers = iprot.readBool(); + struct.setLimitToAllowedUsersIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -2636,6 +2808,12 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture } oprot.writeFieldEnd(); } + oprot.writeFieldBegin(LIMIT_TO_LOCATIONS_FIELD_DESC); + oprot.writeBool(struct.limitToLocations); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LIMIT_TO_ALLOWED_USERS_FIELD_DESC); + oprot.writeBool(struct.limitToAllowedUsers); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -2726,7 +2904,13 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture if (struct.isSetLocationIds()) { optionals.set(23); } - oprot.writeBitSet(optionals, 24); + if (struct.isSetLimitToLocations()) { + optionals.set(24); + } + if (struct.isSetLimitToAllowedUsers()) { + optionals.set(25); + } + oprot.writeBitSet(optionals, 26); if (struct.isSetLectureId()) { oprot.writeString(struct.lectureId); } @@ -2823,12 +3007,18 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture } } } + if (struct.isSetLimitToLocations()) { + oprot.writeBool(struct.limitToLocations); + } + if (struct.isSetLimitToAllowedUsers()) { + oprot.writeBool(struct.limitToAllowedUsers); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, LectureRead struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(24); + BitSet incoming = iprot.readBitSet(26); if (incoming.get(0)) { struct.lectureId = iprot.readString(); struct.setLectureIdIsSet(true); @@ -2964,6 +3154,14 @@ public class LectureRead implements org.apache.thrift.TBase<LectureRead, Lecture } struct.setLocationIdsIsSet(true); } + if (incoming.get(24)) { + struct.limitToLocations = iprot.readBool(); + struct.setLimitToLocationsIsSet(true); + } + if (incoming.get(25)) { + struct.limitToAllowedUsers = iprot.readBool(); + struct.setLimitToAllowedUsersIsSet(true); + } } } diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/Location.java b/src/main/java/org/openslx/bwlp/thrift/iface/Location.java index 14d0b82..005389b 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/Location.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/Location.java @@ -34,12 +34,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-04") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-18") public class Location implements org.apache.thrift.TBase<Location, Location._Fields>, java.io.Serializable, Cloneable, Comparable<Location> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Location"); private static final org.apache.thrift.protocol.TField LOCATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("locationId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField LOCATION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("locationName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField PARENT_LOCATION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("parentLocationId", org.apache.thrift.protocol.TType.I32, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -49,11 +50,13 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie public int locationId; // required public String locationName; // required + public int parentLocationId; // 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 { LOCATION_ID((short)1, "locationId"), - LOCATION_NAME((short)2, "locationName"); + LOCATION_NAME((short)2, "locationName"), + PARENT_LOCATION_ID((short)3, "parentLocationId"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -72,6 +75,8 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie return LOCATION_ID; case 2: // LOCATION_NAME return LOCATION_NAME; + case 3: // PARENT_LOCATION_ID + return PARENT_LOCATION_ID; default: return null; } @@ -113,6 +118,7 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie // isset id assignments private static final int __LOCATIONID_ISSET_ID = 0; + private static final int __PARENTLOCATIONID_ISSET_ID = 1; private byte __isset_bitfield = 0; public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { @@ -121,6 +127,8 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.LOCATION_NAME, new org.apache.thrift.meta_data.FieldMetaData("locationName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PARENT_LOCATION_ID, new org.apache.thrift.meta_data.FieldMetaData("parentLocationId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Location.class, metaDataMap); } @@ -130,12 +138,15 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie public Location( int locationId, - String locationName) + String locationName, + int parentLocationId) { this(); this.locationId = locationId; setLocationIdIsSet(true); this.locationName = locationName; + this.parentLocationId = parentLocationId; + setParentLocationIdIsSet(true); } /** @@ -147,6 +158,7 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie if (other.isSetLocationName()) { this.locationName = other.locationName; } + this.parentLocationId = other.parentLocationId; } public Location deepCopy() { @@ -158,6 +170,8 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie setLocationIdIsSet(false); this.locationId = 0; this.locationName = null; + setParentLocationIdIsSet(false); + this.parentLocationId = 0; } public int getLocationId() { @@ -207,6 +221,29 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie } } + public int getParentLocationId() { + return this.parentLocationId; + } + + public Location setParentLocationId(int parentLocationId) { + this.parentLocationId = parentLocationId; + setParentLocationIdIsSet(true); + return this; + } + + public void unsetParentLocationId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PARENTLOCATIONID_ISSET_ID); + } + + /** Returns true if field parentLocationId is set (has been assigned a value) and false otherwise */ + public boolean isSetParentLocationId() { + return EncodingUtils.testBit(__isset_bitfield, __PARENTLOCATIONID_ISSET_ID); + } + + public void setParentLocationIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PARENTLOCATIONID_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case LOCATION_ID: @@ -225,6 +262,14 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie } break; + case PARENT_LOCATION_ID: + if (value == null) { + unsetParentLocationId(); + } else { + setParentLocationId((Integer)value); + } + break; + } } @@ -236,6 +281,9 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie case LOCATION_NAME: return getLocationName(); + case PARENT_LOCATION_ID: + return getParentLocationId(); + } throw new IllegalStateException(); } @@ -251,6 +299,8 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie return isSetLocationId(); case LOCATION_NAME: return isSetLocationName(); + case PARENT_LOCATION_ID: + return isSetParentLocationId(); } throw new IllegalStateException(); } @@ -286,6 +336,15 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie return false; } + boolean this_present_parentLocationId = true; + boolean that_present_parentLocationId = true; + if (this_present_parentLocationId || that_present_parentLocationId) { + if (!(this_present_parentLocationId && that_present_parentLocationId)) + return false; + if (this.parentLocationId != that.parentLocationId) + return false; + } + return true; } @@ -303,6 +362,11 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie if (present_locationName) list.add(locationName); + boolean present_parentLocationId = true; + list.add(present_parentLocationId); + if (present_parentLocationId) + list.add(parentLocationId); + return list.hashCode(); } @@ -334,6 +398,16 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie return lastComparison; } } + lastComparison = Boolean.valueOf(isSetParentLocationId()).compareTo(other.isSetParentLocationId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParentLocationId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parentLocationId, other.parentLocationId); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -365,6 +439,10 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie sb.append(this.locationName); } first = false; + if (!first) sb.append(", "); + sb.append("parentLocationId:"); + sb.append(this.parentLocationId); + first = false; sb.append(")"); return sb.toString(); } @@ -426,6 +504,14 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // PARENT_LOCATION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.parentLocationId = iprot.readI32(); + struct.setParentLocationIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -449,6 +535,9 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie oprot.writeString(struct.locationName); oprot.writeFieldEnd(); } + oprot.writeFieldBegin(PARENT_LOCATION_ID_FIELD_DESC); + oprot.writeI32(struct.parentLocationId); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -473,19 +562,25 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie if (struct.isSetLocationName()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetParentLocationId()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetLocationId()) { oprot.writeI32(struct.locationId); } if (struct.isSetLocationName()) { oprot.writeString(struct.locationName); } + if (struct.isSetParentLocationId()) { + oprot.writeI32(struct.parentLocationId); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Location struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.locationId = iprot.readI32(); struct.setLocationIdIsSet(true); @@ -494,6 +589,10 @@ public class Location implements org.apache.thrift.TBase<Location, Location._Fie struct.locationName = iprot.readString(); struct.setLocationNameIsSet(true); } + if (incoming.get(2)) { + struct.parentLocationId = iprot.readI32(); + struct.setParentLocationIdIsSet(true); + } } } diff --git a/src/main/java/org/openslx/thrifthelper/Comparators.java b/src/main/java/org/openslx/thrifthelper/Comparators.java index 99e55e5..bffaef8 100644 --- a/src/main/java/org/openslx/thrifthelper/Comparators.java +++ b/src/main/java/org/openslx/thrifthelper/Comparators.java @@ -4,7 +4,6 @@ import java.util.Comparator; import org.openslx.bwlp.thrift.iface.ImageSummaryRead; import org.openslx.bwlp.thrift.iface.ImageVersionDetails; -import org.openslx.bwlp.thrift.iface.Location; import org.openslx.bwlp.thrift.iface.OperatingSystem; import org.openslx.bwlp.thrift.iface.Organization; import org.openslx.bwlp.thrift.iface.Virtualizer; diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index 9583a9d..58c58d2 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -302,6 +302,8 @@ struct LectureRead { 19: LecturePermissions defaultPermissions, 22: optional LecturePermissions userPermissions, 25: list<i32> locationIds, + 26: bool limitToLocations, + 27: bool limitToAllowedUsers, } struct MasterTag { @@ -361,6 +363,7 @@ struct SatelliteUserConfig { struct Location { 1: i32 locationId, 2: string locationName, + 3: i32 parentLocationId, } // ############ EXCEPTION ###################### |