From 67ba101edb960ae93264bf20c65973556154c193 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 11 Dec 2018 10:41:22 +0100 Subject: Redesign preset* handling to aim for backwards compat --- .../org/openslx/bwlp/thrift/iface/LectureRead.java | 496 +++++++++++++++++---- src/main/thrift/bwlp.thrift | 2 + 2 files changed, 406 insertions(+), 92 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 a60e316..b2a183f 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 = "2018-12-08") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2018-12-11") public class LectureRead implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("LectureRead"); @@ -66,7 +66,9 @@ public class LectureRead implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); @@ -103,7 +105,9 @@ public class LectureRead implements org.apache.thrift.TBase networkShares; // optional + public List presetNetworkShares; // optional public List ldapFilters; // optional + public List presetLdapFilters; // optional public List presetScriptIds; // optional /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -136,7 +140,9 @@ public class LectureRead implements org.apache.thrift.TBase byName = new HashMap(); @@ -208,8 +214,12 @@ public class LectureRead implements org.apache.thrift.TBase metaDataMap; static { Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -331,9 +341,15 @@ public class LectureRead implements org.apache.thrift.TBase __this__presetNetworkShares = new ArrayList(other.presetNetworkShares); + this.presetNetworkShares = __this__presetNetworkShares; + } if (other.isSetLdapFilters()) { List __this__ldapFilters = new ArrayList(other.ldapFilters.size()); for (LdapFilter other_element : other.ldapFilters) { @@ -495,6 +515,10 @@ public class LectureRead implements org.apache.thrift.TBase __this__presetLdapFilters = new ArrayList(other.presetLdapFilters); + this.presetLdapFilters = __this__presetLdapFilters; + } if (other.isSetPresetScriptIds()) { List __this__presetScriptIds = new ArrayList(other.presetScriptIds); this.presetScriptIds = __this__presetScriptIds; @@ -548,7 +572,9 @@ public class LectureRead implements org.apache.thrift.TBase getPresetNetworkSharesIterator() { + return (this.presetNetworkShares == null) ? null : this.presetNetworkShares.iterator(); + } + + public void addToPresetNetworkShares(int elem) { + if (this.presetNetworkShares == null) { + this.presetNetworkShares = new ArrayList(); + } + this.presetNetworkShares.add(elem); + } + + public List getPresetNetworkShares() { + return this.presetNetworkShares; + } + + public LectureRead setPresetNetworkShares(List presetNetworkShares) { + this.presetNetworkShares = presetNetworkShares; + return this; + } + + public void unsetPresetNetworkShares() { + this.presetNetworkShares = null; + } + + /** Returns true if field presetNetworkShares is set (has been assigned a value) and false otherwise */ + public boolean isSetPresetNetworkShares() { + return this.presetNetworkShares != null; + } + + public void setPresetNetworkSharesIsSet(boolean value) { + if (!value) { + this.presetNetworkShares = null; + } + } + public int getLdapFiltersSize() { return (this.ldapFilters == null) ? 0 : this.ldapFilters.size(); } @@ -1325,6 +1390,45 @@ public class LectureRead implements org.apache.thrift.TBase getPresetLdapFiltersIterator() { + return (this.presetLdapFilters == null) ? null : this.presetLdapFilters.iterator(); + } + + public void addToPresetLdapFilters(int elem) { + if (this.presetLdapFilters == null) { + this.presetLdapFilters = new ArrayList(); + } + this.presetLdapFilters.add(elem); + } + + public List getPresetLdapFilters() { + return this.presetLdapFilters; + } + + public LectureRead setPresetLdapFilters(List presetLdapFilters) { + this.presetLdapFilters = presetLdapFilters; + return this; + } + + public void unsetPresetLdapFilters() { + this.presetLdapFilters = null; + } + + /** Returns true if field presetLdapFilters is set (has been assigned a value) and false otherwise */ + public boolean isSetPresetLdapFilters() { + return this.presetLdapFilters != null; + } + + public void setPresetLdapFiltersIsSet(boolean value) { + if (!value) { + this.presetLdapFilters = null; + } + } + public int getPresetScriptIdsSize() { return (this.presetScriptIds == null) ? 0 : this.presetScriptIds.size(); } @@ -1590,6 +1694,14 @@ public class LectureRead implements org.apache.thrift.TBase)value); + } + break; + case LDAP_FILTERS: if (value == null) { unsetLdapFilters(); @@ -1598,6 +1710,14 @@ public class LectureRead implements org.apache.thrift.TBase)value); + } + break; + case PRESET_SCRIPT_IDS: if (value == null) { unsetPresetScriptIds(); @@ -1695,9 +1815,15 @@ public class LectureRead implements org.apache.thrift.TBase(_list201.size); - LdapFilter _elem202; + struct.presetNetworkShares = new ArrayList(_list201.size); + int _elem202; for (int _i203 = 0; _i203 < _list201.size; ++_i203) { - _elem202 = new LdapFilter(); - _elem202.read(iprot); - struct.ldapFilters.add(_elem202); + _elem202 = iprot.readI32(); + struct.presetNetworkShares.add(_elem202); } iprot.readListEnd(); } - struct.setLdapFiltersIsSet(true); + struct.setPresetNetworkSharesIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; - case 31: // PRESET_SCRIPT_IDS + case 30: // LDAP_FILTERS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { org.apache.thrift.protocol.TList _list204 = iprot.readListBegin(); - struct.presetScriptIds = new ArrayList(_list204.size); - int _elem205; + struct.ldapFilters = new ArrayList(_list204.size); + LdapFilter _elem205; for (int _i206 = 0; _i206 < _list204.size; ++_i206) { - _elem205 = iprot.readI32(); - struct.presetScriptIds.add(_elem205); + _elem205 = new LdapFilter(); + _elem205.read(iprot); + struct.ldapFilters.add(_elem205); + } + iprot.readListEnd(); + } + struct.setLdapFiltersIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 33: // PRESET_LDAP_FILTERS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list207 = iprot.readListBegin(); + struct.presetLdapFilters = new ArrayList(_list207.size); + int _elem208; + for (int _i209 = 0; _i209 < _list207.size; ++_i209) + { + _elem208 = iprot.readI32(); + struct.presetLdapFilters.add(_elem208); + } + iprot.readListEnd(); + } + struct.setPresetLdapFiltersIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 31: // PRESET_SCRIPT_IDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list210 = iprot.readListBegin(); + struct.presetScriptIds = new ArrayList(_list210.size); + int _elem211; + for (int _i212 = 0; _i212 < _list210.size; ++_i212) + { + _elem211 = iprot.readI32(); + struct.presetScriptIds.add(_elem211); } iprot.readListEnd(); } @@ -3175,9 +3409,9 @@ public class LectureRead implements org.apache.thrift.TBase(_list221.size); - String _elem222; - for (int _i223 = 0; _i223 < _list221.size; ++_i223) + org.apache.thrift.protocol.TList _list231 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.nics = new ArrayList(_list231.size); + String _elem232; + for (int _i233 = 0; _i233 < _list231.size; ++_i233) { - _elem222 = iprot.readString(); - struct.nics.add(_elem222); + _elem232 = iprot.readString(); + struct.nics.add(_elem232); } } struct.setNicsIsSet(true); } if (incoming.get(17)) { { - org.apache.thrift.protocol.TList _list224 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.allowedUsers = new ArrayList(_list224.size); - String _elem225; - for (int _i226 = 0; _i226 < _list224.size; ++_i226) + org.apache.thrift.protocol.TList _list234 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.allowedUsers = new ArrayList(_list234.size); + String _elem235; + for (int _i236 = 0; _i236 < _list234.size; ++_i236) { - _elem225 = iprot.readString(); - struct.allowedUsers.add(_elem225); + _elem235 = iprot.readString(); + struct.allowedUsers.add(_elem235); } } struct.setAllowedUsersIsSet(true); } if (incoming.get(18)) { { - org.apache.thrift.protocol.TList _list227 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.networkExceptions = new ArrayList(_list227.size); - NetRule _elem228; - for (int _i229 = 0; _i229 < _list227.size; ++_i229) + org.apache.thrift.protocol.TList _list237 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.networkExceptions = new ArrayList(_list237.size); + NetRule _elem238; + for (int _i239 = 0; _i239 < _list237.size; ++_i239) { - _elem228 = new NetRule(); - _elem228.read(iprot); - struct.networkExceptions.add(_elem228); + _elem238 = new NetRule(); + _elem238.read(iprot); + struct.networkExceptions.add(_elem238); } } struct.setNetworkExceptionsIsSet(true); @@ -3675,13 +3961,13 @@ public class LectureRead implements org.apache.thrift.TBase(_list230.size); - int _elem231; - for (int _i232 = 0; _i232 < _list230.size; ++_i232) + org.apache.thrift.protocol.TList _list240 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.locationIds = new ArrayList(_list240.size); + int _elem241; + for (int _i242 = 0; _i242 < _list240.size; ++_i242) { - _elem231 = iprot.readI32(); - struct.locationIds.add(_elem231); + _elem241 = iprot.readI32(); + struct.locationIds.add(_elem241); } } struct.setLocationIdsIsSet(true); @@ -3700,41 +3986,67 @@ public class LectureRead implements org.apache.thrift.TBase(_list233.size); - NetShare _elem234; - for (int _i235 = 0; _i235 < _list233.size; ++_i235) + org.apache.thrift.protocol.TList _list243 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.networkShares = new ArrayList(_list243.size); + NetShare _elem244; + for (int _i245 = 0; _i245 < _list243.size; ++_i245) { - _elem234 = new NetShare(); - _elem234.read(iprot); - struct.networkShares.add(_elem234); + _elem244 = new NetShare(); + _elem244.read(iprot); + struct.networkShares.add(_elem244); } } struct.setNetworkSharesIsSet(true); } if (incoming.get(28)) { { - org.apache.thrift.protocol.TList _list236 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.ldapFilters = new ArrayList(_list236.size); - LdapFilter _elem237; - for (int _i238 = 0; _i238 < _list236.size; ++_i238) + org.apache.thrift.protocol.TList _list246 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.presetNetworkShares = new ArrayList(_list246.size); + int _elem247; + for (int _i248 = 0; _i248 < _list246.size; ++_i248) { - _elem237 = new LdapFilter(); - _elem237.read(iprot); - struct.ldapFilters.add(_elem237); + _elem247 = iprot.readI32(); + struct.presetNetworkShares.add(_elem247); } } - struct.setLdapFiltersIsSet(true); + struct.setPresetNetworkSharesIsSet(true); } if (incoming.get(29)) { { - org.apache.thrift.protocol.TList _list239 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); - struct.presetScriptIds = new ArrayList(_list239.size); - int _elem240; - for (int _i241 = 0; _i241 < _list239.size; ++_i241) + org.apache.thrift.protocol.TList _list249 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.ldapFilters = new ArrayList(_list249.size); + LdapFilter _elem250; + for (int _i251 = 0; _i251 < _list249.size; ++_i251) + { + _elem250 = new LdapFilter(); + _elem250.read(iprot); + struct.ldapFilters.add(_elem250); + } + } + struct.setLdapFiltersIsSet(true); + } + if (incoming.get(30)) { + { + org.apache.thrift.protocol.TList _list252 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.presetLdapFilters = new ArrayList(_list252.size); + int _elem253; + for (int _i254 = 0; _i254 < _list252.size; ++_i254) + { + _elem253 = iprot.readI32(); + struct.presetLdapFilters.add(_elem253); + } + } + struct.setPresetLdapFiltersIsSet(true); + } + if (incoming.get(31)) { + { + org.apache.thrift.protocol.TList _list255 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.presetScriptIds = new ArrayList(_list255.size); + int _elem256; + for (int _i257 = 0; _i257 < _list255.size; ++_i257) { - _elem240 = iprot.readI32(); - struct.presetScriptIds.add(_elem240); + _elem256 = iprot.readI32(); + struct.presetScriptIds.add(_elem256); } } struct.setPresetScriptIdsIsSet(true); diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index 8b7af3f..bed99f8 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -348,7 +348,9 @@ struct LectureRead { 27: bool limitToAllowedUsers, 28: bool hasUsbAccess, 29: optional list networkShares, + 32: optional list presetNetworkShares, 30: optional list ldapFilters, + 33: optional list presetLdapFilters, 31: optional list presetScriptIds, } -- cgit v1.2.3-55-g7522