diff options
author | Simon Rettberg | 2016-04-18 15:18:05 +0200 |
---|---|---|
committer | Simon Rettberg | 2016-04-18 15:18:05 +0200 |
commit | cc70f09431deb7937e01cc6583884fb5067a2994 (patch) | |
tree | fcf7c8720a4479b09e07c82eb13f7015bb4d0533 /src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java | |
parent | Preparations/changes for global image sync (diff) | |
download | master-sync-shared-cc70f09431deb7937e01cc6583884fb5067a2994.tar.gz master-sync-shared-cc70f09431deb7937e01cc6583884fb5067a2994.tar.xz master-sync-shared-cc70f09431deb7937e01cc6583884fb5067a2994.zip |
More additions for central image store
Diffstat (limited to 'src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java')
-rw-r--r-- | src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java | 1573 |
1 files changed, 1561 insertions, 12 deletions
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 1b8da61..88cda96 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/SatelliteServer.java @@ -34,12 +34,12 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"}) -@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-01-04") +@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-04-18") public class SatelliteServer { public interface Iface { - public long getVersion() throws org.apache.thrift.TException; + public long getVersion(long clientVersion) throws org.apache.thrift.TException; public SatelliteConfig getConfiguration() throws org.apache.thrift.TException; @@ -101,6 +101,8 @@ public class SatelliteServer { public String requestImageReplication(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, org.apache.thrift.TException; + public String publishImageVersion(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, TTransferRejectedException, org.apache.thrift.TException; + public String createLecture(String userToken, LectureWrite lecture) throws TAuthorizationException, TInvocationException, TInvalidDateParam, TNotFoundException, org.apache.thrift.TException; public void updateLecture(String userToken, String lectureId, LectureWrite lecture) throws TAuthorizationException, TNotFoundException, TInvocationException, TInvalidDateParam, org.apache.thrift.TException; @@ -121,7 +123,7 @@ public class SatelliteServer { public interface AsyncIface { - public void getVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getVersion(long clientVersion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getConfiguration(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -183,6 +185,8 @@ public class SatelliteServer { public void requestImageReplication(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void publishImageVersion(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void createLecture(String userToken, LectureWrite lecture, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void updateLecture(String userToken, String lectureId, LectureWrite lecture, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -221,15 +225,16 @@ public class SatelliteServer { super(iprot, oprot); } - public long getVersion() throws org.apache.thrift.TException + public long getVersion(long clientVersion) throws org.apache.thrift.TException { - send_getVersion(); + send_getVersion(clientVersion); return recv_getVersion(); } - public void send_getVersion() throws org.apache.thrift.TException + public void send_getVersion(long clientVersion) throws org.apache.thrift.TException { getVersion_args args = new getVersion_args(); + args.setClientVersion(clientVersion); sendBase("getVersion", args); } @@ -1088,6 +1093,42 @@ public class SatelliteServer { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "requestImageReplication failed: unknown result"); } + public String publishImageVersion(String userToken, String imageVersionId) throws TAuthorizationException, TNotFoundException, TInvocationException, TTransferRejectedException, org.apache.thrift.TException + { + send_publishImageVersion(userToken, imageVersionId); + return recv_publishImageVersion(); + } + + public void send_publishImageVersion(String userToken, String imageVersionId) throws org.apache.thrift.TException + { + publishImageVersion_args args = new publishImageVersion_args(); + args.setUserToken(userToken); + args.setImageVersionId(imageVersionId); + sendBase("publishImageVersion", args); + } + + public String recv_publishImageVersion() throws TAuthorizationException, TNotFoundException, TInvocationException, TTransferRejectedException, org.apache.thrift.TException + { + publishImageVersion_result result = new publishImageVersion_result(); + receiveBase(result, "publishImageVersion"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.authError != null) { + throw result.authError; + } + if (result.notFound != null) { + throw result.notFound; + } + if (result.serverError != null) { + throw result.serverError; + } + if (result.tre != null) { + throw result.tre; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "publishImageVersion failed: unknown result"); + } + public String createLecture(String userToken, LectureWrite lecture) throws TAuthorizationException, TInvocationException, TInvalidDateParam, TNotFoundException, org.apache.thrift.TException { send_createLecture(userToken, lecture); @@ -1364,21 +1405,24 @@ public class SatelliteServer { super(protocolFactory, clientManager, transport); } - public void getVersion(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void getVersion(long clientVersion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - getVersion_call method_call = new getVersion_call(resultHandler, this, ___protocolFactory, ___transport); + getVersion_call method_call = new getVersion_call(clientVersion, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class getVersion_call extends org.apache.thrift.async.TAsyncMethodCall { - public getVersion_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + private long clientVersion; + public getVersion_call(long clientVersion, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { super(client, protocolFactory, transport, resultHandler, false); + this.clientVersion = clientVersion; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getVersion", org.apache.thrift.protocol.TMessageType.CALL, 0)); getVersion_args args = new getVersion_args(); + args.setClientVersion(clientVersion); args.write(prot); prot.writeMessageEnd(); } @@ -2413,6 +2457,41 @@ public class SatelliteServer { } } + public void publishImageVersion(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + publishImageVersion_call method_call = new publishImageVersion_call(userToken, imageVersionId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class publishImageVersion_call extends org.apache.thrift.async.TAsyncMethodCall { + private String userToken; + private String imageVersionId; + public publishImageVersion_call(String userToken, String imageVersionId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException { + super(client, protocolFactory, transport, resultHandler, false); + this.userToken = userToken; + this.imageVersionId = imageVersionId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("publishImageVersion", org.apache.thrift.protocol.TMessageType.CALL, 0)); + publishImageVersion_args args = new publishImageVersion_args(); + args.setUserToken(userToken); + args.setImageVersionId(imageVersionId); + args.write(prot); + prot.writeMessageEnd(); + } + + public String getResult() throws TAuthorizationException, TNotFoundException, TInvocationException, TTransferRejectedException, org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_publishImageVersion(); + } + } + public void createLecture(String userToken, LectureWrite lecture, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); createLecture_call method_call = new createLecture_call(userToken, lecture, resultHandler, this, ___protocolFactory, ___transport); @@ -2746,6 +2825,7 @@ public class SatelliteServer { processMap.put("setImageOwner", new setImageOwner()); processMap.put("setImageVersionExpiry", new setImageVersionExpiry()); processMap.put("requestImageReplication", new requestImageReplication()); + processMap.put("publishImageVersion", new publishImageVersion()); processMap.put("createLecture", new createLecture()); processMap.put("updateLecture", new updateLecture()); processMap.put("getLectureList", new getLectureList()); @@ -2772,7 +2852,7 @@ public class SatelliteServer { public getVersion_result getResult(I iface, getVersion_args args) throws org.apache.thrift.TException { getVersion_result result = new getVersion_result(); - result.success = iface.getVersion(); + result.success = iface.getVersion(args.clientVersion); result.setSuccessIsSet(true); return result; } @@ -3542,6 +3622,36 @@ public class SatelliteServer { } } + public static class publishImageVersion<I extends Iface> extends org.apache.thrift.ProcessFunction<I, publishImageVersion_args> { + public publishImageVersion() { + super("publishImageVersion"); + } + + public publishImageVersion_args getEmptyArgsInstance() { + return new publishImageVersion_args(); + } + + protected boolean isOneway() { + return false; + } + + public publishImageVersion_result getResult(I iface, publishImageVersion_args args) throws org.apache.thrift.TException { + publishImageVersion_result result = new publishImageVersion_result(); + try { + result.success = iface.publishImageVersion(args.userToken, args.imageVersionId); + } catch (TAuthorizationException authError) { + result.authError = authError; + } catch (TNotFoundException notFound) { + result.notFound = notFound; + } catch (TInvocationException serverError) { + result.serverError = serverError; + } catch (TTransferRejectedException tre) { + result.tre = tre; + } + return result; + } + } + public static class createLecture<I extends Iface> extends org.apache.thrift.ProcessFunction<I, createLecture_args> { public createLecture() { super("createLecture"); @@ -3812,6 +3922,7 @@ public class SatelliteServer { processMap.put("setImageOwner", new setImageOwner()); processMap.put("setImageVersionExpiry", new setImageVersionExpiry()); processMap.put("requestImageReplication", new requestImageReplication()); + processMap.put("publishImageVersion", new publishImageVersion()); processMap.put("createLecture", new createLecture()); processMap.put("updateLecture", new updateLecture()); processMap.put("getLectureList", new getLectureList()); @@ -3871,7 +3982,7 @@ public class SatelliteServer { } public void start(I iface, getVersion_args args, org.apache.thrift.async.AsyncMethodCallback<Long> resultHandler) throws TException { - iface.getVersion(resultHandler); + iface.getVersion(args.clientVersion,resultHandler); } } @@ -5706,6 +5817,78 @@ public class SatelliteServer { } } + public static class publishImageVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, publishImageVersion_args, String> { + public publishImageVersion() { + super("publishImageVersion"); + } + + public publishImageVersion_args getEmptyArgsInstance() { + return new publishImageVersion_args(); + } + + public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<String>() { + public void onComplete(String o) { + publishImageVersion_result result = new publishImageVersion_result(); + result.success = o; + try { + fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); + return; + } catch (Exception e) { + LOGGER.error("Exception writing to internal frame buffer", e); + } + fb.close(); + } + public void onError(Exception e) { + byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; + org.apache.thrift.TBase msg; + publishImageVersion_result result = new publishImageVersion_result(); + if (e instanceof TAuthorizationException) { + result.authError = (TAuthorizationException) e; + result.setAuthErrorIsSet(true); + msg = result; + } + else if (e instanceof TNotFoundException) { + result.notFound = (TNotFoundException) e; + result.setNotFoundIsSet(true); + msg = result; + } + else if (e instanceof TInvocationException) { + result.serverError = (TInvocationException) e; + result.setServerErrorIsSet(true); + msg = result; + } + else if (e instanceof TTransferRejectedException) { + result.tre = (TTransferRejectedException) e; + result.setTreIsSet(true); + msg = result; + } + else + { + msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION; + msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage()); + } + try { + fcall.sendResponse(fb,msg,msgType,seqid); + return; + } catch (Exception ex) { + LOGGER.error("Exception writing to internal frame buffer", ex); + } + fb.close(); + } + }; + } + + protected boolean isOneway() { + return false; + } + + public void start(I iface, publishImageVersion_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { + iface.publishImageVersion(args.userToken, args.imageVersionId,resultHandler); + } + } + public static class createLecture<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, createLecture_args, String> { public createLecture() { super("createLecture"); @@ -6248,6 +6431,7 @@ public class SatelliteServer { public static class getVersion_args implements org.apache.thrift.TBase<getVersion_args, getVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<getVersion_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getVersion_args"); + private static final org.apache.thrift.protocol.TField CLIENT_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("clientVersion", org.apache.thrift.protocol.TType.I64, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { @@ -6255,10 +6439,11 @@ public class SatelliteServer { schemes.put(TupleScheme.class, new getVersion_argsTupleSchemeFactory()); } + public long clientVersion; // 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 { -; + CLIENT_VERSION((short)1, "clientVersion"); private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); @@ -6273,6 +6458,8 @@ public class SatelliteServer { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // CLIENT_VERSION + return CLIENT_VERSION; default: return null; } @@ -6311,9 +6498,15 @@ public class SatelliteServer { return _fieldName; } } + + // isset id assignments + private static final int __CLIENTVERSION_ISSET_ID = 0; + private byte __isset_bitfield = 0; 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.CLIENT_VERSION, new org.apache.thrift.meta_data.FieldMetaData("clientVersion", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "int"))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getVersion_args.class, metaDataMap); } @@ -6321,10 +6514,20 @@ public class SatelliteServer { public getVersion_args() { } + public getVersion_args( + long clientVersion) + { + this(); + this.clientVersion = clientVersion; + setClientVersionIsSet(true); + } + /** * Performs a deep copy on <i>other</i>. */ public getVersion_args(getVersion_args other) { + __isset_bitfield = other.__isset_bitfield; + this.clientVersion = other.clientVersion; } public getVersion_args deepCopy() { @@ -6333,15 +6536,51 @@ public class SatelliteServer { @Override public void clear() { + setClientVersionIsSet(false); + this.clientVersion = 0; + } + + public long getClientVersion() { + return this.clientVersion; + } + + public getVersion_args setClientVersion(long clientVersion) { + this.clientVersion = clientVersion; + setClientVersionIsSet(true); + return this; + } + + public void unsetClientVersion() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CLIENTVERSION_ISSET_ID); + } + + /** Returns true if field clientVersion is set (has been assigned a value) and false otherwise */ + public boolean isSetClientVersion() { + return EncodingUtils.testBit(__isset_bitfield, __CLIENTVERSION_ISSET_ID); + } + + public void setClientVersionIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CLIENTVERSION_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { + case CLIENT_VERSION: + if (value == null) { + unsetClientVersion(); + } else { + setClientVersion((Long)value); + } + break; + } } public Object getFieldValue(_Fields field) { switch (field) { + case CLIENT_VERSION: + return getClientVersion(); + } throw new IllegalStateException(); } @@ -6353,6 +6592,8 @@ public class SatelliteServer { } switch (field) { + case CLIENT_VERSION: + return isSetClientVersion(); } throw new IllegalStateException(); } @@ -6370,6 +6611,15 @@ public class SatelliteServer { if (that == null) return false; + boolean this_present_clientVersion = true; + boolean that_present_clientVersion = true; + if (this_present_clientVersion || that_present_clientVersion) { + if (!(this_present_clientVersion && that_present_clientVersion)) + return false; + if (this.clientVersion != that.clientVersion) + return false; + } + return true; } @@ -6377,6 +6627,11 @@ public class SatelliteServer { public int hashCode() { List<Object> list = new ArrayList<Object>(); + boolean present_clientVersion = true; + list.add(present_clientVersion); + if (present_clientVersion) + list.add(clientVersion); + return list.hashCode(); } @@ -6388,6 +6643,16 @@ public class SatelliteServer { int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetClientVersion()).compareTo(other.isSetClientVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetClientVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientVersion, other.clientVersion); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -6408,6 +6673,9 @@ public class SatelliteServer { StringBuilder sb = new StringBuilder("getVersion_args("); boolean first = true; + sb.append("clientVersion:"); + sb.append(this.clientVersion); + first = false; sb.append(")"); return sb.toString(); } @@ -6427,6 +6695,8 @@ public class SatelliteServer { private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); @@ -6451,6 +6721,14 @@ public class SatelliteServer { break; } switch (schemeField.id) { + case 1: // CLIENT_VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.clientVersion = iprot.readI64(); + struct.setClientVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -6466,6 +6744,9 @@ public class SatelliteServer { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(CLIENT_VERSION_FIELD_DESC); + oprot.writeI64(struct.clientVersion); + oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -6483,11 +6764,24 @@ public class SatelliteServer { @Override public void write(org.apache.thrift.protocol.TProtocol prot, getVersion_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetClientVersion()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetClientVersion()) { + oprot.writeI64(struct.clientVersion); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, getVersion_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.clientVersion = iprot.readI64(); + struct.setClientVersionIsSet(true); + } } } @@ -36065,6 +36359,1261 @@ public class SatelliteServer { } + public static class publishImageVersion_args implements org.apache.thrift.TBase<publishImageVersion_args, publishImageVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<publishImageVersion_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publishImageVersion_args"); + + private static final org.apache.thrift.protocol.TField USER_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("userToken", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField IMAGE_VERSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageVersionId", org.apache.thrift.protocol.TType.STRING, (short)2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new publishImageVersion_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new publishImageVersion_argsTupleSchemeFactory()); + } + + public String userToken; // required + public String imageVersionId; // 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 { + USER_TOKEN((short)1, "userToken"), + IMAGE_VERSION_ID((short)2, "imageVersionId"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // USER_TOKEN + return USER_TOKEN; + case 2: // IMAGE_VERSION_ID + return IMAGE_VERSION_ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + 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.USER_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("userToken", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "Token"))); + tmpMap.put(_Fields.IMAGE_VERSION_ID, new org.apache.thrift.meta_data.FieldMetaData("imageVersionId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publishImageVersion_args.class, metaDataMap); + } + + public publishImageVersion_args() { + } + + public publishImageVersion_args( + String userToken, + String imageVersionId) + { + this(); + this.userToken = userToken; + this.imageVersionId = imageVersionId; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public publishImageVersion_args(publishImageVersion_args other) { + if (other.isSetUserToken()) { + this.userToken = other.userToken; + } + if (other.isSetImageVersionId()) { + this.imageVersionId = other.imageVersionId; + } + } + + public publishImageVersion_args deepCopy() { + return new publishImageVersion_args(this); + } + + @Override + public void clear() { + this.userToken = null; + this.imageVersionId = null; + } + + public String getUserToken() { + return this.userToken; + } + + public publishImageVersion_args setUserToken(String userToken) { + this.userToken = userToken; + return this; + } + + public void unsetUserToken() { + this.userToken = null; + } + + /** Returns true if field userToken is set (has been assigned a value) and false otherwise */ + public boolean isSetUserToken() { + return this.userToken != null; + } + + public void setUserTokenIsSet(boolean value) { + if (!value) { + this.userToken = null; + } + } + + public String getImageVersionId() { + return this.imageVersionId; + } + + public publishImageVersion_args setImageVersionId(String imageVersionId) { + this.imageVersionId = imageVersionId; + return this; + } + + public void unsetImageVersionId() { + this.imageVersionId = null; + } + + /** Returns true if field imageVersionId is set (has been assigned a value) and false otherwise */ + public boolean isSetImageVersionId() { + return this.imageVersionId != null; + } + + public void setImageVersionIdIsSet(boolean value) { + if (!value) { + this.imageVersionId = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_TOKEN: + if (value == null) { + unsetUserToken(); + } else { + setUserToken((String)value); + } + break; + + case IMAGE_VERSION_ID: + if (value == null) { + unsetImageVersionId(); + } else { + setImageVersionId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_TOKEN: + return getUserToken(); + + case IMAGE_VERSION_ID: + return getImageVersionId(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USER_TOKEN: + return isSetUserToken(); + case IMAGE_VERSION_ID: + return isSetImageVersionId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof publishImageVersion_args) + return this.equals((publishImageVersion_args)that); + return false; + } + + public boolean equals(publishImageVersion_args that) { + if (that == null) + return false; + + boolean this_present_userToken = true && this.isSetUserToken(); + boolean that_present_userToken = true && that.isSetUserToken(); + if (this_present_userToken || that_present_userToken) { + if (!(this_present_userToken && that_present_userToken)) + return false; + if (!this.userToken.equals(that.userToken)) + return false; + } + + boolean this_present_imageVersionId = true && this.isSetImageVersionId(); + boolean that_present_imageVersionId = true && that.isSetImageVersionId(); + if (this_present_imageVersionId || that_present_imageVersionId) { + if (!(this_present_imageVersionId && that_present_imageVersionId)) + return false; + if (!this.imageVersionId.equals(that.imageVersionId)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_userToken = true && (isSetUserToken()); + list.add(present_userToken); + if (present_userToken) + list.add(userToken); + + boolean present_imageVersionId = true && (isSetImageVersionId()); + list.add(present_imageVersionId); + if (present_imageVersionId) + list.add(imageVersionId); + + return list.hashCode(); + } + + @Override + public int compareTo(publishImageVersion_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUserToken()).compareTo(other.isSetUserToken()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserToken()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userToken, other.userToken); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImageVersionId()).compareTo(other.isSetImageVersionId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImageVersionId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageVersionId, other.imageVersionId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("publishImageVersion_args("); + boolean first = true; + + sb.append("userToken:"); + if (this.userToken == null) { + sb.append("null"); + } else { + sb.append(this.userToken); + } + first = false; + if (!first) sb.append(", "); + sb.append("imageVersionId:"); + if (this.imageVersionId == null) { + sb.append("null"); + } else { + sb.append(this.imageVersionId); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class publishImageVersion_argsStandardSchemeFactory implements SchemeFactory { + public publishImageVersion_argsStandardScheme getScheme() { + return new publishImageVersion_argsStandardScheme(); + } + } + + private static class publishImageVersion_argsStandardScheme extends StandardScheme<publishImageVersion_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, publishImageVersion_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_TOKEN + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userToken = iprot.readString(); + struct.setUserTokenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // IMAGE_VERSION_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageVersionId = iprot.readString(); + struct.setImageVersionIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, publishImageVersion_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.userToken != null) { + oprot.writeFieldBegin(USER_TOKEN_FIELD_DESC); + oprot.writeString(struct.userToken); + oprot.writeFieldEnd(); + } + if (struct.imageVersionId != null) { + oprot.writeFieldBegin(IMAGE_VERSION_ID_FIELD_DESC); + oprot.writeString(struct.imageVersionId); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class publishImageVersion_argsTupleSchemeFactory implements SchemeFactory { + public publishImageVersion_argsTupleScheme getScheme() { + return new publishImageVersion_argsTupleScheme(); + } + } + + private static class publishImageVersion_argsTupleScheme extends TupleScheme<publishImageVersion_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, publishImageVersion_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserToken()) { + optionals.set(0); + } + if (struct.isSetImageVersionId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserToken()) { + oprot.writeString(struct.userToken); + } + if (struct.isSetImageVersionId()) { + oprot.writeString(struct.imageVersionId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, publishImageVersion_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userToken = iprot.readString(); + struct.setUserTokenIsSet(true); + } + if (incoming.get(1)) { + struct.imageVersionId = iprot.readString(); + struct.setImageVersionIdIsSet(true); + } + } + } + + } + + public static class publishImageVersion_result implements org.apache.thrift.TBase<publishImageVersion_result, publishImageVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<publishImageVersion_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publishImageVersion_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final org.apache.thrift.protocol.TField AUTH_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("authError", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField NOT_FOUND_FIELD_DESC = new org.apache.thrift.protocol.TField("notFound", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField SERVER_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serverError", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField TRE_FIELD_DESC = new org.apache.thrift.protocol.TField("tre", org.apache.thrift.protocol.TType.STRUCT, (short)4); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new publishImageVersion_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new publishImageVersion_resultTupleSchemeFactory()); + } + + public String success; // required + public TAuthorizationException authError; // required + public TNotFoundException notFound; // required + public TInvocationException serverError; // required + public TTransferRejectedException tre; // 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 { + SUCCESS((short)0, "success"), + AUTH_ERROR((short)1, "authError"), + NOT_FOUND((short)2, "notFound"), + SERVER_ERROR((short)3, "serverError"), + TRE((short)4, "tre"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + case 1: // AUTH_ERROR + return AUTH_ERROR; + case 2: // NOT_FOUND + return NOT_FOUND; + case 3: // SERVER_ERROR + return SERVER_ERROR; + case 4: // TRE + return TRE; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); + tmpMap.put(_Fields.AUTH_ERROR, new org.apache.thrift.meta_data.FieldMetaData("authError", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.NOT_FOUND, new org.apache.thrift.meta_data.FieldMetaData("notFound", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.SERVER_ERROR, new org.apache.thrift.meta_data.FieldMetaData("serverError", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.TRE, new org.apache.thrift.meta_data.FieldMetaData("tre", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publishImageVersion_result.class, metaDataMap); + } + + public publishImageVersion_result() { + } + + public publishImageVersion_result( + String success, + TAuthorizationException authError, + TNotFoundException notFound, + TInvocationException serverError, + TTransferRejectedException tre) + { + this(); + this.success = success; + this.authError = authError; + this.notFound = notFound; + this.serverError = serverError; + this.tre = tre; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public publishImageVersion_result(publishImageVersion_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + if (other.isSetAuthError()) { + this.authError = new TAuthorizationException(other.authError); + } + if (other.isSetNotFound()) { + this.notFound = new TNotFoundException(other.notFound); + } + if (other.isSetServerError()) { + this.serverError = new TInvocationException(other.serverError); + } + if (other.isSetTre()) { + this.tre = new TTransferRejectedException(other.tre); + } + } + + public publishImageVersion_result deepCopy() { + return new publishImageVersion_result(this); + } + + @Override + public void clear() { + this.success = null; + this.authError = null; + this.notFound = null; + this.serverError = null; + this.tre = null; + } + + public String getSuccess() { + return this.success; + } + + public publishImageVersion_result setSuccess(String success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public TAuthorizationException getAuthError() { + return this.authError; + } + + public publishImageVersion_result setAuthError(TAuthorizationException authError) { + this.authError = authError; + return this; + } + + public void unsetAuthError() { + this.authError = null; + } + + /** Returns true if field authError is set (has been assigned a value) and false otherwise */ + public boolean isSetAuthError() { + return this.authError != null; + } + + public void setAuthErrorIsSet(boolean value) { + if (!value) { + this.authError = null; + } + } + + public TNotFoundException getNotFound() { + return this.notFound; + } + + public publishImageVersion_result setNotFound(TNotFoundException notFound) { + this.notFound = notFound; + return this; + } + + public void unsetNotFound() { + this.notFound = null; + } + + /** Returns true if field notFound is set (has been assigned a value) and false otherwise */ + public boolean isSetNotFound() { + return this.notFound != null; + } + + public void setNotFoundIsSet(boolean value) { + if (!value) { + this.notFound = null; + } + } + + public TInvocationException getServerError() { + return this.serverError; + } + + public publishImageVersion_result setServerError(TInvocationException serverError) { + this.serverError = serverError; + return this; + } + + public void unsetServerError() { + this.serverError = null; + } + + /** Returns true if field serverError is set (has been assigned a value) and false otherwise */ + public boolean isSetServerError() { + return this.serverError != null; + } + + public void setServerErrorIsSet(boolean value) { + if (!value) { + this.serverError = null; + } + } + + public TTransferRejectedException getTre() { + return this.tre; + } + + public publishImageVersion_result setTre(TTransferRejectedException tre) { + this.tre = tre; + return this; + } + + public void unsetTre() { + this.tre = null; + } + + /** Returns true if field tre is set (has been assigned a value) and false otherwise */ + public boolean isSetTre() { + return this.tre != null; + } + + public void setTreIsSet(boolean value) { + if (!value) { + this.tre = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((String)value); + } + break; + + case AUTH_ERROR: + if (value == null) { + unsetAuthError(); + } else { + setAuthError((TAuthorizationException)value); + } + break; + + case NOT_FOUND: + if (value == null) { + unsetNotFound(); + } else { + setNotFound((TNotFoundException)value); + } + break; + + case SERVER_ERROR: + if (value == null) { + unsetServerError(); + } else { + setServerError((TInvocationException)value); + } + break; + + case TRE: + if (value == null) { + unsetTre(); + } else { + setTre((TTransferRejectedException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case AUTH_ERROR: + return getAuthError(); + + case NOT_FOUND: + return getNotFound(); + + case SERVER_ERROR: + return getServerError(); + + case TRE: + return getTre(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + case AUTH_ERROR: + return isSetAuthError(); + case NOT_FOUND: + return isSetNotFound(); + case SERVER_ERROR: + return isSetServerError(); + case TRE: + return isSetTre(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof publishImageVersion_result) + return this.equals((publishImageVersion_result)that); + return false; + } + + public boolean equals(publishImageVersion_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_authError = true && this.isSetAuthError(); + boolean that_present_authError = true && that.isSetAuthError(); + if (this_present_authError || that_present_authError) { + if (!(this_present_authError && that_present_authError)) + return false; + if (!this.authError.equals(that.authError)) + return false; + } + + boolean this_present_notFound = true && this.isSetNotFound(); + boolean that_present_notFound = true && that.isSetNotFound(); + if (this_present_notFound || that_present_notFound) { + if (!(this_present_notFound && that_present_notFound)) + return false; + if (!this.notFound.equals(that.notFound)) + return false; + } + + boolean this_present_serverError = true && this.isSetServerError(); + boolean that_present_serverError = true && that.isSetServerError(); + if (this_present_serverError || that_present_serverError) { + if (!(this_present_serverError && that_present_serverError)) + return false; + if (!this.serverError.equals(that.serverError)) + return false; + } + + boolean this_present_tre = true && this.isSetTre(); + boolean that_present_tre = true && that.isSetTre(); + if (this_present_tre || that_present_tre) { + if (!(this_present_tre && that_present_tre)) + return false; + if (!this.tre.equals(that.tre)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + List<Object> list = new ArrayList<Object>(); + + boolean present_success = true && (isSetSuccess()); + list.add(present_success); + if (present_success) + list.add(success); + + boolean present_authError = true && (isSetAuthError()); + list.add(present_authError); + if (present_authError) + list.add(authError); + + boolean present_notFound = true && (isSetNotFound()); + list.add(present_notFound); + if (present_notFound) + list.add(notFound); + + boolean present_serverError = true && (isSetServerError()); + list.add(present_serverError); + if (present_serverError) + list.add(serverError); + + boolean present_tre = true && (isSetTre()); + list.add(present_tre); + if (present_tre) + list.add(tre); + + return list.hashCode(); + } + + @Override + public int compareTo(publishImageVersion_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetAuthError()).compareTo(other.isSetAuthError()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetAuthError()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authError, other.authError); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNotFound()).compareTo(other.isSetNotFound()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNotFound()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notFound, other.notFound); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetServerError()).compareTo(other.isSetServerError()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetServerError()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverError, other.serverError); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTre()).compareTo(other.isSetTre()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTre()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tre, other.tre); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("publishImageVersion_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("authError:"); + if (this.authError == null) { + sb.append("null"); + } else { + sb.append(this.authError); + } + first = false; + if (!first) sb.append(", "); + sb.append("notFound:"); + if (this.notFound == null) { + sb.append("null"); + } else { + sb.append(this.notFound); + } + first = false; + if (!first) sb.append(", "); + sb.append("serverError:"); + if (this.serverError == null) { + sb.append("null"); + } else { + sb.append(this.serverError); + } + first = false; + if (!first) sb.append(", "); + sb.append("tre:"); + if (this.tre == null) { + sb.append("null"); + } else { + sb.append(this.tre); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class publishImageVersion_resultStandardSchemeFactory implements SchemeFactory { + public publishImageVersion_resultStandardScheme getScheme() { + return new publishImageVersion_resultStandardScheme(); + } + } + + private static class publishImageVersion_resultStandardScheme extends StandardScheme<publishImageVersion_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, publishImageVersion_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // AUTH_ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.authError = new TAuthorizationException(); + struct.authError.read(iprot); + struct.setAuthErrorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NOT_FOUND + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.notFound = new TNotFoundException(); + struct.notFound.read(iprot); + struct.setNotFoundIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // SERVER_ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.serverError = new TInvocationException(); + struct.serverError.read(iprot); + struct.setServerErrorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // TRE + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.tre = new TTransferRejectedException(); + struct.tre.read(iprot); + struct.setTreIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, publishImageVersion_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + if (struct.authError != null) { + oprot.writeFieldBegin(AUTH_ERROR_FIELD_DESC); + struct.authError.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.notFound != null) { + oprot.writeFieldBegin(NOT_FOUND_FIELD_DESC); + struct.notFound.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.serverError != null) { + oprot.writeFieldBegin(SERVER_ERROR_FIELD_DESC); + struct.serverError.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.tre != null) { + oprot.writeFieldBegin(TRE_FIELD_DESC); + struct.tre.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class publishImageVersion_resultTupleSchemeFactory implements SchemeFactory { + public publishImageVersion_resultTupleScheme getScheme() { + return new publishImageVersion_resultTupleScheme(); + } + } + + private static class publishImageVersion_resultTupleScheme extends TupleScheme<publishImageVersion_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, publishImageVersion_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetAuthError()) { + optionals.set(1); + } + if (struct.isSetNotFound()) { + optionals.set(2); + } + if (struct.isSetServerError()) { + optionals.set(3); + } + if (struct.isSetTre()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + if (struct.isSetAuthError()) { + struct.authError.write(oprot); + } + if (struct.isSetNotFound()) { + struct.notFound.write(oprot); + } + if (struct.isSetServerError()) { + struct.serverError.write(oprot); + } + if (struct.isSetTre()) { + struct.tre.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, publishImageVersion_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.authError = new TAuthorizationException(); + struct.authError.read(iprot); + struct.setAuthErrorIsSet(true); + } + if (incoming.get(2)) { + struct.notFound = new TNotFoundException(); + struct.notFound.read(iprot); + struct.setNotFoundIsSet(true); + } + if (incoming.get(3)) { + struct.serverError = new TInvocationException(); + struct.serverError.read(iprot); + struct.setServerErrorIsSet(true); + } + if (incoming.get(4)) { + struct.tre = new TTransferRejectedException(); + struct.tre.read(iprot); + struct.setTreIsSet(true); + } + } + } + + } + public static class createLecture_args implements org.apache.thrift.TBase<createLecture_args, createLecture_args._Fields>, java.io.Serializable, Cloneable, Comparable<createLecture_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createLecture_args"); |