From df9ea600ce311bdf907678d0da94eea5b39d890f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 18 Aug 2015 19:48:59 +0200 Subject: First working version with SSL support --- .../bwlp/thrift/iface/TransferInformation.java | 260 ++++++++++++++++++++- 1 file changed, 257 insertions(+), 3 deletions(-) (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java') diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java index ea6777b..d5f73b0 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TransferInformation.java @@ -38,6 +38,8 @@ public class TransferInformation implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -48,12 +50,16 @@ public class TransferInformation implements org.apache.thrift.TBase blockHashes; // optional + public String machineDescription; // 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 { TOKEN((short)1, "token"), PLAIN_PORT((short)2, "plainPort"), - SSL_PORT((short)3, "sslPort"); + SSL_PORT((short)3, "sslPort"), + BLOCK_HASHES((short)4, "blockHashes"), + MACHINE_DESCRIPTION((short)5, "machineDescription"); private static final Map byName = new HashMap(); @@ -74,6 +80,10 @@ public class TransferInformation 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); @@ -126,6 +137,11 @@ public class TransferInformation implements org.apache.thrift.TBase __this__blockHashes = new ArrayList(other.blockHashes); + this.blockHashes = __this__blockHashes; + } + if (other.isSetMachineDescription()) { + this.machineDescription = other.machineDescription; + } } public TransferInformation deepCopy() { @@ -169,6 +192,8 @@ public class TransferInformation implements org.apache.thrift.TBase getBlockHashesIterator() { + return (this.blockHashes == null) ? null : this.blockHashes.iterator(); + } + + public void addToBlockHashes(ByteBuffer elem) { + if (this.blockHashes == null) { + this.blockHashes = new ArrayList(); + } + this.blockHashes.add(elem); + } + + public List getBlockHashes() { + return this.blockHashes; + } + + public TransferInformation setBlockHashes(List blockHashes) { + this.blockHashes = blockHashes; + return this; + } + + public void unsetBlockHashes() { + this.blockHashes = null; + } + + /** Returns true if field blockHashes is set (has been assigned a value) and false otherwise */ + public boolean isSetBlockHashes() { + return this.blockHashes != null; + } + + public void setBlockHashesIsSet(boolean value) { + if (!value) { + this.blockHashes = null; + } + } + + public String getMachineDescription() { + return this.machineDescription; + } + + public TransferInformation setMachineDescription(String machineDescription) { + this.machineDescription = machineDescription; + return this; + } + + public void unsetMachineDescription() { + this.machineDescription = null; + } + + /** Returns true if field machineDescription is set (has been assigned a value) and false otherwise */ + public boolean isSetMachineDescription() { + return this.machineDescription != null; + } + + public void setMachineDescriptionIsSet(boolean value) { + if (!value) { + this.machineDescription = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case TOKEN: @@ -267,6 +355,22 @@ public class TransferInformation implements org.apache.thrift.TBase)value); + } + break; + + case MACHINE_DESCRIPTION: + if (value == null) { + unsetMachineDescription(); + } else { + setMachineDescription((String)value); + } + break; + } } @@ -281,6 +385,12 @@ public class TransferInformation implements org.apache.thrift.TBase(_list130.size); + for (int _i131 = 0; _i131 < _list130.size; ++_i131) + { + ByteBuffer _elem132; + _elem132 = iprot.readBinary(); + struct.blockHashes.add(_elem132); + } + iprot.readListEnd(); + } + struct.setBlockHashesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // MACHINE_DESCRIPTION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.machineDescription = iprot.readString(); + struct.setMachineDescriptionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -518,6 +716,27 @@ public class TransferInformation implements org.apache.thrift.TBase(_list135.size); + for (int _i136 = 0; _i136 < _list135.size; ++_i136) + { + ByteBuffer _elem137; + _elem137 = iprot.readBinary(); + struct.blockHashes.add(_elem137); + } + } + struct.setBlockHashesIsSet(true); + } + if (incoming.get(4)) { + struct.machineDescription = iprot.readString(); + struct.setMachineDescriptionIsSet(true); + } } } -- cgit v1.2.3-55-g7522