From 19688656134b288fd981730544dde303c9c3afd9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 14 Aug 2015 15:31:12 +0200 Subject: Thrift api changes --- .../openslx/bwlp/thrift/iface/DateParamError.java | 48 + .../bwlp/thrift/iface/ImageSummaryRead.java | 152 +- .../org/openslx/bwlp/thrift/iface/LectureRead.java | 289 ++-- .../openslx/bwlp/thrift/iface/SatelliteServer.java | 1767 +++++++++++++++++++- .../bwlp/thrift/iface/TInvalidDateParam.java | 504 ++++++ .../bwlp/thrift/iface/TNotFoundException.java | 110 +- .../java/org/openslx/thrifthelper/Comparators.java | 78 + src/main/thrift/bwlp.thrift | 27 +- 8 files changed, 2768 insertions(+), 207 deletions(-) create mode 100644 src/main/java/org/openslx/bwlp/thrift/iface/DateParamError.java create mode 100644 src/main/java/org/openslx/bwlp/thrift/iface/TInvalidDateParam.java create mode 100644 src/main/java/org/openslx/thrifthelper/Comparators.java diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/DateParamError.java b/src/main/java/org/openslx/bwlp/thrift/iface/DateParamError.java new file mode 100644 index 0000000..3163a8f --- /dev/null +++ b/src/main/java/org/openslx/bwlp/thrift/iface/DateParamError.java @@ -0,0 +1,48 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.openslx.bwlp.thrift.iface; + + +import java.util.Map; +import java.util.HashMap; +import org.apache.thrift.TEnum; + +public enum DateParamError implements org.apache.thrift.TEnum { + TOO_LOW(0), + TOO_HIGH(1), + NEGATIVE_RANGE(2); + + private final int value; + + private DateParamError(int value) { + this.value = value; + } + + /** + * Get the integer value of this enum value, as defined in the Thrift IDL. + */ + public int getValue() { + return value; + } + + /** + * Find a the enum type by its integer value, as defined in the Thrift IDL. + * @return null if the value is not found. + */ + public static DateParamError findByValue(int value) { + switch (value) { + case 0: + return TOO_LOW; + case 1: + return TOO_HIGH; + case 2: + return NEGATIVE_RANGE; + default: + return null; + } + } +} diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java b/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java index 1e94350..e00e17c 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/ImageSummaryRead.java @@ -42,6 +42,7 @@ public class ImageSummaryRead implements org.apache.thrift.TBase metaDataMap; @@ -225,6 +231,8 @@ public class ImageSummaryRead implements org.apache.thrift.TBase(_list121.size); @@ -2550,7 +2645,7 @@ public class LectureRead implements org.apache.thrift.TBase(_list124.size); @@ -2563,7 +2658,7 @@ public class LectureRead implements org.apache.thrift.TBase(_list127.size); @@ -2577,20 +2672,20 @@ public class LectureRead implements org.apache.thrift.TBase getLectureList(String userToken, int page) throws TAuthorizationException, TInternalServerError, org.apache.thrift.TException; @@ -152,6 +154,8 @@ public class SatelliteServer { public void setImageOwner(String userToken, String imageBaseId, String newOwnerId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void setImageVersionExpiry(String userToken, String imageBaseId, long expireTime, 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; @@ -875,7 +879,41 @@ public class SatelliteServer { return; } - public String createLecture(String userToken, LectureWrite lecture) throws TAuthorizationException, TInternalServerError, org.apache.thrift.TException + public void setImageVersionExpiry(String userToken, String imageBaseId, long expireTime) throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException + { + send_setImageVersionExpiry(userToken, imageBaseId, expireTime); + recv_setImageVersionExpiry(); + } + + public void send_setImageVersionExpiry(String userToken, String imageBaseId, long expireTime) throws org.apache.thrift.TException + { + setImageVersionExpiry_args args = new setImageVersionExpiry_args(); + args.setUserToken(userToken); + args.setImageBaseId(imageBaseId); + args.setExpireTime(expireTime); + sendBase("setImageVersionExpiry", args); + } + + public void recv_setImageVersionExpiry() throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException + { + setImageVersionExpiry_result result = new setImageVersionExpiry_result(); + receiveBase(result, "setImageVersionExpiry"); + if (result.authError != null) { + throw result.authError; + } + if (result.notFound != null) { + throw result.notFound; + } + if (result.serverError != null) { + throw result.serverError; + } + if (result.dateError != null) { + throw result.dateError; + } + return; + } + + public String createLecture(String userToken, LectureWrite lecture) throws TAuthorizationException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { send_createLecture(userToken, lecture); return recv_createLecture(); @@ -889,7 +927,7 @@ public class SatelliteServer { sendBase("createLecture", args); } - public String recv_createLecture() throws TAuthorizationException, TInternalServerError, org.apache.thrift.TException + public String recv_createLecture() throws TAuthorizationException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { createLecture_result result = new createLecture_result(); receiveBase(result, "createLecture"); @@ -902,10 +940,13 @@ public class SatelliteServer { if (result.serverError != null) { throw result.serverError; } + if (result.dateError != null) { + throw result.dateError; + } throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "createLecture failed: unknown result"); } - public void updateLecture(String userToken, String lectureId, LectureWrite lecture) throws TAuthorizationException, TNotFoundException, TInternalServerError, org.apache.thrift.TException + public void updateLecture(String userToken, String lectureId, LectureWrite lecture) throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { send_updateLecture(userToken, lectureId, lecture); recv_updateLecture(); @@ -920,7 +961,7 @@ public class SatelliteServer { sendBase("updateLecture", args); } - public void recv_updateLecture() throws TAuthorizationException, TNotFoundException, TInternalServerError, org.apache.thrift.TException + public void recv_updateLecture() throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { updateLecture_result result = new updateLecture_result(); receiveBase(result, "updateLecture"); @@ -933,6 +974,9 @@ public class SatelliteServer { if (result.serverError != null) { throw result.serverError; } + if (result.dateError != null) { + throw result.dateError; + } return; } @@ -1958,6 +2002,44 @@ public class SatelliteServer { } } + public void setImageVersionExpiry(String userToken, String imageBaseId, long expireTime, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + setImageVersionExpiry_call method_call = new setImageVersionExpiry_call(userToken, imageBaseId, expireTime, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class setImageVersionExpiry_call extends org.apache.thrift.async.TAsyncMethodCall { + private String userToken; + private String imageBaseId; + private long expireTime; + public setImageVersionExpiry_call(String userToken, String imageBaseId, long expireTime, 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.imageBaseId = imageBaseId; + this.expireTime = expireTime; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setImageVersionExpiry", org.apache.thrift.protocol.TMessageType.CALL, 0)); + setImageVersionExpiry_args args = new setImageVersionExpiry_args(); + args.setUserToken(userToken); + args.setImageBaseId(imageBaseId); + args.setExpireTime(expireTime); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, 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); + (new Client(prot)).recv_setImageVersionExpiry(); + } + } + 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); @@ -1983,7 +2065,7 @@ public class SatelliteServer { prot.writeMessageEnd(); } - public String getResult() throws TAuthorizationException, TInternalServerError, org.apache.thrift.TException { + public String getResult() throws TAuthorizationException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } @@ -2021,7 +2103,7 @@ public class SatelliteServer { prot.writeMessageEnd(); } - public void getResult() throws TAuthorizationException, TNotFoundException, TInternalServerError, org.apache.thrift.TException { + public void getResult() throws TAuthorizationException, TNotFoundException, TInternalServerError, TInvalidDateParam, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } @@ -2284,6 +2366,7 @@ public class SatelliteServer { processMap.put("writeImagePermissions", new writeImagePermissions()); processMap.put("getImagePermissions", new getImagePermissions()); processMap.put("setImageOwner", new setImageOwner()); + processMap.put("setImageVersionExpiry", new setImageVersionExpiry()); processMap.put("createLecture", new createLecture()); processMap.put("updateLecture", new updateLecture()); processMap.put("getLectureList", new getLectureList()); @@ -2908,6 +2991,36 @@ public class SatelliteServer { } } + public static class setImageVersionExpiry extends org.apache.thrift.ProcessFunction { + public setImageVersionExpiry() { + super("setImageVersionExpiry"); + } + + public setImageVersionExpiry_args getEmptyArgsInstance() { + return new setImageVersionExpiry_args(); + } + + protected boolean isOneway() { + return false; + } + + public setImageVersionExpiry_result getResult(I iface, setImageVersionExpiry_args args) throws org.apache.thrift.TException { + setImageVersionExpiry_result result = new setImageVersionExpiry_result(); + try { + iface.setImageVersionExpiry(args.userToken, args.imageBaseId, args.expireTime); + } catch (TAuthorizationException authError) { + result.authError = authError; + } catch (TNotFoundException notFound) { + result.notFound = notFound; + } catch (TInternalServerError serverError) { + result.serverError = serverError; + } catch (TInvalidDateParam dateError) { + result.dateError = dateError; + } + return result; + } + } + public static class createLecture extends org.apache.thrift.ProcessFunction { public createLecture() { super("createLecture"); @@ -2929,6 +3042,8 @@ public class SatelliteServer { result.authError = authError; } catch (TInternalServerError serverError) { result.serverError = serverError; + } catch (TInvalidDateParam dateError) { + result.dateError = dateError; } return result; } @@ -2957,6 +3072,8 @@ public class SatelliteServer { result.notFound = notFound; } catch (TInternalServerError serverError) { result.serverError = serverError; + } catch (TInvalidDateParam dateError) { + result.dateError = dateError; } return result; } @@ -3165,6 +3282,7 @@ public class SatelliteServer { processMap.put("writeImagePermissions", new writeImagePermissions()); processMap.put("getImagePermissions", new getImagePermissions()); processMap.put("setImageOwner", new setImageOwner()); + processMap.put("setImageVersionExpiry", new setImageVersionExpiry()); processMap.put("createLecture", new createLecture()); processMap.put("updateLecture", new updateLecture()); processMap.put("getLectureList", new getLectureList()); @@ -4650,6 +4768,77 @@ public class SatelliteServer { } } + public static class setImageVersionExpiry extends org.apache.thrift.AsyncProcessFunction { + public setImageVersionExpiry() { + super("setImageVersionExpiry"); + } + + public setImageVersionExpiry_args getEmptyArgsInstance() { + return new setImageVersionExpiry_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + public void onComplete(Void o) { + setImageVersionExpiry_result result = new setImageVersionExpiry_result(); + 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; + setImageVersionExpiry_result result = new setImageVersionExpiry_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 TInternalServerError) { + result.serverError = (TInternalServerError) e; + result.setServerErrorIsSet(true); + msg = result; + } + else if (e instanceof TInvalidDateParam) { + result.dateError = (TInvalidDateParam) e; + result.setDateErrorIsSet(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, setImageVersionExpiry_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException { + iface.setImageVersionExpiry(args.userToken, args.imageBaseId, args.expireTime,resultHandler); + } + } + public static class createLecture extends org.apache.thrift.AsyncProcessFunction { public createLecture() { super("createLecture"); @@ -4686,6 +4875,11 @@ public class SatelliteServer { result.serverError = (TInternalServerError) e; result.setServerErrorIsSet(true); msg = result; + } + else if (e instanceof TInvalidDateParam) { + result.dateError = (TInvalidDateParam) e; + result.setDateErrorIsSet(true); + msg = result; } else { @@ -4752,6 +4946,11 @@ public class SatelliteServer { result.serverError = (TInternalServerError) e; result.setServerErrorIsSet(true); msg = result; + } + else if (e instanceof TInvalidDateParam) { + result.dateError = (TInvalidDateParam) e; + result.setDateErrorIsSet(true); + msg = result; } else { @@ -28268,25 +28467,28 @@ public class SatelliteServer { } - public static class createLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createLecture_args"); + public static class setImageVersionExpiry_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setImageVersionExpiry_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 LECTURE_FIELD_DESC = new org.apache.thrift.protocol.TField("lecture", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField IMAGE_BASE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("imageBaseId", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField EXPIRE_TIME_FIELD_DESC = new org.apache.thrift.protocol.TField("expireTime", org.apache.thrift.protocol.TType.I64, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { - schemes.put(StandardScheme.class, new createLecture_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new createLecture_argsTupleSchemeFactory()); + schemes.put(StandardScheme.class, new setImageVersionExpiry_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new setImageVersionExpiry_argsTupleSchemeFactory()); } public String userToken; // required - public LectureWrite lecture; // required + public String imageBaseId; // required + public long expireTime; // 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"), - LECTURE((short)2, "lecture"); + IMAGE_BASE_ID((short)2, "imageBaseId"), + EXPIRE_TIME((short)3, "expireTime"); private static final Map byName = new HashMap(); @@ -28303,8 +28505,10 @@ public class SatelliteServer { switch(fieldId) { case 1: // USER_TOKEN return USER_TOKEN; - case 2: // LECTURE - return LECTURE; + case 2: // IMAGE_BASE_ID + return IMAGE_BASE_ID; + case 3: // EXPIRE_TIME + return EXPIRE_TIME; default: return null; } @@ -28345,56 +28549,67 @@ public class SatelliteServer { } // isset id assignments + private static final int __EXPIRETIME_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.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.LECTURE, new org.apache.thrift.meta_data.FieldMetaData("lecture", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LectureWrite.class))); + tmpMap.put(_Fields.IMAGE_BASE_ID, new org.apache.thrift.meta_data.FieldMetaData("imageBaseId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , "UUID"))); + tmpMap.put(_Fields.EXPIRE_TIME, new org.apache.thrift.meta_data.FieldMetaData("expireTime", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64 , "UnixTimestamp"))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createLecture_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(setImageVersionExpiry_args.class, metaDataMap); } - public createLecture_args() { + public setImageVersionExpiry_args() { } - public createLecture_args( + public setImageVersionExpiry_args( String userToken, - LectureWrite lecture) + String imageBaseId, + long expireTime) { this(); this.userToken = userToken; - this.lecture = lecture; + this.imageBaseId = imageBaseId; + this.expireTime = expireTime; + setExpireTimeIsSet(true); } /** * Performs a deep copy on other. */ - public createLecture_args(createLecture_args other) { + public setImageVersionExpiry_args(setImageVersionExpiry_args other) { + __isset_bitfield = other.__isset_bitfield; if (other.isSetUserToken()) { this.userToken = other.userToken; } - if (other.isSetLecture()) { - this.lecture = new LectureWrite(other.lecture); + if (other.isSetImageBaseId()) { + this.imageBaseId = other.imageBaseId; } + this.expireTime = other.expireTime; } - public createLecture_args deepCopy() { - return new createLecture_args(this); + public setImageVersionExpiry_args deepCopy() { + return new setImageVersionExpiry_args(this); } @Override public void clear() { this.userToken = null; - this.lecture = null; + this.imageBaseId = null; + setExpireTimeIsSet(false); + this.expireTime = 0; } public String getUserToken() { return this.userToken; } - public createLecture_args setUserToken(String userToken) { + public setImageVersionExpiry_args setUserToken(String userToken) { this.userToken = userToken; return this; } @@ -28414,30 +28629,53 @@ public class SatelliteServer { } } - public LectureWrite getLecture() { - return this.lecture; + public String getImageBaseId() { + return this.imageBaseId; } - public createLecture_args setLecture(LectureWrite lecture) { - this.lecture = lecture; + public setImageVersionExpiry_args setImageBaseId(String imageBaseId) { + this.imageBaseId = imageBaseId; return this; } - public void unsetLecture() { - this.lecture = null; + public void unsetImageBaseId() { + this.imageBaseId = null; } - /** Returns true if field lecture is set (has been assigned a value) and false otherwise */ - public boolean isSetLecture() { - return this.lecture != null; + /** Returns true if field imageBaseId is set (has been assigned a value) and false otherwise */ + public boolean isSetImageBaseId() { + return this.imageBaseId != null; } - public void setLectureIsSet(boolean value) { + public void setImageBaseIdIsSet(boolean value) { if (!value) { - this.lecture = null; + this.imageBaseId = null; } } + public long getExpireTime() { + return this.expireTime; + } + + public setImageVersionExpiry_args setExpireTime(long expireTime) { + this.expireTime = expireTime; + setExpireTimeIsSet(true); + return this; + } + + public void unsetExpireTime() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __EXPIRETIME_ISSET_ID); + } + + /** Returns true if field expireTime is set (has been assigned a value) and false otherwise */ + public boolean isSetExpireTime() { + return EncodingUtils.testBit(__isset_bitfield, __EXPIRETIME_ISSET_ID); + } + + public void setExpireTimeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __EXPIRETIME_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case USER_TOKEN: @@ -28448,11 +28686,19 @@ public class SatelliteServer { } break; - case LECTURE: + case IMAGE_BASE_ID: if (value == null) { - unsetLecture(); + unsetImageBaseId(); } else { - setLecture((LectureWrite)value); + setImageBaseId((String)value); + } + break; + + case EXPIRE_TIME: + if (value == null) { + unsetExpireTime(); + } else { + setExpireTime((Long)value); } break; @@ -28464,8 +28710,11 @@ public class SatelliteServer { case USER_TOKEN: return getUserToken(); - case LECTURE: - return getLecture(); + case IMAGE_BASE_ID: + return getImageBaseId(); + + case EXPIRE_TIME: + return Long.valueOf(getExpireTime()); } throw new IllegalStateException(); @@ -28480,8 +28729,10 @@ public class SatelliteServer { switch (field) { case USER_TOKEN: return isSetUserToken(); - case LECTURE: - return isSetLecture(); + case IMAGE_BASE_ID: + return isSetImageBaseId(); + case EXPIRE_TIME: + return isSetExpireTime(); } throw new IllegalStateException(); } @@ -28490,12 +28741,12 @@ public class SatelliteServer { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof createLecture_args) - return this.equals((createLecture_args)that); + if (that instanceof setImageVersionExpiry_args) + return this.equals((setImageVersionExpiry_args)that); return false; } - public boolean equals(createLecture_args that) { + public boolean equals(setImageVersionExpiry_args that) { if (that == null) return false; @@ -28508,12 +28759,21 @@ public class SatelliteServer { return false; } - boolean this_present_lecture = true && this.isSetLecture(); - boolean that_present_lecture = true && that.isSetLecture(); - if (this_present_lecture || that_present_lecture) { - if (!(this_present_lecture && that_present_lecture)) + boolean this_present_imageBaseId = true && this.isSetImageBaseId(); + boolean that_present_imageBaseId = true && that.isSetImageBaseId(); + if (this_present_imageBaseId || that_present_imageBaseId) { + if (!(this_present_imageBaseId && that_present_imageBaseId)) return false; - if (!this.lecture.equals(that.lecture)) + if (!this.imageBaseId.equals(that.imageBaseId)) + return false; + } + + boolean this_present_expireTime = true; + boolean that_present_expireTime = true; + if (this_present_expireTime || that_present_expireTime) { + if (!(this_present_expireTime && that_present_expireTime)) + return false; + if (this.expireTime != that.expireTime) return false; } @@ -28526,7 +28786,7 @@ public class SatelliteServer { } @Override - public int compareTo(createLecture_args other) { + public int compareTo(setImageVersionExpiry_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } @@ -28543,22 +28803,1175 @@ public class SatelliteServer { return lastComparison; } } - lastComparison = Boolean.valueOf(isSetLecture()).compareTo(other.isSetLecture()); + lastComparison = Boolean.valueOf(isSetImageBaseId()).compareTo(other.isSetImageBaseId()); if (lastComparison != 0) { return lastComparison; } - if (isSetLecture()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecture, other.lecture); + if (isSetImageBaseId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imageBaseId, other.imageBaseId); if (lastComparison != 0) { return lastComparison; } } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } + lastComparison = Boolean.valueOf(isSetExpireTime()).compareTo(other.isSetExpireTime()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetExpireTime()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.expireTime, other.expireTime); + 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("setImageVersionExpiry_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("imageBaseId:"); + if (this.imageBaseId == null) { + sb.append("null"); + } else { + sb.append(this.imageBaseId); + } + first = false; + if (!first) sb.append(", "); + sb.append("expireTime:"); + sb.append(this.expireTime); + 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 { + // 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); + } + } + + private static class setImageVersionExpiry_argsStandardSchemeFactory implements SchemeFactory { + public setImageVersionExpiry_argsStandardScheme getScheme() { + return new setImageVersionExpiry_argsStandardScheme(); + } + } + + private static class setImageVersionExpiry_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, setImageVersionExpiry_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_BASE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imageBaseId = iprot.readString(); + struct.setImageBaseIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // EXPIRE_TIME + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.expireTime = iprot.readI64(); + struct.setExpireTimeIsSet(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, setImageVersionExpiry_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.imageBaseId != null) { + oprot.writeFieldBegin(IMAGE_BASE_ID_FIELD_DESC); + oprot.writeString(struct.imageBaseId); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(EXPIRE_TIME_FIELD_DESC); + oprot.writeI64(struct.expireTime); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class setImageVersionExpiry_argsTupleSchemeFactory implements SchemeFactory { + public setImageVersionExpiry_argsTupleScheme getScheme() { + return new setImageVersionExpiry_argsTupleScheme(); + } + } + + private static class setImageVersionExpiry_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, setImageVersionExpiry_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserToken()) { + optionals.set(0); + } + if (struct.isSetImageBaseId()) { + optionals.set(1); + } + if (struct.isSetExpireTime()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUserToken()) { + oprot.writeString(struct.userToken); + } + if (struct.isSetImageBaseId()) { + oprot.writeString(struct.imageBaseId); + } + if (struct.isSetExpireTime()) { + oprot.writeI64(struct.expireTime); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, setImageVersionExpiry_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.userToken = iprot.readString(); + struct.setUserTokenIsSet(true); + } + if (incoming.get(1)) { + struct.imageBaseId = iprot.readString(); + struct.setImageBaseIdIsSet(true); + } + if (incoming.get(2)) { + struct.expireTime = iprot.readI64(); + struct.setExpireTimeIsSet(true); + } + } + } + + } + + public static class setImageVersionExpiry_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setImageVersionExpiry_result"); + + 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 DATE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("dateError", org.apache.thrift.protocol.TType.STRUCT, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new setImageVersionExpiry_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new setImageVersionExpiry_resultTupleSchemeFactory()); + } + + public TAuthorizationException authError; // required + public TNotFoundException notFound; // required + public TInternalServerError serverError; // required + public TInvalidDateParam dateError; // 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 { + AUTH_ERROR((short)1, "authError"), + NOT_FOUND((short)2, "notFound"), + SERVER_ERROR((short)3, "serverError"), + DATE_ERROR((short)4, "dateError"); + + private static final Map byName = new HashMap(); + + 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: // AUTH_ERROR + return AUTH_ERROR; + case 2: // NOT_FOUND + return NOT_FOUND; + case 3: // SERVER_ERROR + return SERVER_ERROR; + case 4: // DATE_ERROR + return DATE_ERROR; + 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.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.DATE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("dateError", 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(setImageVersionExpiry_result.class, metaDataMap); + } + + public setImageVersionExpiry_result() { + } + + public setImageVersionExpiry_result( + TAuthorizationException authError, + TNotFoundException notFound, + TInternalServerError serverError, + TInvalidDateParam dateError) + { + this(); + this.authError = authError; + this.notFound = notFound; + this.serverError = serverError; + this.dateError = dateError; + } + + /** + * Performs a deep copy on other. + */ + public setImageVersionExpiry_result(setImageVersionExpiry_result other) { + if (other.isSetAuthError()) { + this.authError = new TAuthorizationException(other.authError); + } + if (other.isSetNotFound()) { + this.notFound = new TNotFoundException(other.notFound); + } + if (other.isSetServerError()) { + this.serverError = new TInternalServerError(other.serverError); + } + if (other.isSetDateError()) { + this.dateError = new TInvalidDateParam(other.dateError); + } + } + + public setImageVersionExpiry_result deepCopy() { + return new setImageVersionExpiry_result(this); + } + + @Override + public void clear() { + this.authError = null; + this.notFound = null; + this.serverError = null; + this.dateError = null; + } + + public TAuthorizationException getAuthError() { + return this.authError; + } + + public setImageVersionExpiry_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 setImageVersionExpiry_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 TInternalServerError getServerError() { + return this.serverError; + } + + public setImageVersionExpiry_result setServerError(TInternalServerError 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 TInvalidDateParam getDateError() { + return this.dateError; + } + + public setImageVersionExpiry_result setDateError(TInvalidDateParam dateError) { + this.dateError = dateError; + return this; + } + + public void unsetDateError() { + this.dateError = null; + } + + /** Returns true if field dateError is set (has been assigned a value) and false otherwise */ + public boolean isSetDateError() { + return this.dateError != null; + } + + public void setDateErrorIsSet(boolean value) { + if (!value) { + this.dateError = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + 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((TInternalServerError)value); + } + break; + + case DATE_ERROR: + if (value == null) { + unsetDateError(); + } else { + setDateError((TInvalidDateParam)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case AUTH_ERROR: + return getAuthError(); + + case NOT_FOUND: + return getNotFound(); + + case SERVER_ERROR: + return getServerError(); + + case DATE_ERROR: + return getDateError(); + + } + 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 AUTH_ERROR: + return isSetAuthError(); + case NOT_FOUND: + return isSetNotFound(); + case SERVER_ERROR: + return isSetServerError(); + case DATE_ERROR: + return isSetDateError(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof setImageVersionExpiry_result) + return this.equals((setImageVersionExpiry_result)that); + return false; + } + + public boolean equals(setImageVersionExpiry_result that) { + if (that == null) + 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_dateError = true && this.isSetDateError(); + boolean that_present_dateError = true && that.isSetDateError(); + if (this_present_dateError || that_present_dateError) { + if (!(this_present_dateError && that_present_dateError)) + return false; + if (!this.dateError.equals(that.dateError)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(setImageVersionExpiry_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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(isSetDateError()).compareTo(other.isSetDateError()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDateError()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dateError, other.dateError); + 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("setImageVersionExpiry_result("); + boolean first = true; + + 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("dateError:"); + if (this.dateError == null) { + sb.append("null"); + } else { + sb.append(this.dateError); + } + 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 setImageVersionExpiry_resultStandardSchemeFactory implements SchemeFactory { + public setImageVersionExpiry_resultStandardScheme getScheme() { + return new setImageVersionExpiry_resultStandardScheme(); + } + } + + private static class setImageVersionExpiry_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, setImageVersionExpiry_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 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 TInternalServerError(); + struct.serverError.read(iprot); + struct.setServerErrorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DATE_ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(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, setImageVersionExpiry_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + 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.dateError != null) { + oprot.writeFieldBegin(DATE_ERROR_FIELD_DESC); + struct.dateError.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class setImageVersionExpiry_resultTupleSchemeFactory implements SchemeFactory { + public setImageVersionExpiry_resultTupleScheme getScheme() { + return new setImageVersionExpiry_resultTupleScheme(); + } + } + + private static class setImageVersionExpiry_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, setImageVersionExpiry_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetAuthError()) { + optionals.set(0); + } + if (struct.isSetNotFound()) { + optionals.set(1); + } + if (struct.isSetServerError()) { + optionals.set(2); + } + if (struct.isSetDateError()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetAuthError()) { + struct.authError.write(oprot); + } + if (struct.isSetNotFound()) { + struct.notFound.write(oprot); + } + if (struct.isSetServerError()) { + struct.serverError.write(oprot); + } + if (struct.isSetDateError()) { + struct.dateError.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, setImageVersionExpiry_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.authError = new TAuthorizationException(); + struct.authError.read(iprot); + struct.setAuthErrorIsSet(true); + } + if (incoming.get(1)) { + struct.notFound = new TNotFoundException(); + struct.notFound.read(iprot); + struct.setNotFoundIsSet(true); + } + if (incoming.get(2)) { + struct.serverError = new TInternalServerError(); + struct.serverError.read(iprot); + struct.setServerErrorIsSet(true); + } + if (incoming.get(3)) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(true); + } + } + } + + } + + public static class createLecture_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("createLecture_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 LECTURE_FIELD_DESC = new org.apache.thrift.protocol.TField("lecture", org.apache.thrift.protocol.TType.STRUCT, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new createLecture_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new createLecture_argsTupleSchemeFactory()); + } + + public String userToken; // required + public LectureWrite lecture; // 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"), + LECTURE((short)2, "lecture"); + + private static final Map byName = new HashMap(); + + 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: // LECTURE + return LECTURE; + 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.LECTURE, new org.apache.thrift.meta_data.FieldMetaData("lecture", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, LectureWrite.class))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(createLecture_args.class, metaDataMap); + } + + public createLecture_args() { + } + + public createLecture_args( + String userToken, + LectureWrite lecture) + { + this(); + this.userToken = userToken; + this.lecture = lecture; + } + + /** + * Performs a deep copy on other. + */ + public createLecture_args(createLecture_args other) { + if (other.isSetUserToken()) { + this.userToken = other.userToken; + } + if (other.isSetLecture()) { + this.lecture = new LectureWrite(other.lecture); + } + } + + public createLecture_args deepCopy() { + return new createLecture_args(this); + } + + @Override + public void clear() { + this.userToken = null; + this.lecture = null; + } + + public String getUserToken() { + return this.userToken; + } + + public createLecture_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 LectureWrite getLecture() { + return this.lecture; + } + + public createLecture_args setLecture(LectureWrite lecture) { + this.lecture = lecture; + return this; + } + + public void unsetLecture() { + this.lecture = null; + } + + /** Returns true if field lecture is set (has been assigned a value) and false otherwise */ + public boolean isSetLecture() { + return this.lecture != null; + } + + public void setLectureIsSet(boolean value) { + if (!value) { + this.lecture = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_TOKEN: + if (value == null) { + unsetUserToken(); + } else { + setUserToken((String)value); + } + break; + + case LECTURE: + if (value == null) { + unsetLecture(); + } else { + setLecture((LectureWrite)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_TOKEN: + return getUserToken(); + + case LECTURE: + return getLecture(); + + } + 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 LECTURE: + return isSetLecture(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof createLecture_args) + return this.equals((createLecture_args)that); + return false; + } + + public boolean equals(createLecture_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_lecture = true && this.isSetLecture(); + boolean that_present_lecture = true && that.isSetLecture(); + if (this_present_lecture || that_present_lecture) { + if (!(this_present_lecture && that_present_lecture)) + return false; + if (!this.lecture.equals(that.lecture)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(createLecture_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(isSetLecture()).compareTo(other.isSetLecture()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLecture()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecture, other.lecture); + 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); @@ -28733,6 +30146,7 @@ public class SatelliteServer { 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 SERVER_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("serverError", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField DATE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("dateError", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -28743,12 +30157,14 @@ public class SatelliteServer { public String success; // required public TAuthorizationException authError; // required public TInternalServerError serverError; // required + public TInvalidDateParam dateError; // 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"), - SERVER_ERROR((short)2, "serverError"); + SERVER_ERROR((short)2, "serverError"), + DATE_ERROR((short)3, "dateError"); private static final Map byName = new HashMap(); @@ -28769,6 +30185,8 @@ public class SatelliteServer { return AUTH_ERROR; case 2: // SERVER_ERROR return SERVER_ERROR; + case 3: // DATE_ERROR + return DATE_ERROR; default: return null; } @@ -28818,6 +30236,8 @@ public class SatelliteServer { 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.DATE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("dateError", 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(createLecture_result.class, metaDataMap); } @@ -28828,12 +30248,14 @@ public class SatelliteServer { public createLecture_result( String success, TAuthorizationException authError, - TInternalServerError serverError) + TInternalServerError serverError, + TInvalidDateParam dateError) { this(); this.success = success; this.authError = authError; this.serverError = serverError; + this.dateError = dateError; } /** @@ -28849,6 +30271,9 @@ public class SatelliteServer { if (other.isSetServerError()) { this.serverError = new TInternalServerError(other.serverError); } + if (other.isSetDateError()) { + this.dateError = new TInvalidDateParam(other.dateError); + } } public createLecture_result deepCopy() { @@ -28860,6 +30285,7 @@ public class SatelliteServer { this.success = null; this.authError = null; this.serverError = null; + this.dateError = null; } public String getSuccess() { @@ -28934,6 +30360,30 @@ public class SatelliteServer { } } + public TInvalidDateParam getDateError() { + return this.dateError; + } + + public createLecture_result setDateError(TInvalidDateParam dateError) { + this.dateError = dateError; + return this; + } + + public void unsetDateError() { + this.dateError = null; + } + + /** Returns true if field dateError is set (has been assigned a value) and false otherwise */ + public boolean isSetDateError() { + return this.dateError != null; + } + + public void setDateErrorIsSet(boolean value) { + if (!value) { + this.dateError = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case SUCCESS: @@ -28960,6 +30410,14 @@ public class SatelliteServer { } break; + case DATE_ERROR: + if (value == null) { + unsetDateError(); + } else { + setDateError((TInvalidDateParam)value); + } + break; + } } @@ -28974,6 +30432,9 @@ public class SatelliteServer { case SERVER_ERROR: return getServerError(); + case DATE_ERROR: + return getDateError(); + } throw new IllegalStateException(); } @@ -28991,6 +30452,8 @@ public class SatelliteServer { return isSetAuthError(); case SERVER_ERROR: return isSetServerError(); + case DATE_ERROR: + return isSetDateError(); } throw new IllegalStateException(); } @@ -29035,6 +30498,15 @@ public class SatelliteServer { return false; } + boolean this_present_dateError = true && this.isSetDateError(); + boolean that_present_dateError = true && that.isSetDateError(); + if (this_present_dateError || that_present_dateError) { + if (!(this_present_dateError && that_present_dateError)) + return false; + if (!this.dateError.equals(that.dateError)) + return false; + } + return true; } @@ -29081,6 +30553,16 @@ public class SatelliteServer { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetDateError()).compareTo(other.isSetDateError()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDateError()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dateError, other.dateError); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -29124,6 +30606,14 @@ public class SatelliteServer { sb.append(this.serverError); } first = false; + if (!first) sb.append(", "); + sb.append("dateError:"); + if (this.dateError == null) { + sb.append("null"); + } else { + sb.append(this.dateError); + } + first = false; sb.append(")"); return sb.toString(); } @@ -29193,6 +30683,15 @@ public class SatelliteServer { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 3: // DATE_ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -29223,6 +30722,11 @@ public class SatelliteServer { struct.serverError.write(oprot); oprot.writeFieldEnd(); } + if (struct.dateError != null) { + oprot.writeFieldBegin(DATE_ERROR_FIELD_DESC); + struct.dateError.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -29250,7 +30754,10 @@ public class SatelliteServer { if (struct.isSetServerError()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetDateError()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetSuccess()) { oprot.writeString(struct.success); } @@ -29260,12 +30767,15 @@ public class SatelliteServer { if (struct.isSetServerError()) { struct.serverError.write(oprot); } + if (struct.isSetDateError()) { + struct.dateError.write(oprot); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, createLecture_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.success = iprot.readString(); struct.setSuccessIsSet(true); @@ -29280,6 +30790,11 @@ public class SatelliteServer { struct.serverError.read(iprot); struct.setServerErrorIsSet(true); } + if (incoming.get(3)) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(true); + } } } @@ -29850,6 +31365,7 @@ public class SatelliteServer { 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 DATE_ERROR_FIELD_DESC = new org.apache.thrift.protocol.TField("dateError", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -29860,12 +31376,14 @@ public class SatelliteServer { public TAuthorizationException authError; // required public TNotFoundException notFound; // required public TInternalServerError serverError; // required + public TInvalidDateParam dateError; // 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 { AUTH_ERROR((short)1, "authError"), NOT_FOUND((short)2, "notFound"), - SERVER_ERROR((short)3, "serverError"); + SERVER_ERROR((short)3, "serverError"), + DATE_ERROR((short)4, "dateError"); private static final Map byName = new HashMap(); @@ -29886,6 +31404,8 @@ public class SatelliteServer { return NOT_FOUND; case 3: // SERVER_ERROR return SERVER_ERROR; + case 4: // DATE_ERROR + return DATE_ERROR; default: return null; } @@ -29935,6 +31455,8 @@ public class SatelliteServer { 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.DATE_ERROR, new org.apache.thrift.meta_data.FieldMetaData("dateError", 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(updateLecture_result.class, metaDataMap); } @@ -29945,12 +31467,14 @@ public class SatelliteServer { public updateLecture_result( TAuthorizationException authError, TNotFoundException notFound, - TInternalServerError serverError) + TInternalServerError serverError, + TInvalidDateParam dateError) { this(); this.authError = authError; this.notFound = notFound; this.serverError = serverError; + this.dateError = dateError; } /** @@ -29966,6 +31490,9 @@ public class SatelliteServer { if (other.isSetServerError()) { this.serverError = new TInternalServerError(other.serverError); } + if (other.isSetDateError()) { + this.dateError = new TInvalidDateParam(other.dateError); + } } public updateLecture_result deepCopy() { @@ -29977,6 +31504,7 @@ public class SatelliteServer { this.authError = null; this.notFound = null; this.serverError = null; + this.dateError = null; } public TAuthorizationException getAuthError() { @@ -30051,6 +31579,30 @@ public class SatelliteServer { } } + public TInvalidDateParam getDateError() { + return this.dateError; + } + + public updateLecture_result setDateError(TInvalidDateParam dateError) { + this.dateError = dateError; + return this; + } + + public void unsetDateError() { + this.dateError = null; + } + + /** Returns true if field dateError is set (has been assigned a value) and false otherwise */ + public boolean isSetDateError() { + return this.dateError != null; + } + + public void setDateErrorIsSet(boolean value) { + if (!value) { + this.dateError = null; + } + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case AUTH_ERROR: @@ -30077,6 +31629,14 @@ public class SatelliteServer { } break; + case DATE_ERROR: + if (value == null) { + unsetDateError(); + } else { + setDateError((TInvalidDateParam)value); + } + break; + } } @@ -30091,6 +31651,9 @@ public class SatelliteServer { case SERVER_ERROR: return getServerError(); + case DATE_ERROR: + return getDateError(); + } throw new IllegalStateException(); } @@ -30108,6 +31671,8 @@ public class SatelliteServer { return isSetNotFound(); case SERVER_ERROR: return isSetServerError(); + case DATE_ERROR: + return isSetDateError(); } throw new IllegalStateException(); } @@ -30152,6 +31717,15 @@ public class SatelliteServer { return false; } + boolean this_present_dateError = true && this.isSetDateError(); + boolean that_present_dateError = true && that.isSetDateError(); + if (this_present_dateError || that_present_dateError) { + if (!(this_present_dateError && that_present_dateError)) + return false; + if (!this.dateError.equals(that.dateError)) + return false; + } + return true; } @@ -30198,6 +31772,16 @@ public class SatelliteServer { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetDateError()).compareTo(other.isSetDateError()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDateError()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dateError, other.dateError); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -30241,6 +31825,14 @@ public class SatelliteServer { sb.append(this.serverError); } first = false; + if (!first) sb.append(", "); + sb.append("dateError:"); + if (this.dateError == null) { + sb.append("null"); + } else { + sb.append(this.dateError); + } + first = false; sb.append(")"); return sb.toString(); } @@ -30311,6 +31903,15 @@ public class SatelliteServer { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 4: // DATE_ERROR + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -30341,6 +31942,11 @@ public class SatelliteServer { struct.serverError.write(oprot); oprot.writeFieldEnd(); } + if (struct.dateError != null) { + oprot.writeFieldBegin(DATE_ERROR_FIELD_DESC); + struct.dateError.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -30368,7 +31974,10 @@ public class SatelliteServer { if (struct.isSetServerError()) { optionals.set(2); } - oprot.writeBitSet(optionals, 3); + if (struct.isSetDateError()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); if (struct.isSetAuthError()) { struct.authError.write(oprot); } @@ -30378,12 +31987,15 @@ public class SatelliteServer { if (struct.isSetServerError()) { struct.serverError.write(oprot); } + if (struct.isSetDateError()) { + struct.dateError.write(oprot); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, updateLecture_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); + BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.authError = new TAuthorizationException(); struct.authError.read(iprot); @@ -30399,6 +32011,11 @@ public class SatelliteServer { struct.serverError.read(iprot); struct.setServerErrorIsSet(true); } + if (incoming.get(3)) { + struct.dateError = new TInvalidDateParam(); + struct.dateError.read(iprot); + struct.setDateErrorIsSet(true); + } } } diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TInvalidDateParam.java b/src/main/java/org/openslx/bwlp/thrift/iface/TInvalidDateParam.java new file mode 100644 index 0000000..8a5eae0 --- /dev/null +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TInvalidDateParam.java @@ -0,0 +1,504 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package org.openslx.bwlp.thrift.iface; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class TInvalidDateParam extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TInvalidDateParam"); + + private static final org.apache.thrift.protocol.TField NUMBER_FIELD_DESC = new org.apache.thrift.protocol.TField("number", org.apache.thrift.protocol.TType.I32, (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)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TInvalidDateParamStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TInvalidDateParamTupleSchemeFactory()); + } + + /** + * + * @see DateParamError + */ + public DateParamError number; // 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 { + /** + * + * @see DateParamError + */ + NUMBER((short)1, "number"), + MESSAGE((short)2, "message"); + + private static final Map byName = new HashMap(); + + 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: // NUMBER + return NUMBER; + case 2: // MESSAGE + return MESSAGE; + 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.NUMBER, new org.apache.thrift.meta_data.FieldMetaData("number", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, DateParamError.class))); + 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(TInvalidDateParam.class, metaDataMap); + } + + public TInvalidDateParam() { + } + + public TInvalidDateParam( + DateParamError number, + String message) + { + this(); + this.number = number; + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public TInvalidDateParam(TInvalidDateParam other) { + if (other.isSetNumber()) { + this.number = other.number; + } + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public TInvalidDateParam deepCopy() { + return new TInvalidDateParam(this); + } + + @Override + public void clear() { + this.number = null; + this.message = null; + } + + /** + * + * @see DateParamError + */ + public DateParamError getNumber() { + return this.number; + } + + /** + * + * @see DateParamError + */ + public TInvalidDateParam setNumber(DateParamError number) { + this.number = number; + return this; + } + + public void unsetNumber() { + this.number = null; + } + + /** Returns true if field number is set (has been assigned a value) and false otherwise */ + public boolean isSetNumber() { + return this.number != null; + } + + public void setNumberIsSet(boolean value) { + if (!value) { + this.number = null; + } + } + + public String getMessage() { + return this.message; + } + + public TInvalidDateParam setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = 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 setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case NUMBER: + if (value == null) { + unsetNumber(); + } else { + setNumber((DateParamError)value); + } + break; + + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NUMBER: + return getNumber(); + + case MESSAGE: + return getMessage(); + + } + 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 NUMBER: + return isSetNumber(); + case MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof TInvalidDateParam) + return this.equals((TInvalidDateParam)that); + return false; + } + + public boolean equals(TInvalidDateParam that) { + if (that == null) + return false; + + boolean this_present_number = true && this.isSetNumber(); + boolean that_present_number = true && that.isSetNumber(); + if (this_present_number || that_present_number) { + if (!(this_present_number && that_present_number)) + return false; + if (!this.number.equals(that.number)) + return false; + } + + 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.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(TInvalidDateParam other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetNumber()).compareTo(other.isSetNumber()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNumber()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.number, other.number); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + 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("TInvalidDateParam("); + boolean first = true; + + sb.append("number:"); + if (this.number == null) { + sb.append("null"); + } else { + sb.append(this.number); + } + first = false; + if (!first) sb.append(", "); + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + 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 TInvalidDateParamStandardSchemeFactory implements SchemeFactory { + public TInvalidDateParamStandardScheme getScheme() { + return new TInvalidDateParamStandardScheme(); + } + } + + private static class TInvalidDateParamStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TInvalidDateParam 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: // NUMBER + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.number = DateParamError.findByValue(iprot.readI32()); + struct.setNumberIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(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, TInvalidDateParam struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.number != null) { + oprot.writeFieldBegin(NUMBER_FIELD_DESC); + oprot.writeI32(struct.number.getValue()); + oprot.writeFieldEnd(); + } + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TInvalidDateParamTupleSchemeFactory implements SchemeFactory { + public TInvalidDateParamTupleScheme getScheme() { + return new TInvalidDateParamTupleScheme(); + } + } + + private static class TInvalidDateParamTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TInvalidDateParam struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetNumber()) { + optionals.set(0); + } + if (struct.isSetMessage()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetNumber()) { + oprot.writeI32(struct.number.getValue()); + } + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TInvalidDateParam struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.number = DateParamError.findByValue(iprot.readI32()); + struct.setNumberIsSet(true); + } + if (incoming.get(1)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git a/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java b/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java index 25690bd..03c0643 100644 --- a/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java +++ b/src/main/java/org/openslx/bwlp/thrift/iface/TNotFoundException.java @@ -35,6 +35,7 @@ import org.slf4j.LoggerFactory; public class TNotFoundException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TNotFoundException"); + 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, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -42,10 +43,11 @@ public class TNotFoundException extends TException implements org.apache.thrift. schemes.put(TupleScheme.class, new TNotFoundExceptionTupleSchemeFactory()); } + 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 { -; + MESSAGE((short)1, "message"); private static final Map byName = new HashMap(); @@ -60,6 +62,8 @@ public class TNotFoundException extends TException implements org.apache.thrift. */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { + case 1: // MESSAGE + return MESSAGE; default: return null; } @@ -98,9 +102,13 @@ public class TNotFoundException extends TException implements org.apache.thrift. 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.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(TNotFoundException.class, metaDataMap); } @@ -108,10 +116,20 @@ public class TNotFoundException extends TException implements org.apache.thrift. public TNotFoundException() { } + public TNotFoundException( + String message) + { + this(); + this.message = message; + } + /** * Performs a deep copy on other. */ public TNotFoundException(TNotFoundException other) { + if (other.isSetMessage()) { + this.message = other.message; + } } public TNotFoundException deepCopy() { @@ -120,15 +138,51 @@ public class TNotFoundException extends TException implements org.apache.thrift. @Override public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public TNotFoundException setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = 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 setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } } public void setFieldValue(_Fields field, Object value) { switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + } } public Object getFieldValue(_Fields field) { switch (field) { + case MESSAGE: + return getMessage(); + } throw new IllegalStateException(); } @@ -140,6 +194,8 @@ public class TNotFoundException extends TException implements org.apache.thrift. } switch (field) { + case MESSAGE: + return isSetMessage(); } throw new IllegalStateException(); } @@ -157,6 +213,15 @@ public class TNotFoundException extends TException implements org.apache.thrift. if (that == null) return false; + 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.message.equals(that.message)) + return false; + } + return true; } @@ -173,6 +238,16 @@ public class TNotFoundException extends TException implements org.apache.thrift. int lastComparison = 0; + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(other.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, other.message); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -193,6 +268,13 @@ public class TNotFoundException extends TException implements org.apache.thrift. StringBuilder sb = new StringBuilder("TNotFoundException("); boolean first = true; + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; sb.append(")"); return sb.toString(); } @@ -236,6 +318,14 @@ public class TNotFoundException extends TException implements org.apache.thrift. break; } switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -251,6 +341,11 @@ public class TNotFoundException extends TException implements org.apache.thrift. struct.validate(); oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -268,11 +363,24 @@ public class TNotFoundException extends TException implements org.apache.thrift. @Override public void write(org.apache.thrift.protocol.TProtocol prot, TNotFoundException struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, TNotFoundException struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } } } diff --git a/src/main/java/org/openslx/thrifthelper/Comparators.java b/src/main/java/org/openslx/thrifthelper/Comparators.java new file mode 100644 index 0000000..5580cf6 --- /dev/null +++ b/src/main/java/org/openslx/thrifthelper/Comparators.java @@ -0,0 +1,78 @@ +package org.openslx.thrifthelper; + +import java.util.Comparator; + +import org.openslx.bwlp.thrift.iface.ImageSummaryRead; +import org.openslx.bwlp.thrift.iface.ImageVersionDetails; +import org.openslx.bwlp.thrift.iface.OperatingSystem; +import org.openslx.bwlp.thrift.iface.Organization; +import org.openslx.bwlp.thrift.iface.Virtualizer; + +/** + * A bunch of comparators for thrift classes. They will compare on what would be considered the + * identifier ("primary key") of a struct, unless stated otherwise. + */ +public class Comparators +{ + + public static final Comparator imageVersionDetails = new Comparator() { + @Override + public int compare( ImageVersionDetails o1, ImageVersionDetails o2 ) + { + if ( o1 == null || o1.versionId == null ) + return o2 == null || o2.versionId == null ? 0 : 1; + if ( o2 == null || o2.versionId == null ) + return -1; + return o1.versionId.compareTo( o2.versionId ); + } + }; + + public static final Comparator imageSummaryRead = new Comparator() { + @Override + public int compare( ImageSummaryRead o1, ImageSummaryRead o2 ) + { + if ( o1 == null || o1.imageBaseId == null ) + return o2 == null || o2.imageBaseId == null ? 0 : 1; + if ( o2 == null || o2.imageBaseId == null ) + return -1; + return o1.imageBaseId.compareTo( o2.imageBaseId ); + } + }; + + public static final Comparator operatingSystem = new Comparator() { + @Override + public int compare( OperatingSystem o1, OperatingSystem o2 ) + { + if ( o1 == null ) + return o2 == null ? 0 : 1; + if ( o2 == null ) + return -1; + return o1.osId - o2.osId; + } + }; + + public static final Comparator virtualizer = new Comparator() { + @Override + public int compare( Virtualizer o1, Virtualizer o2 ) + { + if ( o1 == null || o1.virtId == null ) + return o2 == null || o2.virtId == null ? 0 : 1; + if ( o2 == null || o2.virtId == null ) + return -1; + return o1.virtId.compareTo( o2.virtId ); + } + }; + + public static final Comparator organization = new Comparator() { + @Override + public int compare( Organization o1, Organization o2 ) + { + if ( o1 == null || o1.organizationId == null ) + return o2 == null || o2.organizationId == null ? 0 : 1; + if ( o2 == null || o2.organizationId == null ) + return -1; + return o1.organizationId.compareTo( o2.organizationId ); + } + }; + +} diff --git a/src/main/thrift/bwlp.thrift b/src/main/thrift/bwlp.thrift index fb29e9f..e392a81 100644 --- a/src/main/thrift/bwlp.thrift +++ b/src/main/thrift/bwlp.thrift @@ -61,6 +61,12 @@ enum TransferState { ERROR } +enum DateParamError { + TOO_LOW, + TOO_HIGH, + NEGATIVE_RANGE +} + // ############## STRUCT ############### struct UserInfo { @@ -171,11 +177,12 @@ struct ImageSummaryRead { 6: string virtId, 7: UnixTimestamp createTime, 8: UnixTimestamp updateTime, + 20: UnixTimestamp uploadTime, // Time when the latest version was uploaded 9: UnixTimestamp expireTime, 10: UUID ownerId, - 11: UUID uploaderId, + 11: UUID uploaderId, // Uploader of the latest version 12: ShareMode shareMode, - 13: i64 fileSize, + 13: i64 fileSize, // Size of the latest version 14: bool isRestricted, 15: bool isValid, 16: bool isProcessed, @@ -264,7 +271,8 @@ struct LectureRead { 1: UUID lectureId, 2: string lectureName, 3: string description, - 4: ImageSummaryRead image, + 23: string imageVersionId, + 24: string imageBaseId, 5: bool autoUpdate, 6: bool isEnabled, 7: UnixTimestamp startTime, @@ -337,11 +345,17 @@ exception TInvalidTokenException { } exception TNotFoundException { + 1: string message } exception TInternalServerError { } +exception TInvalidDateParam { + 1: DateParamError number, + 2: string message, +} + exception TImageDataException { 1: ImageDataError number, 2: string message @@ -431,16 +445,19 @@ service SatelliteServer { // Set new owner of image void setImageOwner(1: Token userToken, 2: UUID imageBaseId 3: UUID newOwnerId) throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInternalServerError serverError), + // Set image version valid and change expiry date (super user action) + void setImageVersionExpiry(1: Token userToken, 2: UUID imageBaseId 3: UnixTimestamp expireTime) + throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInternalServerError serverError, 4:TInvalidDateParam dateError), /* * Lecture related */ // Create new lecture UUID createLecture(1: Token userToken, 2: LectureWrite lecture) - throws (1:TAuthorizationException authError, 2:TInternalServerError serverError), + throws (1:TAuthorizationException authError, 2:TInternalServerError serverError, 3:TInvalidDateParam dateError), // Update existing lecture void updateLecture(1: Token userToken, 2: UUID lectureId, 3: LectureWrite lecture) - throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInternalServerError serverError), + throws (1:TAuthorizationException authError, 2:TNotFoundException notFound, 3:TInternalServerError serverError, 4:TInvalidDateParam dateError), // Get list of all lectures list getLectureList(1: Token userToken, 2: i32 page) throws (1:TAuthorizationException authError, 2:TInternalServerError serverError), -- cgit v1.2.3-55-g7522