diff options
author | Simon Rettberg | 2021-04-21 15:30:08 +0200 |
---|---|---|
committer | Simon Rettberg | 2021-04-21 15:30:08 +0200 |
commit | d5a66fb704cafa593a6f15c5463ea052f27647a5 (patch) | |
tree | 78158d26afc0112e4b9bd50ae3973185f784c4da | |
parent | [vm/DiskImage] Remove File constructor, make sure open file doesn't leak (diff) | |
download | master-sync-shared-d5a66fb704cafa593a6f15c5463ea052f27647a5.tar.gz master-sync-shared-d5a66fb704cafa593a6f15c5463ea052f27647a5.tar.xz master-sync-shared-d5a66fb704cafa593a6f15c5463ea052f27647a5.zip |
[thrift] Add allowStudentDownload to SatelliteConfig
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java | 110 | ||||
-rw-r--r-- | src/main/thrift/bwlp.thrift | 2 |
2 files changed, 107 insertions, 5 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java index 4737596..0dc1800 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteConfig.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 = "2019-02-22") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2021-04-21") public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, SatelliteConfig._Fields>, java.io.Serializable, Cloneable, Comparable<SatelliteConfig> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SatelliteConfig"); @@ -48,6 +48,7 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, private static final org.apache.thrift.protocol.TField MAX_LOCATIONS_PER_LECTURE_FIELD_DESC = new org.apache.thrift.protocol.TField("maxLocationsPerLecture", org.apache.thrift.protocol.TType.I32, (short)8); private static final org.apache.thrift.protocol.TField ALLOW_LOGIN_BY_DEFAULT_FIELD_DESC = new org.apache.thrift.protocol.TField("allowLoginByDefault", org.apache.thrift.protocol.TType.BOOL, (short)9); private static final org.apache.thrift.protocol.TField SERVER_SIDE_COPY_FIELD_DESC = new org.apache.thrift.protocol.TField("serverSideCopy", org.apache.thrift.protocol.TType.I32, (short)10); + private static final org.apache.thrift.protocol.TField ALLOW_STUDENT_DOWNLOAD_FIELD_DESC = new org.apache.thrift.protocol.TField("allowStudentDownload", org.apache.thrift.protocol.TType.BOOL, (short)11); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -69,6 +70,7 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, * @see SscMode */ public SscMode serverSideCopy; // optional + public boolean allowStudentDownload; // 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 { @@ -85,7 +87,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, * * @see SscMode */ - SERVER_SIDE_COPY((short)10, "serverSideCopy"); + SERVER_SIDE_COPY((short)10, "serverSideCopy"), + ALLOW_STUDENT_DOWNLOAD((short)11, "allowStudentDownload"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -120,6 +123,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, return ALLOW_LOGIN_BY_DEFAULT; case 10: // SERVER_SIDE_COPY return SERVER_SIDE_COPY; + case 11: // ALLOW_STUDENT_DOWNLOAD + return ALLOW_STUDENT_DOWNLOAD; default: return null; } @@ -167,8 +172,9 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, private static final int __MAXCONNECTIONSPERTRANSFER_ISSET_ID = 4; private static final int __MAXLOCATIONSPERLECTURE_ISSET_ID = 5; private static final int __ALLOWLOGINBYDEFAULT_ISSET_ID = 6; + private static final int __ALLOWSTUDENTDOWNLOAD_ISSET_ID = 7; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.MAX_TRANSFERS,_Fields.MAX_CONNECTIONS_PER_TRANSFER,_Fields.MAX_LOCATIONS_PER_LECTURE,_Fields.ALLOW_LOGIN_BY_DEFAULT,_Fields.SERVER_SIDE_COPY}; + private static final _Fields optionals[] = {_Fields.MAX_TRANSFERS,_Fields.MAX_CONNECTIONS_PER_TRANSFER,_Fields.MAX_LOCATIONS_PER_LECTURE,_Fields.ALLOW_LOGIN_BY_DEFAULT,_Fields.SERVER_SIDE_COPY,_Fields.ALLOW_STUDENT_DOWNLOAD}; 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); @@ -192,6 +198,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); tmpMap.put(_Fields.SERVER_SIDE_COPY, new org.apache.thrift.meta_data.FieldMetaData("serverSideCopy", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, SscMode.class))); + tmpMap.put(_Fields.ALLOW_STUDENT_DOWNLOAD, new org.apache.thrift.meta_data.FieldMetaData("allowStudentDownload", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(SatelliteConfig.class, metaDataMap); } @@ -238,6 +246,7 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, if (other.isSetServerSideCopy()) { this.serverSideCopy = other.serverSideCopy; } + this.allowStudentDownload = other.allowStudentDownload; } public SatelliteConfig deepCopy() { @@ -263,6 +272,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, setAllowLoginByDefaultIsSet(false); this.allowLoginByDefault = false; this.serverSideCopy = null; + setAllowStudentDownloadIsSet(false); + this.allowStudentDownload = false; } public int getPageSize() { @@ -506,6 +517,29 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, } } + public boolean isAllowStudentDownload() { + return this.allowStudentDownload; + } + + public SatelliteConfig setAllowStudentDownload(boolean allowStudentDownload) { + this.allowStudentDownload = allowStudentDownload; + setAllowStudentDownloadIsSet(true); + return this; + } + + public void unsetAllowStudentDownload() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ALLOWSTUDENTDOWNLOAD_ISSET_ID); + } + + /** Returns true if field allowStudentDownload is set (has been assigned a value) and false otherwise */ + public boolean isSetAllowStudentDownload() { + return EncodingUtils.testBit(__isset_bitfield, __ALLOWSTUDENTDOWNLOAD_ISSET_ID); + } + + public void setAllowStudentDownloadIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ALLOWSTUDENTDOWNLOAD_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case PAGE_SIZE: @@ -588,6 +622,14 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, } break; + case ALLOW_STUDENT_DOWNLOAD: + if (value == null) { + unsetAllowStudentDownload(); + } else { + setAllowStudentDownload((Boolean)value); + } + break; + } } @@ -623,6 +665,9 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, case SERVER_SIDE_COPY: return getServerSideCopy(); + case ALLOW_STUDENT_DOWNLOAD: + return isAllowStudentDownload(); + } throw new IllegalStateException(); } @@ -654,6 +699,8 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, return isSetAllowLoginByDefault(); case SERVER_SIDE_COPY: return isSetServerSideCopy(); + case ALLOW_STUDENT_DOWNLOAD: + return isSetAllowStudentDownload(); } throw new IllegalStateException(); } @@ -761,6 +808,15 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, return false; } + boolean this_present_allowStudentDownload = true && this.isSetAllowStudentDownload(); + boolean that_present_allowStudentDownload = true && that.isSetAllowStudentDownload(); + if (this_present_allowStudentDownload || that_present_allowStudentDownload) { + if (!(this_present_allowStudentDownload && that_present_allowStudentDownload)) + return false; + if (this.allowStudentDownload != that.allowStudentDownload) + return false; + } + return true; } @@ -818,6 +874,11 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, if (present_serverSideCopy) list.add(serverSideCopy.getValue()); + boolean present_allowStudentDownload = true && (isSetAllowStudentDownload()); + list.add(present_allowStudentDownload); + if (present_allowStudentDownload) + list.add(allowStudentDownload); + return list.hashCode(); } @@ -929,6 +990,16 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, return lastComparison; } } + lastComparison = Boolean.valueOf(isSetAllowStudentDownload()).compareTo(other.isSetAllowStudentDownload()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAllowStudentDownload()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.allowStudentDownload, other.allowStudentDownload); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -1010,6 +1081,12 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, } first = false; } + if (isSetAllowStudentDownload()) { + if (!first) sb.append(", "); + sb.append("allowStudentDownload:"); + sb.append(this.allowStudentDownload); + first = false; + } sb.append(")"); return sb.toString(); } @@ -1143,6 +1220,14 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 11: // ALLOW_STUDENT_DOWNLOAD + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.allowStudentDownload = iprot.readBool(); + struct.setAllowStudentDownloadIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -1204,6 +1289,11 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, oprot.writeFieldEnd(); } } + if (struct.isSetAllowStudentDownload()) { + oprot.writeFieldBegin(ALLOW_STUDENT_DOWNLOAD_FIELD_DESC); + oprot.writeBool(struct.allowStudentDownload); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1252,7 +1342,10 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, if (struct.isSetServerSideCopy()) { optionals.set(9); } - oprot.writeBitSet(optionals, 10); + if (struct.isSetAllowStudentDownload()) { + optionals.set(10); + } + oprot.writeBitSet(optionals, 11); if (struct.isSetPageSize()) { oprot.writeI32(struct.pageSize); } @@ -1283,12 +1376,15 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, if (struct.isSetServerSideCopy()) { oprot.writeI32(struct.serverSideCopy.getValue()); } + if (struct.isSetAllowStudentDownload()) { + oprot.writeBool(struct.allowStudentDownload); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, SatelliteConfig struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(10); + BitSet incoming = iprot.readBitSet(11); if (incoming.get(0)) { struct.pageSize = iprot.readI32(); struct.setPageSizeIsSet(true); @@ -1331,6 +1427,10 @@ public class SatelliteConfig implements org.apache.thrift.TBase<SatelliteConfig, struct.serverSideCopy = org.openslx.bwlp.thrift.iface.SscMode.findByValue(iprot.readI32()); struct.setServerSideCopyIsSet(true); } + if (incoming.get(10)) { + struct.allowStudentDownload = iprot.readBool(); + struct.setAllowStudentDownloadIsSet(true); + } } } diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index 3fc9c5a..9b4c008 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -423,6 +423,8 @@ struct SatelliteConfig { 9: optional bool allowLoginByDefault, // ServerSide Copy on, off, auto or controlled by user 10: optional SscMode serverSideCopy, + // Students are allowed to download non-restricted images? + 11: optional bool allowStudentDownload, } struct SatelliteStatus { |