diff options
author | Simon Rettberg | 2025-04-01 17:40:37 +0200 |
---|---|---|
committer | Simon Rettberg | 2025-04-01 17:40:37 +0200 |
commit | d20757c8e695833767ce0f6091fab6b614bd27f4 (patch) | |
tree | fb9987fb6db69b702eab90e7d57f6d4271f39114 | |
parent | [libvirt] Make sure VMs have at least 5 spicevmc usb ports (diff) | |
download | master-sync-shared-d20757c.tar.gz master-sync-shared-d20757c.tar.xz master-sync-shared-d20757c.zip |
thrift: Add imagePath to ImageDetailsRead struct
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/ImageDetailsRead.java | 132 | ||||
-rw-r--r-- | src/main/thrift/bwlp.thrift | 1 |
2 files changed, 127 insertions, 6 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/ImageDetailsRead.java b/src/main/java/org/openslx/bwlp/thrift/iface/ImageDetailsRead.java index 62e6854..0a5d54b 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/ImageDetailsRead.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/ImageDetailsRead.java @@ -1,5 +1,5 @@ /** - * Autogenerated by Thrift Compiler (0.15.0) + * Autogenerated by Thrift Compiler (0.17.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated @@ -7,7 +7,7 @@ package org.openslx.bwlp.thrift.iface; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.15.0)", date = "2021-12-17") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.17.0)", date = "2025-04-01") public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRead, ImageDetailsRead._Fields>, java.io.Serializable, Cloneable, Comparable<ImageDetailsRead> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ImageDetailsRead"); @@ -27,6 +27,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea private static final org.apache.thrift.protocol.TField IS_TEMPLATE_FIELD_DESC = new org.apache.thrift.protocol.TField("isTemplate", org.apache.thrift.protocol.TType.BOOL, (short)15); 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)16); 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)18); + private static final org.apache.thrift.protocol.TField IMAGE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("imagePath", org.apache.thrift.protocol.TType.STRING, (short)19); private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new ImageDetailsReadStandardSchemeFactory(); private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new ImageDetailsReadTupleSchemeFactory(); @@ -51,6 +52,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea public boolean isTemplate; // required public @org.apache.thrift.annotation.Nullable ImagePermissions defaultPermissions; // required public @org.apache.thrift.annotation.Nullable ImagePermissions userPermissions; // optional + public @org.apache.thrift.annotation.Nullable java.lang.String imagePath; // 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 { @@ -73,7 +75,8 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea SHARE_MODE((short)14, "shareMode"), IS_TEMPLATE((short)15, "isTemplate"), DEFAULT_PERMISSIONS((short)16, "defaultPermissions"), - USER_PERMISSIONS((short)18, "userPermissions"); + USER_PERMISSIONS((short)18, "userPermissions"), + IMAGE_PATH((short)19, "imagePath"); private static final java.util.Map<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>(); @@ -121,6 +124,8 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea return DEFAULT_PERMISSIONS; case 18: // USER_PERMISSIONS return USER_PERMISSIONS; + case 19: // IMAGE_PATH + return IMAGE_PATH; default: return null; } @@ -152,10 +157,12 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea _fieldName = fieldName; } + @Override public short getThriftFieldId() { return _thriftId; } + @Override public java.lang.String getFieldName() { return _fieldName; } @@ -167,7 +174,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea private static final int __UPDATETIME_ISSET_ID = 2; private static final int __ISTEMPLATE_ISSET_ID = 3; private byte __isset_bitfield = 0; - private static final _Fields optionals[] = {_Fields.USER_PERMISSIONS}; + private static final _Fields optionals[] = {_Fields.USER_PERMISSIONS,_Fields.IMAGE_PATH}; public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; static { java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); @@ -205,6 +212,8 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImagePermissions.class))); tmpMap.put(_Fields.USER_PERMISSIONS, new org.apache.thrift.meta_data.FieldMetaData("userPermissions", org.apache.thrift.TFieldRequirementType.OPTIONAL, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ImagePermissions.class))); + tmpMap.put(_Fields.IMAGE_PATH, new org.apache.thrift.meta_data.FieldMetaData("imagePath", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ImageDetailsRead.class, metaDataMap); } @@ -301,8 +310,12 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea if (other.isSetUserPermissions()) { this.userPermissions = new ImagePermissions(other.userPermissions); } + if (other.isSetImagePath()) { + this.imagePath = other.imagePath; + } } + @Override public ImageDetailsRead deepCopy() { return new ImageDetailsRead(this); } @@ -329,6 +342,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea this.isTemplate = false; this.defaultPermissions = null; this.userPermissions = null; + this.imagePath = null; } @org.apache.thrift.annotation.Nullable @@ -763,6 +777,32 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea } } + @org.apache.thrift.annotation.Nullable + public java.lang.String getImagePath() { + return this.imagePath; + } + + public ImageDetailsRead setImagePath(@org.apache.thrift.annotation.Nullable java.lang.String imagePath) { + this.imagePath = imagePath; + return this; + } + + public void unsetImagePath() { + this.imagePath = null; + } + + /** Returns true if field imagePath is set (has been assigned a value) and false otherwise */ + public boolean isSetImagePath() { + return this.imagePath != null; + } + + public void setImagePathIsSet(boolean value) { + if (!value) { + this.imagePath = null; + } + } + + @Override public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) { switch (field) { case IMAGE_BASE_ID: @@ -893,10 +933,19 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea } break; + case IMAGE_PATH: + if (value == null) { + unsetImagePath(); + } else { + setImagePath((java.lang.String)value); + } + break; + } } @org.apache.thrift.annotation.Nullable + @Override public java.lang.Object getFieldValue(_Fields field) { switch (field) { case IMAGE_BASE_ID: @@ -947,11 +996,15 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea case USER_PERMISSIONS: return getUserPermissions(); + case IMAGE_PATH: + return getImagePath(); + } throw new java.lang.IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + @Override public boolean isSet(_Fields field) { if (field == null) { throw new java.lang.IllegalArgumentException(); @@ -990,6 +1043,8 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea return isSetDefaultPermissions(); case USER_PERMISSIONS: return isSetUserPermissions(); + case IMAGE_PATH: + return isSetImagePath(); } throw new java.lang.IllegalStateException(); } @@ -1151,6 +1206,15 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea return false; } + boolean this_present_imagePath = true && this.isSetImagePath(); + boolean that_present_imagePath = true && that.isSetImagePath(); + if (this_present_imagePath || that_present_imagePath) { + if (!(this_present_imagePath && that_present_imagePath)) + return false; + if (!this.imagePath.equals(that.imagePath)) + return false; + } + return true; } @@ -1214,6 +1278,10 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea if (isSetUserPermissions()) hashCode = hashCode * 8191 + userPermissions.hashCode(); + hashCode = hashCode * 8191 + ((isSetImagePath()) ? 131071 : 524287); + if (isSetImagePath()) + hashCode = hashCode * 8191 + imagePath.hashCode(); + return hashCode; } @@ -1385,18 +1453,31 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea return lastComparison; } } + lastComparison = java.lang.Boolean.compare(isSetImagePath(), other.isSetImagePath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagePath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagePath, other.imagePath); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @org.apache.thrift.annotation.Nullable + @Override public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } + @Override public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { scheme(iprot).read(iprot, this); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { scheme(oprot).write(oprot, this); } @@ -1519,6 +1600,16 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea } first = false; } + if (isSetImagePath()) { + if (!first) sb.append(", "); + sb.append("imagePath:"); + if (this.imagePath == null) { + sb.append("null"); + } else { + sb.append(this.imagePath); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -1553,6 +1644,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea } private static class ImageDetailsReadStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ImageDetailsReadStandardScheme getScheme() { return new ImageDetailsReadStandardScheme(); } @@ -1560,6 +1652,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea private static class ImageDetailsReadStandardScheme extends org.apache.thrift.scheme.StandardScheme<ImageDetailsRead> { + @Override public void read(org.apache.thrift.protocol.TProtocol iprot, ImageDetailsRead struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TField schemeField; iprot.readStructBegin(); @@ -1721,6 +1814,14 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 19: // IMAGE_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagePath = iprot.readString(); + struct.setImagePathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -1732,6 +1833,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea struct.validate(); } + @Override public void write(org.apache.thrift.protocol.TProtocol oprot, ImageDetailsRead struct) throws org.apache.thrift.TException { struct.validate(); @@ -1824,6 +1926,13 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea oprot.writeFieldEnd(); } } + if (struct.imagePath != null) { + if (struct.isSetImagePath()) { + oprot.writeFieldBegin(IMAGE_PATH_FIELD_DESC); + oprot.writeString(struct.imagePath); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -1831,6 +1940,7 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea } private static class ImageDetailsReadTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory { + @Override public ImageDetailsReadTupleScheme getScheme() { return new ImageDetailsReadTupleScheme(); } @@ -1890,7 +2000,10 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea if (struct.isSetUserPermissions()) { optionals.set(15); } - oprot.writeBitSet(optionals, 16); + if (struct.isSetImagePath()) { + optionals.set(16); + } + oprot.writeBitSet(optionals, 17); if (struct.isSetImageBaseId()) { oprot.writeString(struct.imageBaseId); } @@ -1951,12 +2064,15 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea if (struct.isSetUserPermissions()) { struct.userPermissions.write(oprot); } + if (struct.isSetImagePath()) { + oprot.writeString(struct.imagePath); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, ImageDetailsRead struct) throws org.apache.thrift.TException { org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(16); + java.util.BitSet incoming = iprot.readBitSet(17); if (incoming.get(0)) { struct.imageBaseId = iprot.readString(); struct.setImageBaseIdIsSet(true); @@ -2042,6 +2158,10 @@ public class ImageDetailsRead implements org.apache.thrift.TBase<ImageDetailsRea struct.userPermissions.read(iprot); struct.setUserPermissionsIsSet(true); } + if (incoming.get(16)) { + struct.imagePath = iprot.readString(); + struct.setImagePathIsSet(true); + } } } diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index ad9f704..d2c02b1 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -227,6 +227,7 @@ struct ImageDetailsRead { 15: bool isTemplate, 16: ImagePermissions defaultPermissions, 18: optional ImagePermissions userPermissions, + 19: optional string imagePath, // Null if no download permission, internal image path otherwise } struct ImagePublishData { |