diff options
8 files changed, 919 insertions, 581 deletions
diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/MasterServer.java b/src/main/java/org/openslx/bwlp/thrift/iface/MasterServer.java index 8ea6981..d46bee9 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/MasterServer.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/MasterServer.java @@ -6116,14 +6116,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list234 = iprot.readListBegin(); - struct.success = new ArrayList<UserInfo>(_list234.size); - for (int _i235 = 0; _i235 < _list234.size; ++_i235) + org.apache.thrift.protocol.TList _list242 = iprot.readListBegin(); + struct.success = new ArrayList<UserInfo>(_list242.size); + for (int _i243 = 0; _i243 < _list242.size; ++_i243) { - UserInfo _elem236; - _elem236 = new UserInfo(); - _elem236.read(iprot); - struct.success.add(_elem236); + UserInfo _elem244; + _elem244 = new UserInfo(); + _elem244.read(iprot); + struct.success.add(_elem244); } iprot.readListEnd(); } @@ -6160,9 +6160,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (UserInfo _iter237 : struct.success) + for (UserInfo _iter245 : struct.success) { - _iter237.write(oprot); + _iter245.write(oprot); } oprot.writeListEnd(); } @@ -6201,9 +6201,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (UserInfo _iter238 : struct.success) + for (UserInfo _iter246 : struct.success) { - _iter238.write(oprot); + _iter246.write(oprot); } } } @@ -6218,14 +6218,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list239 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<UserInfo>(_list239.size); - for (int _i240 = 0; _i240 < _list239.size; ++_i240) + org.apache.thrift.protocol.TList _list247 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<UserInfo>(_list247.size); + for (int _i248 = 0; _i248 < _list247.size; ++_i248) { - UserInfo _elem241; - _elem241 = new UserInfo(); - _elem241.read(iprot); - struct.success.add(_elem241); + UserInfo _elem249; + _elem249 = new UserInfo(); + _elem249.read(iprot); + struct.success.add(_elem249); } } struct.setSuccessIsSet(true); @@ -7078,14 +7078,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list242 = iprot.readListBegin(); - struct.success = new ArrayList<ImagePublishData>(_list242.size); - for (int _i243 = 0; _i243 < _list242.size; ++_i243) + org.apache.thrift.protocol.TList _list250 = iprot.readListBegin(); + struct.success = new ArrayList<ImagePublishData>(_list250.size); + for (int _i251 = 0; _i251 < _list250.size; ++_i251) { - ImagePublishData _elem244; - _elem244 = new ImagePublishData(); - _elem244.read(iprot); - struct.success.add(_elem244); + ImagePublishData _elem252; + _elem252 = new ImagePublishData(); + _elem252.read(iprot); + struct.success.add(_elem252); } iprot.readListEnd(); } @@ -7122,9 +7122,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (ImagePublishData _iter245 : struct.success) + for (ImagePublishData _iter253 : struct.success) { - _iter245.write(oprot); + _iter253.write(oprot); } oprot.writeListEnd(); } @@ -7163,9 +7163,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (ImagePublishData _iter246 : struct.success) + for (ImagePublishData _iter254 : struct.success) { - _iter246.write(oprot); + _iter254.write(oprot); } } } @@ -7180,14 +7180,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list247 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<ImagePublishData>(_list247.size); - for (int _i248 = 0; _i248 < _list247.size; ++_i248) + org.apache.thrift.protocol.TList _list255 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<ImagePublishData>(_list255.size); + for (int _i256 = 0; _i256 < _list255.size; ++_i256) { - ImagePublishData _elem249; - _elem249 = new ImagePublishData(); - _elem249.read(iprot); - struct.success.add(_elem249); + ImagePublishData _elem257; + _elem257 = new ImagePublishData(); + _elem257.read(iprot); + struct.success.add(_elem257); } } struct.setSuccessIsSet(true); @@ -10952,13 +10952,13 @@ public class MasterServer { case 3: // BLOCK_HASHES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list250 = iprot.readListBegin(); - struct.blockHashes = new ArrayList<ByteBuffer>(_list250.size); - for (int _i251 = 0; _i251 < _list250.size; ++_i251) + org.apache.thrift.protocol.TList _list258 = iprot.readListBegin(); + struct.blockHashes = new ArrayList<ByteBuffer>(_list258.size); + for (int _i259 = 0; _i259 < _list258.size; ++_i259) { - ByteBuffer _elem252; - _elem252 = iprot.readBinary(); - struct.blockHashes.add(_elem252); + ByteBuffer _elem260; + _elem260 = iprot.readBinary(); + struct.blockHashes.add(_elem260); } iprot.readListEnd(); } @@ -10996,9 +10996,9 @@ public class MasterServer { oprot.writeFieldBegin(BLOCK_HASHES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.blockHashes.size())); - for (ByteBuffer _iter253 : struct.blockHashes) + for (ByteBuffer _iter261 : struct.blockHashes) { - oprot.writeBinary(_iter253); + oprot.writeBinary(_iter261); } oprot.writeListEnd(); } @@ -11041,9 +11041,9 @@ public class MasterServer { if (struct.isSetBlockHashes()) { { oprot.writeI32(struct.blockHashes.size()); - for (ByteBuffer _iter254 : struct.blockHashes) + for (ByteBuffer _iter262 : struct.blockHashes) { - oprot.writeBinary(_iter254); + oprot.writeBinary(_iter262); } } } @@ -11064,13 +11064,13 @@ public class MasterServer { } if (incoming.get(2)) { { - org.apache.thrift.protocol.TList _list255 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.blockHashes = new ArrayList<ByteBuffer>(_list255.size); - for (int _i256 = 0; _i256 < _list255.size; ++_i256) + org.apache.thrift.protocol.TList _list263 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.blockHashes = new ArrayList<ByteBuffer>(_list263.size); + for (int _i264 = 0; _i264 < _list263.size; ++_i264) { - ByteBuffer _elem257; - _elem257 = iprot.readBinary(); - struct.blockHashes.add(_elem257); + ByteBuffer _elem265; + _elem265 = iprot.readBinary(); + struct.blockHashes.add(_elem265); } } struct.setBlockHashesIsSet(true); @@ -15210,14 +15210,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list258 = iprot.readListBegin(); - struct.success = new ArrayList<Organization>(_list258.size); - for (int _i259 = 0; _i259 < _list258.size; ++_i259) + org.apache.thrift.protocol.TList _list266 = iprot.readListBegin(); + struct.success = new ArrayList<Organization>(_list266.size); + for (int _i267 = 0; _i267 < _list266.size; ++_i267) { - Organization _elem260; - _elem260 = new Organization(); - _elem260.read(iprot); - struct.success.add(_elem260); + Organization _elem268; + _elem268 = new Organization(); + _elem268.read(iprot); + struct.success.add(_elem268); } iprot.readListEnd(); } @@ -15254,9 +15254,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Organization _iter261 : struct.success) + for (Organization _iter269 : struct.success) { - _iter261.write(oprot); + _iter269.write(oprot); } oprot.writeListEnd(); } @@ -15295,9 +15295,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Organization _iter262 : struct.success) + for (Organization _iter270 : struct.success) { - _iter262.write(oprot); + _iter270.write(oprot); } } } @@ -15312,14 +15312,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list263 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<Organization>(_list263.size); - for (int _i264 = 0; _i264 < _list263.size; ++_i264) + org.apache.thrift.protocol.TList _list271 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<Organization>(_list271.size); + for (int _i272 = 0; _i272 < _list271.size; ++_i272) { - Organization _elem265; - _elem265 = new Organization(); - _elem265.read(iprot); - struct.success.add(_elem265); + Organization _elem273; + _elem273 = new Organization(); + _elem273.read(iprot); + struct.success.add(_elem273); } } struct.setSuccessIsSet(true); @@ -15966,14 +15966,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list266 = iprot.readListBegin(); - struct.success = new ArrayList<OperatingSystem>(_list266.size); - for (int _i267 = 0; _i267 < _list266.size; ++_i267) + org.apache.thrift.protocol.TList _list274 = iprot.readListBegin(); + struct.success = new ArrayList<OperatingSystem>(_list274.size); + for (int _i275 = 0; _i275 < _list274.size; ++_i275) { - OperatingSystem _elem268; - _elem268 = new OperatingSystem(); - _elem268.read(iprot); - struct.success.add(_elem268); + OperatingSystem _elem276; + _elem276 = new OperatingSystem(); + _elem276.read(iprot); + struct.success.add(_elem276); } iprot.readListEnd(); } @@ -16010,9 +16010,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (OperatingSystem _iter269 : struct.success) + for (OperatingSystem _iter277 : struct.success) { - _iter269.write(oprot); + _iter277.write(oprot); } oprot.writeListEnd(); } @@ -16051,9 +16051,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (OperatingSystem _iter270 : struct.success) + for (OperatingSystem _iter278 : struct.success) { - _iter270.write(oprot); + _iter278.write(oprot); } } } @@ -16068,14 +16068,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list271 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<OperatingSystem>(_list271.size); - for (int _i272 = 0; _i272 < _list271.size; ++_i272) + org.apache.thrift.protocol.TList _list279 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<OperatingSystem>(_list279.size); + for (int _i280 = 0; _i280 < _list279.size; ++_i280) { - OperatingSystem _elem273; - _elem273 = new OperatingSystem(); - _elem273.read(iprot); - struct.success.add(_elem273); + OperatingSystem _elem281; + _elem281 = new OperatingSystem(); + _elem281.read(iprot); + struct.success.add(_elem281); } } struct.setSuccessIsSet(true); @@ -16722,14 +16722,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list274 = iprot.readListBegin(); - struct.success = new ArrayList<Virtualizer>(_list274.size); - for (int _i275 = 0; _i275 < _list274.size; ++_i275) + org.apache.thrift.protocol.TList _list282 = iprot.readListBegin(); + struct.success = new ArrayList<Virtualizer>(_list282.size); + for (int _i283 = 0; _i283 < _list282.size; ++_i283) { - Virtualizer _elem276; - _elem276 = new Virtualizer(); - _elem276.read(iprot); - struct.success.add(_elem276); + Virtualizer _elem284; + _elem284 = new Virtualizer(); + _elem284.read(iprot); + struct.success.add(_elem284); } iprot.readListEnd(); } @@ -16766,9 +16766,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Virtualizer _iter277 : struct.success) + for (Virtualizer _iter285 : struct.success) { - _iter277.write(oprot); + _iter285.write(oprot); } oprot.writeListEnd(); } @@ -16807,9 +16807,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Virtualizer _iter278 : struct.success) + for (Virtualizer _iter286 : struct.success) { - _iter278.write(oprot); + _iter286.write(oprot); } } } @@ -16824,14 +16824,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list279 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<Virtualizer>(_list279.size); - for (int _i280 = 0; _i280 < _list279.size; ++_i280) + org.apache.thrift.protocol.TList _list287 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<Virtualizer>(_list287.size); + for (int _i288 = 0; _i288 < _list287.size; ++_i288) { - Virtualizer _elem281; - _elem281 = new Virtualizer(); - _elem281.read(iprot); - struct.success.add(_elem281); + Virtualizer _elem289; + _elem289 = new Virtualizer(); + _elem289.read(iprot); + struct.success.add(_elem289); } } struct.setSuccessIsSet(true); @@ -17584,14 +17584,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list282 = iprot.readListBegin(); - struct.success = new ArrayList<MasterTag>(_list282.size); - for (int _i283 = 0; _i283 < _list282.size; ++_i283) + org.apache.thrift.protocol.TList _list290 = iprot.readListBegin(); + struct.success = new ArrayList<MasterTag>(_list290.size); + for (int _i291 = 0; _i291 < _list290.size; ++_i291) { - MasterTag _elem284; - _elem284 = new MasterTag(); - _elem284.read(iprot); - struct.success.add(_elem284); + MasterTag _elem292; + _elem292 = new MasterTag(); + _elem292.read(iprot); + struct.success.add(_elem292); } iprot.readListEnd(); } @@ -17628,9 +17628,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (MasterTag _iter285 : struct.success) + for (MasterTag _iter293 : struct.success) { - _iter285.write(oprot); + _iter293.write(oprot); } oprot.writeListEnd(); } @@ -17669,9 +17669,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (MasterTag _iter286 : struct.success) + for (MasterTag _iter294 : struct.success) { - _iter286.write(oprot); + _iter294.write(oprot); } } } @@ -17686,14 +17686,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list287 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<MasterTag>(_list287.size); - for (int _i288 = 0; _i288 < _list287.size; ++_i288) + org.apache.thrift.protocol.TList _list295 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<MasterTag>(_list295.size); + for (int _i296 = 0; _i296 < _list295.size; ++_i296) { - MasterTag _elem289; - _elem289 = new MasterTag(); - _elem289.read(iprot); - struct.success.add(_elem289); + MasterTag _elem297; + _elem297 = new MasterTag(); + _elem297.read(iprot); + struct.success.add(_elem297); } } struct.setSuccessIsSet(true); @@ -18446,14 +18446,14 @@ public class MasterServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list290 = iprot.readListBegin(); - struct.success = new ArrayList<MasterSoftware>(_list290.size); - for (int _i291 = 0; _i291 < _list290.size; ++_i291) + org.apache.thrift.protocol.TList _list298 = iprot.readListBegin(); + struct.success = new ArrayList<MasterSoftware>(_list298.size); + for (int _i299 = 0; _i299 < _list298.size; ++_i299) { - MasterSoftware _elem292; - _elem292 = new MasterSoftware(); - _elem292.read(iprot); - struct.success.add(_elem292); + MasterSoftware _elem300; + _elem300 = new MasterSoftware(); + _elem300.read(iprot); + struct.success.add(_elem300); } iprot.readListEnd(); } @@ -18490,9 +18490,9 @@ public class MasterServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (MasterSoftware _iter293 : struct.success) + for (MasterSoftware _iter301 : struct.success) { - _iter293.write(oprot); + _iter301.write(oprot); } oprot.writeListEnd(); } @@ -18531,9 +18531,9 @@ public class MasterServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (MasterSoftware _iter294 : struct.success) + for (MasterSoftware _iter302 : struct.success) { - _iter294.write(oprot); + _iter302.write(oprot); } } } @@ -18548,14 +18548,14 @@ public class MasterServer { BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list295 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<MasterSoftware>(_list295.size); - for (int _i296 = 0; _i296 < _list295.size; ++_i296) + org.apache.thrift.protocol.TList _list303 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<MasterSoftware>(_list303.size); + for (int _i304 = 0; _i304 < _list303.size; ++_i304) { - MasterSoftware _elem297; - _elem297 = new MasterSoftware(); - _elem297.read(iprot); - struct.success.add(_elem297); + MasterSoftware _elem305; + _elem305 = new MasterSoftware(); + _elem305.read(iprot); + struct.success.add(_elem305); } } struct.setSuccessIsSet(true); diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/Satellite.java b/src/main/java/org/openslx/bwlp/thrift/iface/Satellite.java index 81365b7..f2c205c 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/Satellite.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/Satellite.java @@ -37,6 +37,7 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ private static final org.apache.thrift.protocol.TField ADDRESS_LIST_FIELD_DESC = new org.apache.thrift.protocol.TField("addressList", org.apache.thrift.protocol.TType.LIST, (short)1); private static final org.apache.thrift.protocol.TField DISPLAY_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("displayName", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField CERT_SHA256_FIELD_DESC = new org.apache.thrift.protocol.TField("certSha256", org.apache.thrift.protocol.TType.STRING, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -46,11 +47,13 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ public List<String> addressList; // required public String displayName; // required + public ByteBuffer certSha256; // 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 { ADDRESS_LIST((short)1, "addressList"), - DISPLAY_NAME((short)2, "displayName"); + DISPLAY_NAME((short)2, "displayName"), + CERT_SHA256((short)3, "certSha256"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -69,6 +72,8 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ return ADDRESS_LIST; case 2: // DISPLAY_NAME return DISPLAY_NAME; + case 3: // CERT_SHA256 + return CERT_SHA256; default: return null; } @@ -117,6 +122,8 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); tmpMap.put(_Fields.DISPLAY_NAME, new org.apache.thrift.meta_data.FieldMetaData("displayName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.CERT_SHA256, new org.apache.thrift.meta_data.FieldMetaData("certSha256", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(Satellite.class, metaDataMap); } @@ -126,11 +133,13 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ public Satellite( List<String> addressList, - String displayName) + String displayName, + ByteBuffer certSha256) { this(); this.addressList = addressList; this.displayName = displayName; + this.certSha256 = certSha256; } /** @@ -144,6 +153,10 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ if (other.isSetDisplayName()) { this.displayName = other.displayName; } + if (other.isSetCertSha256()) { + this.certSha256 = org.apache.thrift.TBaseHelper.copyBinary(other.certSha256); +; + } } public Satellite deepCopy() { @@ -154,6 +167,7 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ public void clear() { this.addressList = null; this.displayName = null; + this.certSha256 = null; } public int getAddressListSize() { @@ -219,6 +233,40 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ } } + public byte[] getCertSha256() { + setCertSha256(org.apache.thrift.TBaseHelper.rightSize(certSha256)); + return certSha256 == null ? null : certSha256.array(); + } + + public ByteBuffer bufferForCertSha256() { + return certSha256; + } + + public Satellite setCertSha256(byte[] certSha256) { + setCertSha256(certSha256 == null ? (ByteBuffer)null : ByteBuffer.wrap(certSha256)); + return this; + } + + public Satellite setCertSha256(ByteBuffer certSha256) { + this.certSha256 = certSha256; + return this; + } + + public void unsetCertSha256() { + this.certSha256 = null; + } + + /** Returns true if field certSha256 is set (has been assigned a value) and false otherwise */ + public boolean isSetCertSha256() { + return this.certSha256 != null; + } + + public void setCertSha256IsSet(boolean value) { + if (!value) { + this.certSha256 = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ADDRESS_LIST: @@ -237,6 +285,14 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ } break; + case CERT_SHA256: + if (value == null) { + unsetCertSha256(); + } else { + setCertSha256((ByteBuffer)value); + } + break; + } } @@ -248,6 +304,9 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ case DISPLAY_NAME: return getDisplayName(); + case CERT_SHA256: + return getCertSha256(); + } throw new IllegalStateException(); } @@ -263,6 +322,8 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ return isSetAddressList(); case DISPLAY_NAME: return isSetDisplayName(); + case CERT_SHA256: + return isSetCertSha256(); } throw new IllegalStateException(); } @@ -298,6 +359,15 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ return false; } + boolean this_present_certSha256 = true && this.isSetCertSha256(); + boolean that_present_certSha256 = true && that.isSetCertSha256(); + if (this_present_certSha256 || that_present_certSha256) { + if (!(this_present_certSha256 && that_present_certSha256)) + return false; + if (!this.certSha256.equals(that.certSha256)) + return false; + } + return true; } @@ -334,6 +404,16 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ return lastComparison; } } + lastComparison = Boolean.valueOf(isSetCertSha256()).compareTo(other.isSetCertSha256()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCertSha256()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.certSha256, other.certSha256); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -369,6 +449,14 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ sb.append(this.displayName); } first = false; + if (!first) sb.append(", "); + sb.append("certSha256:"); + if (this.certSha256 == null) { + sb.append("null"); + } else { + org.apache.thrift.TBaseHelper.toString(this.certSha256, sb); + } + first = false; sb.append(")"); return sb.toString(); } @@ -438,6 +526,14 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // CERT_SHA256 + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.certSha256 = iprot.readBinary(); + struct.setCertSha256IsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -470,6 +566,11 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ oprot.writeString(struct.displayName); oprot.writeFieldEnd(); } + if (struct.certSha256 != null) { + oprot.writeFieldBegin(CERT_SHA256_FIELD_DESC); + oprot.writeBinary(struct.certSha256); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -494,7 +595,10 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ if (struct.isSetDisplayName()) { optionals.set(1); } - oprot.writeBitSet(optionals, 2); + if (struct.isSetCertSha256()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); if (struct.isSetAddressList()) { { oprot.writeI32(struct.addressList.size()); @@ -507,12 +611,15 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ if (struct.isSetDisplayName()) { oprot.writeString(struct.displayName); } + if (struct.isSetCertSha256()) { + oprot.writeBinary(struct.certSha256); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, Satellite struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(2); + BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); @@ -530,6 +637,10 @@ public class Satellite implements org.apache.thrift.TBase<Satellite, Satellite._ struct.displayName = iprot.readString(); struct.setDisplayNameIsSet(true); } + if (incoming.get(2)) { + struct.certSha256 = iprot.readBinary(); + struct.setCertSha256IsSet(true); + } } } diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java index 53b9b5d..eeafb1d 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java @@ -7227,13 +7227,13 @@ public class SatelliteServer { case 4: // BLOCK_HASHES if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list130 = iprot.readListBegin(); - struct.blockHashes = new ArrayList<ByteBuffer>(_list130.size); - for (int _i131 = 0; _i131 < _list130.size; ++_i131) + org.apache.thrift.protocol.TList _list138 = iprot.readListBegin(); + struct.blockHashes = new ArrayList<ByteBuffer>(_list138.size); + for (int _i139 = 0; _i139 < _list138.size; ++_i139) { - ByteBuffer _elem132; - _elem132 = iprot.readBinary(); - struct.blockHashes.add(_elem132); + ByteBuffer _elem140; + _elem140 = iprot.readBinary(); + struct.blockHashes.add(_elem140); } iprot.readListEnd(); } @@ -7282,9 +7282,9 @@ public class SatelliteServer { oprot.writeFieldBegin(BLOCK_HASHES_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.blockHashes.size())); - for (ByteBuffer _iter133 : struct.blockHashes) + for (ByteBuffer _iter141 : struct.blockHashes) { - oprot.writeBinary(_iter133); + oprot.writeBinary(_iter141); } oprot.writeListEnd(); } @@ -7341,9 +7341,9 @@ public class SatelliteServer { if (struct.isSetBlockHashes()) { { oprot.writeI32(struct.blockHashes.size()); - for (ByteBuffer _iter134 : struct.blockHashes) + for (ByteBuffer _iter142 : struct.blockHashes) { - oprot.writeBinary(_iter134); + oprot.writeBinary(_iter142); } } } @@ -7370,13 +7370,13 @@ public class SatelliteServer { } if (incoming.get(3)) { { - org.apache.thrift.protocol.TList _list135 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.blockHashes = new ArrayList<ByteBuffer>(_list135.size); - for (int _i136 = 0; _i136 < _list135.size; ++_i136) + org.apache.thrift.protocol.TList _list143 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.blockHashes = new ArrayList<ByteBuffer>(_list143.size); + for (int _i144 = 0; _i144 < _list143.size; ++_i144) { - ByteBuffer _elem137; - _elem137 = iprot.readBinary(); - struct.blockHashes.add(_elem137); + ByteBuffer _elem145; + _elem145 = iprot.readBinary(); + struct.blockHashes.add(_elem145); } } struct.setBlockHashesIsSet(true); @@ -15982,14 +15982,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list138 = iprot.readListBegin(); - struct.success = new ArrayList<UserInfo>(_list138.size); - for (int _i139 = 0; _i139 < _list138.size; ++_i139) + org.apache.thrift.protocol.TList _list146 = iprot.readListBegin(); + struct.success = new ArrayList<UserInfo>(_list146.size); + for (int _i147 = 0; _i147 < _list146.size; ++_i147) { - UserInfo _elem140; - _elem140 = new UserInfo(); - _elem140.read(iprot); - struct.success.add(_elem140); + UserInfo _elem148; + _elem148 = new UserInfo(); + _elem148.read(iprot); + struct.success.add(_elem148); } iprot.readListEnd(); } @@ -16035,9 +16035,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (UserInfo _iter141 : struct.success) + for (UserInfo _iter149 : struct.success) { - _iter141.write(oprot); + _iter149.write(oprot); } oprot.writeListEnd(); } @@ -16084,9 +16084,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (UserInfo _iter142 : struct.success) + for (UserInfo _iter150 : struct.success) { - _iter142.write(oprot); + _iter150.write(oprot); } } } @@ -16104,14 +16104,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list143 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<UserInfo>(_list143.size); - for (int _i144 = 0; _i144 < _list143.size; ++_i144) + org.apache.thrift.protocol.TList _list151 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<UserInfo>(_list151.size); + for (int _i152 = 0; _i152 < _list151.size; ++_i152) { - UserInfo _elem145; - _elem145 = new UserInfo(); - _elem145.read(iprot); - struct.success.add(_elem145); + UserInfo _elem153; + _elem153 = new UserInfo(); + _elem153.read(iprot); + struct.success.add(_elem153); } } struct.setSuccessIsSet(true); @@ -16686,14 +16686,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list146 = iprot.readListBegin(); - struct.success = new ArrayList<OperatingSystem>(_list146.size); - for (int _i147 = 0; _i147 < _list146.size; ++_i147) + org.apache.thrift.protocol.TList _list154 = iprot.readListBegin(); + struct.success = new ArrayList<OperatingSystem>(_list154.size); + for (int _i155 = 0; _i155 < _list154.size; ++_i155) { - OperatingSystem _elem148; - _elem148 = new OperatingSystem(); - _elem148.read(iprot); - struct.success.add(_elem148); + OperatingSystem _elem156; + _elem156 = new OperatingSystem(); + _elem156.read(iprot); + struct.success.add(_elem156); } iprot.readListEnd(); } @@ -16721,9 +16721,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (OperatingSystem _iter149 : struct.success) + for (OperatingSystem _iter157 : struct.success) { - _iter149.write(oprot); + _iter157.write(oprot); } oprot.writeListEnd(); } @@ -16754,9 +16754,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (OperatingSystem _iter150 : struct.success) + for (OperatingSystem _iter158 : struct.success) { - _iter150.write(oprot); + _iter158.write(oprot); } } } @@ -16768,14 +16768,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list151 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<OperatingSystem>(_list151.size); - for (int _i152 = 0; _i152 < _list151.size; ++_i152) + org.apache.thrift.protocol.TList _list159 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<OperatingSystem>(_list159.size); + for (int _i160 = 0; _i160 < _list159.size; ++_i160) { - OperatingSystem _elem153; - _elem153 = new OperatingSystem(); - _elem153.read(iprot); - struct.success.add(_elem153); + OperatingSystem _elem161; + _elem161 = new OperatingSystem(); + _elem161.read(iprot); + struct.success.add(_elem161); } } struct.setSuccessIsSet(true); @@ -17340,14 +17340,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list154 = iprot.readListBegin(); - struct.success = new ArrayList<Virtualizer>(_list154.size); - for (int _i155 = 0; _i155 < _list154.size; ++_i155) + org.apache.thrift.protocol.TList _list162 = iprot.readListBegin(); + struct.success = new ArrayList<Virtualizer>(_list162.size); + for (int _i163 = 0; _i163 < _list162.size; ++_i163) { - Virtualizer _elem156; - _elem156 = new Virtualizer(); - _elem156.read(iprot); - struct.success.add(_elem156); + Virtualizer _elem164; + _elem164 = new Virtualizer(); + _elem164.read(iprot); + struct.success.add(_elem164); } iprot.readListEnd(); } @@ -17375,9 +17375,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Virtualizer _iter157 : struct.success) + for (Virtualizer _iter165 : struct.success) { - _iter157.write(oprot); + _iter165.write(oprot); } oprot.writeListEnd(); } @@ -17408,9 +17408,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Virtualizer _iter158 : struct.success) + for (Virtualizer _iter166 : struct.success) { - _iter158.write(oprot); + _iter166.write(oprot); } } } @@ -17422,14 +17422,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list159 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<Virtualizer>(_list159.size); - for (int _i160 = 0; _i160 < _list159.size; ++_i160) + org.apache.thrift.protocol.TList _list167 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<Virtualizer>(_list167.size); + for (int _i168 = 0; _i168 < _list167.size; ++_i168) { - Virtualizer _elem161; - _elem161 = new Virtualizer(); - _elem161.read(iprot); - struct.success.add(_elem161); + Virtualizer _elem169; + _elem169 = new Virtualizer(); + _elem169.read(iprot); + struct.success.add(_elem169); } } struct.setSuccessIsSet(true); @@ -17994,14 +17994,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list162 = iprot.readListBegin(); - struct.success = new ArrayList<Organization>(_list162.size); - for (int _i163 = 0; _i163 < _list162.size; ++_i163) + org.apache.thrift.protocol.TList _list170 = iprot.readListBegin(); + struct.success = new ArrayList<Organization>(_list170.size); + for (int _i171 = 0; _i171 < _list170.size; ++_i171) { - Organization _elem164; - _elem164 = new Organization(); - _elem164.read(iprot); - struct.success.add(_elem164); + Organization _elem172; + _elem172 = new Organization(); + _elem172.read(iprot); + struct.success.add(_elem172); } iprot.readListEnd(); } @@ -18029,9 +18029,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Organization _iter165 : struct.success) + for (Organization _iter173 : struct.success) { - _iter165.write(oprot); + _iter173.write(oprot); } oprot.writeListEnd(); } @@ -18062,9 +18062,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Organization _iter166 : struct.success) + for (Organization _iter174 : struct.success) { - _iter166.write(oprot); + _iter174.write(oprot); } } } @@ -18076,14 +18076,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list167 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<Organization>(_list167.size); - for (int _i168 = 0; _i168 < _list167.size; ++_i168) + org.apache.thrift.protocol.TList _list175 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<Organization>(_list175.size); + for (int _i176 = 0; _i176 < _list175.size; ++_i176) { - Organization _elem169; - _elem169 = new Organization(); - _elem169.read(iprot); - struct.success.add(_elem169); + Organization _elem177; + _elem177 = new Organization(); + _elem177.read(iprot); + struct.success.add(_elem177); } } struct.setSuccessIsSet(true); @@ -18561,13 +18561,13 @@ public class SatelliteServer { case 2: // TAG_SEARCH if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list170 = iprot.readListBegin(); - struct.tagSearch = new ArrayList<String>(_list170.size); - for (int _i171 = 0; _i171 < _list170.size; ++_i171) + org.apache.thrift.protocol.TList _list178 = iprot.readListBegin(); + struct.tagSearch = new ArrayList<String>(_list178.size); + for (int _i179 = 0; _i179 < _list178.size; ++_i179) { - String _elem172; - _elem172 = iprot.readString(); - struct.tagSearch.add(_elem172); + String _elem180; + _elem180 = iprot.readString(); + struct.tagSearch.add(_elem180); } iprot.readListEnd(); } @@ -18608,9 +18608,9 @@ public class SatelliteServer { oprot.writeFieldBegin(TAG_SEARCH_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.tagSearch.size())); - for (String _iter173 : struct.tagSearch) + for (String _iter181 : struct.tagSearch) { - oprot.writeString(_iter173); + oprot.writeString(_iter181); } oprot.writeListEnd(); } @@ -18653,9 +18653,9 @@ public class SatelliteServer { if (struct.isSetTagSearch()) { { oprot.writeI32(struct.tagSearch.size()); - for (String _iter174 : struct.tagSearch) + for (String _iter182 : struct.tagSearch) { - oprot.writeString(_iter174); + oprot.writeString(_iter182); } } } @@ -18674,13 +18674,13 @@ public class SatelliteServer { } if (incoming.get(1)) { { - org.apache.thrift.protocol.TList _list175 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.tagSearch = new ArrayList<String>(_list175.size); - for (int _i176 = 0; _i176 < _list175.size; ++_i176) + org.apache.thrift.protocol.TList _list183 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.tagSearch = new ArrayList<String>(_list183.size); + for (int _i184 = 0; _i184 < _list183.size; ++_i184) { - String _elem177; - _elem177 = iprot.readString(); - struct.tagSearch.add(_elem177); + String _elem185; + _elem185 = iprot.readString(); + struct.tagSearch.add(_elem185); } } struct.setTagSearchIsSet(true); @@ -19157,14 +19157,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list178 = iprot.readListBegin(); - struct.success = new ArrayList<ImageSummaryRead>(_list178.size); - for (int _i179 = 0; _i179 < _list178.size; ++_i179) + org.apache.thrift.protocol.TList _list186 = iprot.readListBegin(); + struct.success = new ArrayList<ImageSummaryRead>(_list186.size); + for (int _i187 = 0; _i187 < _list186.size; ++_i187) { - ImageSummaryRead _elem180; - _elem180 = new ImageSummaryRead(); - _elem180.read(iprot); - struct.success.add(_elem180); + ImageSummaryRead _elem188; + _elem188 = new ImageSummaryRead(); + _elem188.read(iprot); + struct.success.add(_elem188); } iprot.readListEnd(); } @@ -19210,9 +19210,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (ImageSummaryRead _iter181 : struct.success) + for (ImageSummaryRead _iter189 : struct.success) { - _iter181.write(oprot); + _iter189.write(oprot); } oprot.writeListEnd(); } @@ -19259,9 +19259,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (ImageSummaryRead _iter182 : struct.success) + for (ImageSummaryRead _iter190 : struct.success) { - _iter182.write(oprot); + _iter190.write(oprot); } } } @@ -19279,14 +19279,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list183 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<ImageSummaryRead>(_list183.size); - for (int _i184 = 0; _i184 < _list183.size; ++_i184) + org.apache.thrift.protocol.TList _list191 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<ImageSummaryRead>(_list191.size); + for (int _i192 = 0; _i192 < _list191.size; ++_i192) { - ImageSummaryRead _elem185; - _elem185 = new ImageSummaryRead(); - _elem185.read(iprot); - struct.success.add(_elem185); + ImageSummaryRead _elem193; + _elem193 = new ImageSummaryRead(); + _elem193.read(iprot); + struct.success.add(_elem193); } } struct.setSuccessIsSet(true); @@ -25479,16 +25479,16 @@ public class SatelliteServer { case 3: // PERMISSIONS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map186 = iprot.readMapBegin(); - struct.permissions = new HashMap<String,ImagePermissions>(2*_map186.size); - for (int _i187 = 0; _i187 < _map186.size; ++_i187) + org.apache.thrift.protocol.TMap _map194 = iprot.readMapBegin(); + struct.permissions = new HashMap<String,ImagePermissions>(2*_map194.size); + for (int _i195 = 0; _i195 < _map194.size; ++_i195) { - String _key188; - ImagePermissions _val189; - _key188 = iprot.readString(); - _val189 = new ImagePermissions(); - _val189.read(iprot); - struct.permissions.put(_key188, _val189); + String _key196; + ImagePermissions _val197; + _key196 = iprot.readString(); + _val197 = new ImagePermissions(); + _val197.read(iprot); + struct.permissions.put(_key196, _val197); } iprot.readMapEnd(); } @@ -25526,10 +25526,10 @@ public class SatelliteServer { oprot.writeFieldBegin(PERMISSIONS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.permissions.size())); - for (Map.Entry<String, ImagePermissions> _iter190 : struct.permissions.entrySet()) + for (Map.Entry<String, ImagePermissions> _iter198 : struct.permissions.entrySet()) { - oprot.writeString(_iter190.getKey()); - _iter190.getValue().write(oprot); + oprot.writeString(_iter198.getKey()); + _iter198.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -25572,10 +25572,10 @@ public class SatelliteServer { if (struct.isSetPermissions()) { { oprot.writeI32(struct.permissions.size()); - for (Map.Entry<String, ImagePermissions> _iter191 : struct.permissions.entrySet()) + for (Map.Entry<String, ImagePermissions> _iter199 : struct.permissions.entrySet()) { - oprot.writeString(_iter191.getKey()); - _iter191.getValue().write(oprot); + oprot.writeString(_iter199.getKey()); + _iter199.getValue().write(oprot); } } } @@ -25595,16 +25595,16 @@ public class SatelliteServer { } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map192 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.permissions = new HashMap<String,ImagePermissions>(2*_map192.size); - for (int _i193 = 0; _i193 < _map192.size; ++_i193) + org.apache.thrift.protocol.TMap _map200 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.permissions = new HashMap<String,ImagePermissions>(2*_map200.size); + for (int _i201 = 0; _i201 < _map200.size; ++_i201) { - String _key194; - ImagePermissions _val195; - _key194 = iprot.readString(); - _val195 = new ImagePermissions(); - _val195.read(iprot); - struct.permissions.put(_key194, _val195); + String _key202; + ImagePermissions _val203; + _key202 = iprot.readString(); + _val203 = new ImagePermissions(); + _val203.read(iprot); + struct.permissions.put(_key202, _val203); } } struct.setPermissionsIsSet(true); @@ -27173,16 +27173,16 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map196 = iprot.readMapBegin(); - struct.success = new HashMap<String,ImagePermissions>(2*_map196.size); - for (int _i197 = 0; _i197 < _map196.size; ++_i197) + org.apache.thrift.protocol.TMap _map204 = iprot.readMapBegin(); + struct.success = new HashMap<String,ImagePermissions>(2*_map204.size); + for (int _i205 = 0; _i205 < _map204.size; ++_i205) { - String _key198; - ImagePermissions _val199; - _key198 = iprot.readString(); - _val199 = new ImagePermissions(); - _val199.read(iprot); - struct.success.put(_key198, _val199); + String _key206; + ImagePermissions _val207; + _key206 = iprot.readString(); + _val207 = new ImagePermissions(); + _val207.read(iprot); + struct.success.put(_key206, _val207); } iprot.readMapEnd(); } @@ -27237,10 +27237,10 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Map.Entry<String, ImagePermissions> _iter200 : struct.success.entrySet()) + for (Map.Entry<String, ImagePermissions> _iter208 : struct.success.entrySet()) { - oprot.writeString(_iter200.getKey()); - _iter200.getValue().write(oprot); + oprot.writeString(_iter208.getKey()); + _iter208.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -27295,10 +27295,10 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, ImagePermissions> _iter201 : struct.success.entrySet()) + for (Map.Entry<String, ImagePermissions> _iter209 : struct.success.entrySet()) { - oprot.writeString(_iter201.getKey()); - _iter201.getValue().write(oprot); + oprot.writeString(_iter209.getKey()); + _iter209.getValue().write(oprot); } } } @@ -27319,16 +27319,16 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map202 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new HashMap<String,ImagePermissions>(2*_map202.size); - for (int _i203 = 0; _i203 < _map202.size; ++_i203) + org.apache.thrift.protocol.TMap _map210 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new HashMap<String,ImagePermissions>(2*_map210.size); + for (int _i211 = 0; _i211 < _map210.size; ++_i211) { - String _key204; - ImagePermissions _val205; - _key204 = iprot.readString(); - _val205 = new ImagePermissions(); - _val205.read(iprot); - struct.success.put(_key204, _val205); + String _key212; + ImagePermissions _val213; + _key212 = iprot.readString(); + _val213 = new ImagePermissions(); + _val213.read(iprot); + struct.success.put(_key212, _val213); } } struct.setSuccessIsSet(true); @@ -32936,14 +32936,14 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { { - org.apache.thrift.protocol.TList _list206 = iprot.readListBegin(); - struct.success = new ArrayList<LectureSummary>(_list206.size); - for (int _i207 = 0; _i207 < _list206.size; ++_i207) + org.apache.thrift.protocol.TList _list214 = iprot.readListBegin(); + struct.success = new ArrayList<LectureSummary>(_list214.size); + for (int _i215 = 0; _i215 < _list214.size; ++_i215) { - LectureSummary _elem208; - _elem208 = new LectureSummary(); - _elem208.read(iprot); - struct.success.add(_elem208); + LectureSummary _elem216; + _elem216 = new LectureSummary(); + _elem216.read(iprot); + struct.success.add(_elem216); } iprot.readListEnd(); } @@ -32989,9 +32989,9 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (LectureSummary _iter209 : struct.success) + for (LectureSummary _iter217 : struct.success) { - _iter209.write(oprot); + _iter217.write(oprot); } oprot.writeListEnd(); } @@ -33038,9 +33038,9 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (LectureSummary _iter210 : struct.success) + for (LectureSummary _iter218 : struct.success) { - _iter210.write(oprot); + _iter218.write(oprot); } } } @@ -33058,14 +33058,14 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { { - org.apache.thrift.protocol.TList _list211 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new ArrayList<LectureSummary>(_list211.size); - for (int _i212 = 0; _i212 < _list211.size; ++_i212) + org.apache.thrift.protocol.TList _list219 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<LectureSummary>(_list219.size); + for (int _i220 = 0; _i220 < _list219.size; ++_i220) { - LectureSummary _elem213; - _elem213 = new LectureSummary(); - _elem213.read(iprot); - struct.success.add(_elem213); + LectureSummary _elem221; + _elem221 = new LectureSummary(); + _elem221.read(iprot); + struct.success.add(_elem221); } } struct.setSuccessIsSet(true); @@ -35702,16 +35702,16 @@ public class SatelliteServer { case 3: // PERMISSIONS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map214 = iprot.readMapBegin(); - struct.permissions = new HashMap<String,LecturePermissions>(2*_map214.size); - for (int _i215 = 0; _i215 < _map214.size; ++_i215) + org.apache.thrift.protocol.TMap _map222 = iprot.readMapBegin(); + struct.permissions = new HashMap<String,LecturePermissions>(2*_map222.size); + for (int _i223 = 0; _i223 < _map222.size; ++_i223) { - String _key216; - LecturePermissions _val217; - _key216 = iprot.readString(); - _val217 = new LecturePermissions(); - _val217.read(iprot); - struct.permissions.put(_key216, _val217); + String _key224; + LecturePermissions _val225; + _key224 = iprot.readString(); + _val225 = new LecturePermissions(); + _val225.read(iprot); + struct.permissions.put(_key224, _val225); } iprot.readMapEnd(); } @@ -35749,10 +35749,10 @@ public class SatelliteServer { oprot.writeFieldBegin(PERMISSIONS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.permissions.size())); - for (Map.Entry<String, LecturePermissions> _iter218 : struct.permissions.entrySet()) + for (Map.Entry<String, LecturePermissions> _iter226 : struct.permissions.entrySet()) { - oprot.writeString(_iter218.getKey()); - _iter218.getValue().write(oprot); + oprot.writeString(_iter226.getKey()); + _iter226.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -35795,10 +35795,10 @@ public class SatelliteServer { if (struct.isSetPermissions()) { { oprot.writeI32(struct.permissions.size()); - for (Map.Entry<String, LecturePermissions> _iter219 : struct.permissions.entrySet()) + for (Map.Entry<String, LecturePermissions> _iter227 : struct.permissions.entrySet()) { - oprot.writeString(_iter219.getKey()); - _iter219.getValue().write(oprot); + oprot.writeString(_iter227.getKey()); + _iter227.getValue().write(oprot); } } } @@ -35818,16 +35818,16 @@ public class SatelliteServer { } if (incoming.get(2)) { { - org.apache.thrift.protocol.TMap _map220 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.permissions = new HashMap<String,LecturePermissions>(2*_map220.size); - for (int _i221 = 0; _i221 < _map220.size; ++_i221) + org.apache.thrift.protocol.TMap _map228 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.permissions = new HashMap<String,LecturePermissions>(2*_map228.size); + for (int _i229 = 0; _i229 < _map228.size; ++_i229) { - String _key222; - LecturePermissions _val223; - _key222 = iprot.readString(); - _val223 = new LecturePermissions(); - _val223.read(iprot); - struct.permissions.put(_key222, _val223); + String _key230; + LecturePermissions _val231; + _key230 = iprot.readString(); + _val231 = new LecturePermissions(); + _val231.read(iprot); + struct.permissions.put(_key230, _val231); } } struct.setPermissionsIsSet(true); @@ -37396,16 +37396,16 @@ public class SatelliteServer { case 0: // SUCCESS if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { { - org.apache.thrift.protocol.TMap _map224 = iprot.readMapBegin(); - struct.success = new HashMap<String,LecturePermissions>(2*_map224.size); - for (int _i225 = 0; _i225 < _map224.size; ++_i225) + org.apache.thrift.protocol.TMap _map232 = iprot.readMapBegin(); + struct.success = new HashMap<String,LecturePermissions>(2*_map232.size); + for (int _i233 = 0; _i233 < _map232.size; ++_i233) { - String _key226; - LecturePermissions _val227; - _key226 = iprot.readString(); - _val227 = new LecturePermissions(); - _val227.read(iprot); - struct.success.put(_key226, _val227); + String _key234; + LecturePermissions _val235; + _key234 = iprot.readString(); + _val235 = new LecturePermissions(); + _val235.read(iprot); + struct.success.put(_key234, _val235); } iprot.readMapEnd(); } @@ -37460,10 +37460,10 @@ public class SatelliteServer { oprot.writeFieldBegin(SUCCESS_FIELD_DESC); { oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); - for (Map.Entry<String, LecturePermissions> _iter228 : struct.success.entrySet()) + for (Map.Entry<String, LecturePermissions> _iter236 : struct.success.entrySet()) { - oprot.writeString(_iter228.getKey()); - _iter228.getValue().write(oprot); + oprot.writeString(_iter236.getKey()); + _iter236.getValue().write(oprot); } oprot.writeMapEnd(); } @@ -37518,10 +37518,10 @@ public class SatelliteServer { if (struct.isSetSuccess()) { { oprot.writeI32(struct.success.size()); - for (Map.Entry<String, LecturePermissions> _iter229 : struct.success.entrySet()) + for (Map.Entry<String, LecturePermissions> _iter237 : struct.success.entrySet()) { - oprot.writeString(_iter229.getKey()); - _iter229.getValue().write(oprot); + oprot.writeString(_iter237.getKey()); + _iter237.getValue().write(oprot); } } } @@ -37542,16 +37542,16 @@ public class SatelliteServer { BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { { - org.apache.thrift.protocol.TMap _map230 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); - struct.success = new HashMap<String,LecturePermissions>(2*_map230.size); - for (int _i231 = 0; _i231 < _map230.size; ++_i231) + org.apache.thrift.protocol.TMap _map238 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new HashMap<String,LecturePermissions>(2*_map238.size); + for (int _i239 = 0; _i239 < _map238.size; ++_i239) { - String _key232; - LecturePermissions _val233; - _key232 = iprot.readString(); - _val233 = new LecturePermissions(); - _val233.read(iprot); - struct.success.put(_key232, _val233); + String _key240; + LecturePermissions _val241; + _key240 = iprot.readString(); + _val241 = new LecturePermissions(); + _val241.read(iprot); + struct.success.put(_key240, _val241); } } struct.setSuccessIsSet(true); diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TTransferRejectedException.java b/src/main/java/org/openslx/bwlp/thrift/iface/TTransferRejectedException.java index 45256f8..b44f574 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TTransferRejectedException.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TTransferRejectedException.java @@ -35,7 +35,7 @@ import org.slf4j.LoggerFactory; public class TTransferRejectedException extends TException implements org.apache.thrift.TBase<TTransferRejectedException, TTransferRejectedException._Fields>, java.io.Serializable, Cloneable, Comparable<TTransferRejectedException> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TTransferRejectedException"); - private static final org.apache.thrift.protocol.TField REASON_FIELD_DESC = new org.apache.thrift.protocol.TField("reason", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -43,11 +43,11 @@ public class TTransferRejectedException extends TException implements org.apache schemes.put(TupleScheme.class, new TTransferRejectedExceptionTupleSchemeFactory()); } - public String reason; // required + public String message; // 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 { - REASON((short)1, "reason"); + MESSAGE((short)1, "message"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -62,8 +62,8 @@ public class TTransferRejectedException extends TException implements org.apache */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // REASON - return REASON; + case 1: // MESSAGE + return MESSAGE; default: return null; } @@ -107,7 +107,7 @@ public class TTransferRejectedException extends TException implements org.apache 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); - tmpMap.put(_Fields.REASON, new org.apache.thrift.meta_data.FieldMetaData("reason", org.apache.thrift.TFieldRequirementType.DEFAULT, + tmpMap.put(_Fields.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TTransferRejectedException.class, metaDataMap); @@ -117,18 +117,18 @@ public class TTransferRejectedException extends TException implements org.apache } public TTransferRejectedException( - String reason) + String message) { this(); - this.reason = reason; + this.message = message; } /** * Performs a deep copy on <i>other</i>. */ public TTransferRejectedException(TTransferRejectedException other) { - if (other.isSetReason()) { - this.reason = other.reason; + if (other.isSetMessage()) { + this.message = other.message; } } @@ -138,40 +138,40 @@ public class TTransferRejectedException extends TException implements org.apache @Override public void clear() { - this.reason = null; + this.message = null; } - public String getReason() { - return this.reason; + public String getMessage() { + return this.message; } - public TTransferRejectedException setReason(String reason) { - this.reason = reason; + public TTransferRejectedException setMessage(String message) { + this.message = message; return this; } - public void unsetReason() { - this.reason = null; + public void unsetMessage() { + this.message = null; } - /** Returns true if field reason is set (has been assigned a value) and false otherwise */ - public boolean isSetReason() { - return this.reason != null; + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; } - public void setReasonIsSet(boolean value) { + public void setMessageIsSet(boolean value) { if (!value) { - this.reason = null; + this.message = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { - case REASON: + case MESSAGE: if (value == null) { - unsetReason(); + unsetMessage(); } else { - setReason((String)value); + setMessage((String)value); } break; @@ -180,8 +180,8 @@ public class TTransferRejectedException extends TException implements org.apache public Object getFieldValue(_Fields field) { switch (field) { - case REASON: - return getReason(); + case MESSAGE: + return getMessage(); } throw new IllegalStateException(); @@ -194,8 +194,8 @@ public class TTransferRejectedException extends TException implements org.apache } switch (field) { - case REASON: - return isSetReason(); + case MESSAGE: + return isSetMessage(); } throw new IllegalStateException(); } @@ -213,12 +213,12 @@ public class TTransferRejectedException extends TException implements org.apache if (that == null) return false; - boolean this_present_reason = true && this.isSetReason(); - boolean that_present_reason = true && that.isSetReason(); - if (this_present_reason || that_present_reason) { - if (!(this_present_reason && that_present_reason)) + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) return false; - if (!this.reason.equals(that.reason)) + if (!this.message.equals(that.message)) return false; } @@ -238,12 +238,12 @@ public class TTransferRejectedException extends TException implements org.apache int lastComparison = 0; - lastComparison = Boolean.valueOf(isSetReason()).compareTo(other.isSetReason()); + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); if (lastComparison != 0) { return lastComparison; } - if (isSetReason()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.reason, other.reason); + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); if (lastComparison != 0) { return lastComparison; } @@ -268,11 +268,11 @@ public class TTransferRejectedException extends TException implements org.apache StringBuilder sb = new StringBuilder("TTransferRejectedException("); boolean first = true; - sb.append("reason:"); - if (this.reason == null) { + sb.append("message:"); + if (this.message == null) { sb.append("null"); } else { - sb.append(this.reason); + sb.append(this.message); } first = false; sb.append(")"); @@ -318,10 +318,10 @@ public class TTransferRejectedException extends TException implements org.apache break; } switch (schemeField.id) { - case 1: // REASON + case 1: // MESSAGE if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.reason = iprot.readString(); - struct.setReasonIsSet(true); + struct.message = iprot.readString(); + struct.setMessageIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -341,9 +341,9 @@ public class TTransferRejectedException extends TException implements org.apache struct.validate(); oprot.writeStructBegin(STRUCT_DESC); - if (struct.reason != null) { - oprot.writeFieldBegin(REASON_FIELD_DESC); - oprot.writeString(struct.reason); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); oprot.writeFieldEnd(); } oprot.writeFieldStop(); @@ -364,12 +364,12 @@ public class TTransferRejectedException extends TException implements org.apache public void write(org.apache.thrift.protocol.TProtocol prot, TTransferRejectedException struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); - if (struct.isSetReason()) { + if (struct.isSetMessage()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); - if (struct.isSetReason()) { - oprot.writeString(struct.reason); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); } } @@ -378,8 +378,8 @@ public class TTransferRejectedException extends TException implements org.apache TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { - struct.reason = iprot.readString(); - struct.setReasonIsSet(true); + struct.message = iprot.readString(); + struct.setMessageIsSet(true); } } } 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<TransferInfo private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField PLAIN_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("plainPort", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField SSL_PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("sslPort", org.apache.thrift.protocol.TType.I32, (short)3); + private static final org.apache.thrift.protocol.TField BLOCK_HASHES_FIELD_DESC = new org.apache.thrift.protocol.TField("blockHashes", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField MACHINE_DESCRIPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("machineDescription", org.apache.thrift.protocol.TType.STRING, (short)5); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -48,12 +50,16 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo public String token; // required public int plainPort; // required public int sslPort; // required + public List<ByteBuffer> 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<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -74,6 +80,10 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo return PLAIN_PORT; case 3: // SSL_PORT return SSL_PORT; + case 4: // BLOCK_HASHES + return BLOCK_HASHES; + case 5: // MACHINE_DESCRIPTION + return MACHINE_DESCRIPTION; default: return null; } @@ -117,6 +127,7 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo private static final int __PLAINPORT_ISSET_ID = 0; private static final int __SSLPORT_ISSET_ID = 1; private byte __isset_bitfield = 0; + private _Fields optionals[] = {_Fields.BLOCK_HASHES,_Fields.MACHINE_DESCRIPTION}; 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); @@ -126,6 +137,11 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.SSL_PORT, new org.apache.thrift.meta_data.FieldMetaData("sslPort", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.BLOCK_HASHES, new org.apache.thrift.meta_data.FieldMetaData("blockHashes", org.apache.thrift.TFieldRequirementType.OPTIONAL, + 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.STRING , true)))); + tmpMap.put(_Fields.MACHINE_DESCRIPTION, new org.apache.thrift.meta_data.FieldMetaData("machineDescription", org.apache.thrift.TFieldRequirementType.OPTIONAL, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(TransferInformation.class, metaDataMap); } @@ -156,6 +172,13 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo } this.plainPort = other.plainPort; this.sslPort = other.sslPort; + if (other.isSetBlockHashes()) { + List<ByteBuffer> __this__blockHashes = new ArrayList<ByteBuffer>(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<TransferInfo this.plainPort = 0; setSslPortIsSet(false); this.sslPort = 0; + this.blockHashes = null; + this.machineDescription = null; } public String getToken() { @@ -241,6 +266,69 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SSLPORT_ISSET_ID, value); } + public int getBlockHashesSize() { + return (this.blockHashes == null) ? 0 : this.blockHashes.size(); + } + + public java.util.Iterator<ByteBuffer> getBlockHashesIterator() { + return (this.blockHashes == null) ? null : this.blockHashes.iterator(); + } + + public void addToBlockHashes(ByteBuffer elem) { + if (this.blockHashes == null) { + this.blockHashes = new ArrayList<ByteBuffer>(); + } + this.blockHashes.add(elem); + } + + public List<ByteBuffer> getBlockHashes() { + return this.blockHashes; + } + + public TransferInformation setBlockHashes(List<ByteBuffer> 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<TransferInfo } break; + case BLOCK_HASHES: + if (value == null) { + unsetBlockHashes(); + } else { + setBlockHashes((List<ByteBuffer>)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<TransferInfo case SSL_PORT: return Integer.valueOf(getSslPort()); + case BLOCK_HASHES: + return getBlockHashes(); + + case MACHINE_DESCRIPTION: + return getMachineDescription(); + } throw new IllegalStateException(); } @@ -298,6 +408,10 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo return isSetPlainPort(); case SSL_PORT: return isSetSslPort(); + case BLOCK_HASHES: + return isSetBlockHashes(); + case MACHINE_DESCRIPTION: + return isSetMachineDescription(); } throw new IllegalStateException(); } @@ -342,6 +456,24 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo return false; } + boolean this_present_blockHashes = true && this.isSetBlockHashes(); + boolean that_present_blockHashes = true && that.isSetBlockHashes(); + if (this_present_blockHashes || that_present_blockHashes) { + if (!(this_present_blockHashes && that_present_blockHashes)) + return false; + if (!this.blockHashes.equals(that.blockHashes)) + return false; + } + + boolean this_present_machineDescription = true && this.isSetMachineDescription(); + boolean that_present_machineDescription = true && that.isSetMachineDescription(); + if (this_present_machineDescription || that_present_machineDescription) { + if (!(this_present_machineDescription && that_present_machineDescription)) + return false; + if (!this.machineDescription.equals(that.machineDescription)) + return false; + } + return true; } @@ -388,6 +520,26 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo return lastComparison; } } + lastComparison = Boolean.valueOf(isSetBlockHashes()).compareTo(other.isSetBlockHashes()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetBlockHashes()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.blockHashes, other.blockHashes); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMachineDescription()).compareTo(other.isSetMachineDescription()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMachineDescription()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.machineDescription, other.machineDescription); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -423,6 +575,26 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo sb.append("sslPort:"); sb.append(this.sslPort); first = false; + if (isSetBlockHashes()) { + if (!first) sb.append(", "); + sb.append("blockHashes:"); + if (this.blockHashes == null) { + sb.append("null"); + } else { + sb.append(this.blockHashes); + } + first = false; + } + if (isSetMachineDescription()) { + if (!first) sb.append(", "); + sb.append("machineDescription:"); + if (this.machineDescription == null) { + sb.append("null"); + } else { + sb.append(this.machineDescription); + } + first = false; + } sb.append(")"); return sb.toString(); } @@ -492,6 +664,32 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // BLOCK_HASHES + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list130 = iprot.readListBegin(); + struct.blockHashes = new ArrayList<ByteBuffer>(_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<TransferInfo oprot.writeFieldBegin(SSL_PORT_FIELD_DESC); oprot.writeI32(struct.sslPort); oprot.writeFieldEnd(); + if (struct.blockHashes != null) { + if (struct.isSetBlockHashes()) { + oprot.writeFieldBegin(BLOCK_HASHES_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.blockHashes.size())); + for (ByteBuffer _iter133 : struct.blockHashes) + { + oprot.writeBinary(_iter133); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + } + if (struct.machineDescription != null) { + if (struct.isSetMachineDescription()) { + oprot.writeFieldBegin(MACHINE_DESCRIPTION_FIELD_DESC); + oprot.writeString(struct.machineDescription); + oprot.writeFieldEnd(); + } + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -545,7 +764,13 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo if (struct.isSetSslPort()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetBlockHashes()) { + optionals.set(3); + } + if (struct.isSetMachineDescription()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); if (struct.isSetToken()) { oprot.writeString(struct.token); } @@ -555,12 +780,24 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo if (struct.isSetSslPort()) { oprot.writeI32(struct.sslPort); } + if (struct.isSetBlockHashes()) { + { + oprot.writeI32(struct.blockHashes.size()); + for (ByteBuffer _iter134 : struct.blockHashes) + { + oprot.writeBinary(_iter134); + } + } + } + if (struct.isSetMachineDescription()) { + oprot.writeString(struct.machineDescription); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TransferInformation struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(5); if (incoming.get(0)) { struct.token = iprot.readString(); struct.setTokenIsSet(true); @@ -573,6 +810,23 @@ public class TransferInformation implements org.apache.thrift.TBase<TransferInfo struct.sslPort = iprot.readI32(); struct.setSslPortIsSet(true); } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list135 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.blockHashes = new ArrayList<ByteBuffer>(_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); + } } } diff --git a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java index c645dd8..01ed0b0 100644 --- a/src/main/java/org/openslx/thrifthelper/ThriftHandler.java +++ b/src/main/java/org/openslx/thrifthelper/ThriftHandler.java @@ -13,27 +13,29 @@ import org.apache.log4j.Logger; import org.apache.thrift.TException; import org.apache.thrift.TServiceClient; import org.apache.thrift.transport.TTransportException; +import org.openslx.thrifthelper.ThriftManager.ErrorCallback; class ThriftHandler<T extends TServiceClient> implements InvocationHandler { private final static Logger LOGGER = Logger.getLogger( ThriftHandler.class ); - public interface EventCallback<T> + protected interface WantClientCallback<T> { public T getNewClient(); - - public boolean error( int failCount, String method, Throwable t ); } private final Deque<T> pool = new ArrayDeque<>(); - private final EventCallback<T> callback; + private final WantClientCallback<? extends T> callback; + + private final ErrorCallback errorCallback; private final Set<String> thriftMethods; - public ThriftHandler( final Class<T> clazz, EventCallback<T> cb ) + public ThriftHandler( final Class<? extends T> clazz, WantClientCallback<? extends T> cb, ErrorCallback errCb ) { + errorCallback = errCb; callback = cb; Set<String> tmpset = new HashSet<String>(); Method[] methods = clazz.getMethods(); @@ -85,14 +87,14 @@ class ThriftHandler<T extends TServiceClient> implements InvocationHandler if ( cause != null && ! ( cause instanceof TTransportException ) ) { throw cause; } - freeClient(client); + freeClient( client ); client = null; if ( cause == null ) cause = e; } } // Call the error callback. As long as true is returned, keep retrying - if ( !callback.error( i, method.getName(), cause ) ) { + if ( !errorCallback.thriftError( i, method.getName(), cause ) ) { break; } } @@ -106,16 +108,17 @@ class ThriftHandler<T extends TServiceClient> implements InvocationHandler } } - private void freeClient(T client) { + private void freeClient( T client ) + { try { client.getInputProtocol().getTransport().close(); - } catch (Exception e) { + } catch ( Exception e ) { } try { client.getOutputProtocol().getTransport().close(); - } catch (Exception e) { + } catch ( Exception e ) { } - + } private T getClient() diff --git a/src/main/java/org/openslx/thrifthelper/ThriftManager.java b/src/main/java/org/openslx/thrifthelper/ThriftManager.java index 4c08102..c276034 100644 --- a/src/main/java/org/openslx/thrifthelper/ThriftManager.java +++ b/src/main/java/org/openslx/thrifthelper/ThriftManager.java @@ -8,18 +8,18 @@ import java.net.Socket; import javax.net.ssl.SSLContext; import org.apache.log4j.Logger; +import org.apache.thrift.TServiceClient; import org.apache.thrift.protocol.TBinaryProtocol; import org.apache.thrift.protocol.TProtocol; import org.apache.thrift.transport.TFramedTransport; import org.apache.thrift.transport.TSocket; -import org.apache.thrift.transport.TTransport; import org.apache.thrift.transport.TTransportException; import org.openslx.bwlp.thrift.iface.MasterServer; import org.openslx.bwlp.thrift.iface.SatelliteServer; -import org.openslx.thrifthelper.ThriftHandler.EventCallback; +import org.openslx.thrifthelper.ThriftHandler.WantClientCallback; import org.openslx.util.Util; -public class ThriftManager +public class ThriftManager<T> { private final static Logger LOGGER = Logger.getLogger( ThriftManager.class ); @@ -37,73 +37,23 @@ public class ThriftManager public boolean thriftError( int failCount, String method, Throwable t ); } - private static ErrorCallback masterErrorCallback = null; - - private static ErrorCallback satelliteErrorCallback = null; - - /** - * Private members for master connection information - */ - private static String MASTERSERVER_ADDRESS = null; - private static final int MASTERSERVER_PORT = 9090; - private static final int MASTERSERVER_TIMEOUT = 15000; + private final T client; - /** - * Private members for satellite connection information - */ - private static String SATELLITE_IP = null; - private static final int SATELLITE_PORT = 9090; - private static final int SATELLITE_TIMEOUT = 15000; + @SuppressWarnings( "unchecked" ) + private ThriftManager( Class<T> ifClazz, Class<? extends TServiceClient> clientClazz, + WantClientCallback<? extends TServiceClient> internalCallback, ErrorCallback errorCb ) + { + this.client = (T)Proxy.newProxyInstance( + ifClazz.getClassLoader(), + new Class[] { ifClazz }, new ThriftHandler<TServiceClient>( + clientClazz, internalCallback, errorCb ) ); + } - /** - * Sat connection. Initialized when we know the sat server IP. - */ - private static SatelliteServer.Iface satClient = (SatelliteServer.Iface)Proxy.newProxyInstance( - SatelliteServer.Iface.class.getClassLoader(), - new Class[] { SatelliteServer.Iface.class }, new ThriftHandler<SatelliteServer.Client>( - SatelliteServer.Client.class, new EventCallback<SatelliteServer.Client>() { - - @Override - public SatelliteServer.Client getNewClient() - { - // first check if we have a sat ip - if ( SATELLITE_IP == null ) { - LOGGER.error( "Satellite ip adress was not set prior to getting the sat client. Use setSatelliteAddress(<addr>)." ); - return null; - } - return getNewSatClient( SATELLITE_IP ); - } - - @Override - public boolean error( int failCount, String method, Throwable t ) - { - return satelliteErrorCallback != null && satelliteErrorCallback.thriftError( failCount, method, t ); - } - } ) ); + private static ThriftManager<MasterServer.Iface> masterManager = null; + private static ThriftManager<SatelliteServer.Iface> satelliteManager = null; - /** - * Master connection. As its address is known in advance, create the object right away. - */ - private static MasterServer.Iface masterClient = (MasterServer.Iface)Proxy.newProxyInstance( - MasterServer.Iface.class.getClassLoader(), - new Class[] { MasterServer.Iface.class }, new ThriftHandler<MasterServer.Client>( - MasterServer.Client.class, new EventCallback<MasterServer.Client>() { - - @Override - public MasterServer.Client getNewClient() - { - return getNewMasterClient(); - - } - - @Override - public boolean error( int failCount, String method, Throwable t ) - { - synchronized ( LOGGER ) { - return masterErrorCallback != null && masterErrorCallback.thriftError( failCount, method, t ); - } - } - } ) ); + private static ErrorCallback satErrorCallback = null; + private static ErrorCallback masterErrorCallback = null; /** * Sets the address of the master server @@ -111,9 +61,9 @@ public class ThriftManager * @param host the ip/hostname of the master server * @return true if setting the address worked, false otherwise */ - public static boolean setMasterServerAddress( String host ) + public static synchronized boolean setMasterServerAddress( final SSLContext ctx, final String host, final int port, final int timeout ) { - if ( MASTERSERVER_ADDRESS != null ) { + if ( masterManager != null ) { LOGGER.error( "Master server address already set." ); return false; } @@ -122,7 +72,20 @@ public class ThriftManager return false; } // finally set it - MASTERSERVER_ADDRESS = host; + masterManager = new ThriftManager<MasterServer.Iface>( MasterServer.Iface.class, MasterServer.Client.class, + new WantClientCallback<MasterServer.Client>() { + @Override + public MasterServer.Client getNewClient() + { + return getNewMasterClient( ctx, host, port, timeout ); + } + }, new ErrorCallback() { + @Override + public boolean thriftError( int failCount, String method, Throwable t ) + { + return masterErrorCallback != null && masterErrorCallback.thriftError( failCount, method, t ); + } + } ); return true; } @@ -132,18 +95,31 @@ public class ThriftManager * @param host the ip/hostname of the satellite * @return true if setting the address worked, false otherwise */ - public static boolean setSatelliteAddress( String host ) + public static synchronized boolean setSatelliteAddress( final SSLContext ctx, final String host, final int port, final int timeout ) { - if ( SATELLITE_IP != null ) { - LOGGER.error( "Satellite address already set." ); + if ( satelliteManager != null ) { + LOGGER.error( "Satellite server address already set." ); return false; } if ( host.isEmpty() ) { - LOGGER.error( "Given address for satellite is empty." ); + LOGGER.error( "Given address is empty." ); return false; } // finally set it - SATELLITE_IP = host; + satelliteManager = new ThriftManager<SatelliteServer.Iface>( SatelliteServer.Iface.class, SatelliteServer.Client.class, + new WantClientCallback<SatelliteServer.Client>() { + @Override + public SatelliteServer.Client getNewClient() + { + return getNewSatelliteClient( ctx, host, port, timeout ); + } + }, new ErrorCallback() { + @Override + public boolean thriftError( int failCount, String method, Throwable t ) + { + return satErrorCallback != null && satErrorCallback.thriftError( failCount, method, t ); + } + } ); return true; } @@ -154,7 +130,11 @@ public class ThriftManager */ public static SatelliteServer.Iface getSatClient() { - return satClient; + if ( satelliteManager == null ) { + LOGGER.error( "Satellite server adress was not set prior to getting the client. Use setMasterServerAddress(<addr>)." ); + return null; + } + return satelliteManager.client; } /** @@ -164,7 +144,11 @@ public class ThriftManager */ public static MasterServer.Iface getMasterClient() { - return masterClient; + if ( masterManager == null ) { + LOGGER.error( "Master server adress was not set prior to getting the client. Use setMasterServerAddress(<addr>)." ); + return null; + } + return masterManager.client; } /** @@ -173,11 +157,9 @@ public class ThriftManager * * @param cb */ - public static void setMasterErrorCallback( ErrorCallback cb ) + public static synchronized void setMasterErrorCallback( ErrorCallback cb ) { - synchronized ( LOGGER ) { - masterErrorCallback = cb; - } + masterErrorCallback = cb; } /** @@ -186,68 +168,53 @@ public class ThriftManager * * @param cb */ - public static void setSatelliteErrorCallback( ErrorCallback cb ) + public static synchronized void setSatelliteErrorCallback( ErrorCallback cb ) { - synchronized ( LOGGER ) { - satelliteErrorCallback = cb; - } + satErrorCallback = cb; } - public static SatelliteServer.Client getNewSatClient( String satelliteIp ) + public static MasterServer.Client getNewMasterClient( SSLContext ctx, String address, int port, int timeout ) { - TTransport transport = null; - try { - transport = newTransport( null, satelliteIp, SATELLITE_PORT, SATELLITE_TIMEOUT ); - } catch ( TTransportException e ) { - LOGGER.error( "Could not open transport to thrift's server with IP: " + satelliteIp ); + TProtocol protocol = newTransport( ctx, address, port, timeout ); + if ( protocol == null ) return null; - } - final TProtocol protocol = new TBinaryProtocol( transport ); - // now we are ready to create the client, according to ClientType! - LOGGER.info( "Satellite '" + satelliteIp + "' reachable. Client initialised." ); - return new SatelliteServer.Client( protocol ); + return new MasterServer.Client( protocol ); } - - public static MasterServer.Client getNewMasterClient() { - // first check if we have a sat ip - if ( MASTERSERVER_ADDRESS == null ) { - LOGGER.error( "Master server adress was not set prior to getting the client. Use setMasterServerAddress(<addr>)." ); - return null; - } - - TTransport transport; - try { - transport = newTransport( null, MASTERSERVER_ADDRESS, MASTERSERVER_PORT, MASTERSERVER_TIMEOUT ); - } catch ( TTransportException e ) { - LOGGER.error( "Could not open transport to thrift's server with IP: " + MASTERSERVER_ADDRESS ); + + public static SatelliteServer.Client getNewSatelliteClient( SSLContext ctx, String address, int port, int timeout ) + { + TProtocol protocol = newTransport( ctx, address, port, timeout ); + if ( protocol == null ) return null; - } - final TProtocol protocol = new TBinaryProtocol( - transport ); - // now we are ready to create the client, according to ClientType! - return new MasterServer.Client( protocol ); + return new SatelliteServer.Client( protocol ); } - - private static TTransport newTransport( SSLContext ctx, String host, int port, int timeout ) throws TTransportException { - TSocket tsock; - if (ctx == null) { - tsock = new TSocket( host, port, timeout ); - tsock.open(); - } else { - Socket socket = null; - try { - socket = ctx.getSocketFactory().createSocket(); - socket.setSoTimeout(timeout); - socket.connect( new InetSocketAddress( host, port ), timeout ); - } catch (IOException e) { - if ( socket != null ) { - Util.safeClose( socket ); + + private static TProtocol newTransport( SSLContext ctx, String host, int port, int timeout ) + { + try { + TSocket tsock; + if ( ctx == null ) { + tsock = new TSocket( host, port, timeout ); + tsock.open(); + } else { + Socket socket = null; + try { + socket = ctx.getSocketFactory().createSocket(); + socket.setSoTimeout( timeout ); + socket.connect( new InetSocketAddress( host, port ), timeout ); + } catch ( IOException e ) { + if ( socket != null ) { + Util.safeClose( socket ); + } + throw new TTransportException(); } - throw new TTransportException(); + tsock = new TSocket( socket ); } - tsock = new TSocket( socket ); + return new TBinaryProtocol( new TFramedTransport( tsock ) ); + } catch ( TTransportException e ) { + LOGGER.error( "Could not open transport to thrift server at " + host + ":" + port ); + return null; } - return new TFramedTransport( tsock ); } } diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index e392a81..e348d58 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -93,7 +93,8 @@ struct Organization { struct Satellite { 1: list<string> addressList, - 2: string displayName + 2: string displayName, + 3: binary certSha256 } // Old session information for clients logging in via "test-account" @@ -308,6 +309,8 @@ struct TransferInformation { 1: string token, 2: i32 plainPort, 3: i32 sslPort, + 4: optional list<binary> blockHashes, // Only if transfer is a download (and list is known) + 5: optional string machineDescription, // Only if transfer is a download } // Used to tell status of an upload. The blockStatus is one byte per 16MB block, @@ -333,7 +336,7 @@ struct SatelliteConfig { // ############ EXCEPTION ###################### exception TTransferRejectedException { - 1: string reason, + 1: string message, } exception TAuthorizationException { |