diff options
| author | Tobias Spitzer | 2014-08-19 08:26:22 +0200 |
|---|---|---|
| committer | Tobias Spitzer | 2014-08-19 08:26:22 +0200 |
| commit | 5f540aaa05c9b4400d8bc58a8fdbc7a9157b4908 (patch) | |
| tree | 8de97eb2eded74d8c03f9d77c60a06fdc46ed039 /Dozentenmodulserver/src/server | |
| parent | Suchmaske für Images neu (diff) | |
| download | tutor-module-5f540aaa05c9b4400d8bc58a8fdbc7a9157b4908.tar.gz tutor-module-5f540aaa05c9b4400d8bc58a8fdbc7a9157b4908.tar.xz tutor-module-5f540aaa05c9b4400d8bc58a8fdbc7a9157b4908.zip | |
gfdgfsd
Diffstat (limited to 'Dozentenmodulserver/src/server')
| -rw-r--r-- | Dozentenmodulserver/src/server/Server.java | 1726 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/ServerHandler.java | 17 |
2 files changed, 874 insertions, 869 deletions
diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index cf8dd95c..568ef600 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -60,9 +60,9 @@ public class Server { public Map<String,String> getImageData(String imageid, String imageversion) throws org.apache.thrift.TException; - public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; + public Map<String,String> getLectureData(String lectureid) throws org.apache.thrift.TException; - public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException; + public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException; public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; @@ -102,9 +102,9 @@ public class Server { public void getImageData(String imageid, String imageversion, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void getLectureData(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -441,6 +441,29 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getImageData failed: unknown result"); } + public Map<String,String> getLectureData(String lectureid) throws org.apache.thrift.TException + { + send_getLectureData(lectureid); + return recv_getLectureData(); + } + + public void send_getLectureData(String lectureid) throws org.apache.thrift.TException + { + getLectureData_args args = new getLectureData_args(); + args.setLectureid(lectureid); + sendBase("getLectureData", args); + } + + public Map<String,String> recv_getLectureData() throws org.apache.thrift.TException + { + getLectureData_result result = new getLectureData_result(); + receiveBase(result, "getLectureData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result"); + } + public boolean updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os) throws org.apache.thrift.TException { send_updateImageData(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os); @@ -476,29 +499,6 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateImageData failed: unknown result"); } - public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException - { - send_getLectureData(lecturename); - return recv_getLectureData(); - } - - public void send_getLectureData(String lecturename) throws org.apache.thrift.TException - { - getLectureData_args args = new getLectureData_args(); - args.setLecturename(lecturename); - sendBase("getLectureData", args); - } - - public Map<String,String> recv_getLectureData() throws org.apache.thrift.TException - { - getLectureData_result result = new getLectureData_result(); - receiveBase(result, "getLectureData"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData failed: unknown result"); - } - public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException { send_deleteImageData(id, version); @@ -1116,6 +1116,38 @@ public class Server { } } + public void getLectureData(String lectureid, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getLectureData_call method_call = new getLectureData_call(lectureid, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String lectureid; + public getLectureData_call(String lectureid, 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.lectureid = lectureid; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getLectureData_args args = new getLectureData_args(); + args.setLectureid(lectureid); + args.write(prot); + prot.writeMessageEnd(); + } + + public Map<String,String> getResult() throws org.apache.thrift.TException { + if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { + throw new IllegalStateException("Method call not finished!"); + } + org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); + org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); + return (new Client(prot)).recv_getLectureData(); + } + } + public void updateImageData(String name, String newName, String image_path, boolean license, boolean internet, long ram, long cpu, String id, String version, boolean isTemplate, long filesize, long shareMode, String os, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); updateImageData_call method_call = new updateImageData_call(name, newName, image_path, license, internet, ram, cpu, id, version, isTemplate, filesize, shareMode, os, resultHandler, this, ___protocolFactory, ___transport); @@ -1184,38 +1216,6 @@ public class Server { } } - public void getLectureData(String lecturename, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getLectureData_call method_call = new getLectureData_call(lecturename, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getLectureData_call extends org.apache.thrift.async.TAsyncMethodCall { - private String lecturename; - public getLectureData_call(String lecturename, 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.lecturename = lecturename; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getLectureData", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getLectureData_args args = new getLectureData_args(); - args.setLecturename(lecturename); - args.write(prot); - prot.writeMessageEnd(); - } - - public Map<String,String> getResult() throws org.apache.thrift.TException { - if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { - throw new IllegalStateException("Method call not finished!"); - } - org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); - org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); - return (new Client(prot)).recv_getLectureData(); - } - } - public void deleteImageData(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); deleteImageData_call method_call = new deleteImageData_call(id, version, resultHandler, this, ___protocolFactory, ___transport); @@ -1458,8 +1458,8 @@ public class Server { processMap.put("writeLecturedata", new writeLecturedata()); processMap.put("startFileCopy", new startFileCopy()); processMap.put("getImageData", new getImageData()); - processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("updateImageData", new updateImageData()); processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); processMap.put("deleteImageServer", new deleteImageServer()); @@ -1712,43 +1712,43 @@ public class Server { } } - public static class updateImageData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateImageData_args> { - public updateImageData() { - super("updateImageData"); + public static class getLectureData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getLectureData_args> { + public getLectureData() { + super("getLectureData"); } - public updateImageData_args getEmptyArgsInstance() { - return new updateImageData_args(); + public getLectureData_args getEmptyArgsInstance() { + return new getLectureData_args(); } protected boolean isOneway() { return false; } - public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException { - updateImageData_result result = new updateImageData_result(); - result.success = iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os); - result.setSuccessIsSet(true); + public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException { + getLectureData_result result = new getLectureData_result(); + result.success = iface.getLectureData(args.lectureid); return result; } } - public static class getLectureData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getLectureData_args> { - public getLectureData() { - super("getLectureData"); + public static class updateImageData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateImageData_args> { + public updateImageData() { + super("updateImageData"); } - public getLectureData_args getEmptyArgsInstance() { - return new getLectureData_args(); + public updateImageData_args getEmptyArgsInstance() { + return new updateImageData_args(); } protected boolean isOneway() { return false; } - public getLectureData_result getResult(I iface, getLectureData_args args) throws org.apache.thrift.TException { - getLectureData_result result = new getLectureData_result(); - result.success = iface.getLectureData(args.lecturename); + public updateImageData_result getResult(I iface, updateImageData_args args) throws org.apache.thrift.TException { + updateImageData_result result = new updateImageData_result(); + result.success = iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os); + result.setSuccessIsSet(true); return result; } } @@ -1883,8 +1883,8 @@ public class Server { processMap.put("writeLecturedata", new writeLecturedata()); processMap.put("startFileCopy", new startFileCopy()); processMap.put("getImageData", new getImageData()); - processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("updateImageData", new updateImageData()); processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); processMap.put("deleteImageServer", new deleteImageServer()); @@ -2509,22 +2509,21 @@ public class Server { } } - public static class updateImageData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateImageData_args, Boolean> { - public updateImageData() { - super("updateImageData"); + public static class getLectureData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getLectureData_args, Map<String,String>> { + public getLectureData() { + super("getLectureData"); } - public updateImageData_args getEmptyArgsInstance() { - return new updateImageData_args(); + public getLectureData_args getEmptyArgsInstance() { + return new getLectureData_args(); } - public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<Boolean>() { - public void onComplete(Boolean o) { - updateImageData_result result = new updateImageData_result(); + return new AsyncMethodCallback<Map<String,String>>() { + public void onComplete(Map<String,String> o) { + getLectureData_result result = new getLectureData_result(); result.success = o; - result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; @@ -2536,7 +2535,7 @@ public class Server { public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; - updateImageData_result result = new updateImageData_result(); + getLectureData_result result = new getLectureData_result(); { 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()); @@ -2556,26 +2555,27 @@ public class Server { return false; } - public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { - iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); + public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException { + iface.getLectureData(args.lectureid,resultHandler); } } - public static class getLectureData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getLectureData_args, Map<String,String>> { - public getLectureData() { - super("getLectureData"); + public static class updateImageData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateImageData_args, Boolean> { + public updateImageData() { + super("updateImageData"); } - public getLectureData_args getEmptyArgsInstance() { - return new getLectureData_args(); + public updateImageData_args getEmptyArgsInstance() { + return new updateImageData_args(); } - public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { final org.apache.thrift.AsyncProcessFunction fcall = this; - return new AsyncMethodCallback<Map<String,String>>() { - public void onComplete(Map<String,String> o) { - getLectureData_result result = new getLectureData_result(); + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + updateImageData_result result = new updateImageData_result(); result.success = o; + result.setSuccessIsSet(true); try { fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid); return; @@ -2587,7 +2587,7 @@ public class Server { public void onError(Exception e) { byte msgType = org.apache.thrift.protocol.TMessageType.REPLY; org.apache.thrift.TBase msg; - getLectureData_result result = new getLectureData_result(); + updateImageData_result result = new updateImageData_result(); { 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()); @@ -2607,8 +2607,8 @@ public class Server { return false; } - public void start(I iface, getLectureData_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException { - iface.getLectureData(args.lecturename,resultHandler); + public void start(I iface, updateImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.updateImageData(args.name, args.newName, args.image_path, args.license, args.internet, args.ram, args.cpu, args.id, args.version, args.isTemplate, args.filesize, args.shareMode, args.os,resultHandler); } } @@ -14305,6 +14305,766 @@ public class Server { } + public static class getLectureData_args implements org.apache.thrift.TBase<getLectureData_args, getLectureData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args"); + + private static final org.apache.thrift.protocol.TField LECTUREID_FIELD_DESC = new org.apache.thrift.protocol.TField("lectureid", org.apache.thrift.protocol.TType.STRING, (short)-1); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory()); + } + + public String lectureid; // 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 { + LECTUREID((short)-1, "lectureid"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // LECTUREID + return LECTUREID; + 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.LECTUREID, new org.apache.thrift.meta_data.FieldMetaData("lectureid", 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(getLectureData_args.class, metaDataMap); + } + + public getLectureData_args() { + } + + public getLectureData_args( + String lectureid) + { + this(); + this.lectureid = lectureid; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getLectureData_args(getLectureData_args other) { + if (other.isSetLectureid()) { + this.lectureid = other.lectureid; + } + } + + public getLectureData_args deepCopy() { + return new getLectureData_args(this); + } + + @Override + public void clear() { + this.lectureid = null; + } + + public String getLectureid() { + return this.lectureid; + } + + public getLectureData_args setLectureid(String lectureid) { + this.lectureid = lectureid; + return this; + } + + public void unsetLectureid() { + this.lectureid = null; + } + + /** Returns true if field lectureid is set (has been assigned a value) and false otherwise */ + public boolean isSetLectureid() { + return this.lectureid != null; + } + + public void setLectureidIsSet(boolean value) { + if (!value) { + this.lectureid = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case LECTUREID: + if (value == null) { + unsetLectureid(); + } else { + setLectureid((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case LECTUREID: + return getLectureid(); + + } + 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 LECTUREID: + return isSetLectureid(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureData_args) + return this.equals((getLectureData_args)that); + return false; + } + + public boolean equals(getLectureData_args that) { + if (that == null) + return false; + + boolean this_present_lectureid = true && this.isSetLectureid(); + boolean that_present_lectureid = true && that.isSetLectureid(); + if (this_present_lectureid || that_present_lectureid) { + if (!(this_present_lectureid && that_present_lectureid)) + return false; + if (!this.lectureid.equals(that.lectureid)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetLectureid()).compareTo(other.isSetLectureid()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLectureid()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lectureid, other.lectureid); + 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("getLectureData_args("); + boolean first = true; + + sb.append("lectureid:"); + if (this.lectureid == null) { + sb.append("null"); + } else { + sb.append(this.lectureid); + } + 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 getLectureData_argsStandardSchemeFactory implements SchemeFactory { + public getLectureData_argsStandardScheme getScheme() { + return new getLectureData_argsStandardScheme(); + } + } + + private static class getLectureData_argsStandardScheme extends StandardScheme<getLectureData_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_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: // LECTUREID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lectureid = iprot.readString(); + struct.setLectureidIsSet(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, getLectureData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.lectureid != null) { + oprot.writeFieldBegin(LECTUREID_FIELD_DESC); + oprot.writeString(struct.lectureid); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory { + public getLectureData_argsTupleScheme getScheme() { + return new getLectureData_argsTupleScheme(); + } + } + + private static class getLectureData_argsTupleScheme extends TupleScheme<getLectureData_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetLectureid()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetLectureid()) { + oprot.writeString(struct.lectureid); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.lectureid = iprot.readString(); + struct.setLectureidIsSet(true); + } + } + } + + } + + public static class getLectureData_result implements org.apache.thrift.TBase<getLectureData_result, getLectureData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory()); + } + + public Map<String,String> success; // 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"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 0: // SUCCESS + return SUCCESS; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap); + } + + public getLectureData_result() { + } + + public getLectureData_result( + Map<String,String> success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getLectureData_result(getLectureData_result other) { + if (other.isSetSuccess()) { + Map<String,String> __this__success = new HashMap<String,String>(other.success); + this.success = __this__success; + } + } + + public getLectureData_result deepCopy() { + return new getLectureData_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public void putToSuccess(String key, String val) { + if (this.success == null) { + this.success = new HashMap<String,String>(); + } + this.success.put(key, val); + } + + public Map<String,String> getSuccess() { + return this.success; + } + + public getLectureData_result setSuccess(Map<String,String> success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Map<String,String>)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getLectureData_result) + return this.equals((getLectureData_result)that); + return false; + } + + public boolean equals(getLectureData_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getLectureData_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); + if (lastComparison != 0) { + return lastComparison; + } + } + 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("getLectureData_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + 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 getLectureData_resultStandardSchemeFactory implements SchemeFactory { + public getLectureData_resultStandardScheme getScheme() { + return new getLectureData_resultStandardScheme(); + } + } + + private static class getLectureData_resultStandardScheme extends StandardScheme<getLectureData_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { + { + org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin(); + struct.success = new HashMap<String,String>(2*_map52.size); + for (int _i53 = 0; _i53 < _map52.size; ++_i53) + { + String _key54; + String _val55; + _key54 = iprot.readString(); + _val55 = iprot.readString(); + struct.success.put(_key54, _val55); + } + iprot.readMapEnd(); + } + struct.setSuccessIsSet(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, getLectureData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (Map.Entry<String, String> _iter56 : struct.success.entrySet()) + { + oprot.writeString(_iter56.getKey()); + oprot.writeString(_iter56.getValue()); + } + oprot.writeMapEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory { + public getLectureData_resultTupleScheme getScheme() { + return new getLectureData_resultTupleScheme(); + } + } + + private static class getLectureData_resultTupleScheme extends TupleScheme<getLectureData_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (Map.Entry<String, String> _iter57 : struct.success.entrySet()) + { + oprot.writeString(_iter57.getKey()); + oprot.writeString(_iter57.getValue()); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new HashMap<String,String>(2*_map58.size); + for (int _i59 = 0; _i59 < _map58.size; ++_i59) + { + String _key60; + String _val61; + _key60 = iprot.readString(); + _val61 = iprot.readString(); + struct.success.put(_key60, _val61); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + public static class updateImageData_args implements org.apache.thrift.TBase<updateImageData_args, updateImageData_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateImageData_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateImageData_args"); @@ -16175,766 +16935,6 @@ public class Server { } - public static class getLectureData_args implements org.apache.thrift.TBase<getLectureData_args, getLectureData_args._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_args> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_args"); - - private static final org.apache.thrift.protocol.TField LECTURENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lecturename", org.apache.thrift.protocol.TType.STRING, (short)-1); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureData_argsStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureData_argsTupleSchemeFactory()); - } - - public String lecturename; // 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 { - LECTURENAME((short)-1, "lecturename"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // LECTURENAME - return LECTURENAME; - 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.LECTURENAME, new org.apache.thrift.meta_data.FieldMetaData("lecturename", 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(getLectureData_args.class, metaDataMap); - } - - public getLectureData_args() { - } - - public getLectureData_args( - String lecturename) - { - this(); - this.lecturename = lecturename; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public getLectureData_args(getLectureData_args other) { - if (other.isSetLecturename()) { - this.lecturename = other.lecturename; - } - } - - public getLectureData_args deepCopy() { - return new getLectureData_args(this); - } - - @Override - public void clear() { - this.lecturename = null; - } - - public String getLecturename() { - return this.lecturename; - } - - public getLectureData_args setLecturename(String lecturename) { - this.lecturename = lecturename; - return this; - } - - public void unsetLecturename() { - this.lecturename = null; - } - - /** Returns true if field lecturename is set (has been assigned a value) and false otherwise */ - public boolean isSetLecturename() { - return this.lecturename != null; - } - - public void setLecturenameIsSet(boolean value) { - if (!value) { - this.lecturename = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LECTURENAME: - if (value == null) { - unsetLecturename(); - } else { - setLecturename((String)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LECTURENAME: - return getLecturename(); - - } - 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 LECTURENAME: - return isSetLecturename(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureData_args) - return this.equals((getLectureData_args)that); - return false; - } - - public boolean equals(getLectureData_args that) { - if (that == null) - return false; - - boolean this_present_lecturename = true && this.isSetLecturename(); - boolean that_present_lecturename = true && that.isSetLecturename(); - if (this_present_lecturename || that_present_lecturename) { - if (!(this_present_lecturename && that_present_lecturename)) - return false; - if (!this.lecturename.equals(that.lecturename)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureData_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetLecturename()).compareTo(other.isSetLecturename()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLecturename()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lecturename, other.lecturename); - 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("getLectureData_args("); - boolean first = true; - - sb.append("lecturename:"); - if (this.lecturename == null) { - sb.append("null"); - } else { - sb.append(this.lecturename); - } - 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 getLectureData_argsStandardSchemeFactory implements SchemeFactory { - public getLectureData_argsStandardScheme getScheme() { - return new getLectureData_argsStandardScheme(); - } - } - - private static class getLectureData_argsStandardScheme extends StandardScheme<getLectureData_args> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_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: // LECTURENAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(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, getLectureData_args struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.lecturename != null) { - oprot.writeFieldBegin(LECTURENAME_FIELD_DESC); - oprot.writeString(struct.lecturename); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureData_argsTupleSchemeFactory implements SchemeFactory { - public getLectureData_argsTupleScheme getScheme() { - return new getLectureData_argsTupleScheme(); - } - } - - private static class getLectureData_argsTupleScheme extends TupleScheme<getLectureData_args> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetLecturename()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetLecturename()) { - oprot.writeString(struct.lecturename); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_args struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - struct.lecturename = iprot.readString(); - struct.setLecturenameIsSet(true); - } - } - } - - } - - public static class getLectureData_result implements org.apache.thrift.TBase<getLectureData_result, getLectureData_result._Fields>, java.io.Serializable, Cloneable, Comparable<getLectureData_result> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getLectureData_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new getLectureData_resultStandardSchemeFactory()); - schemes.put(TupleScheme.class, new getLectureData_resultTupleSchemeFactory()); - } - - public Map<String,String> success; // 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"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case 0: // SUCCESS - return SUCCESS; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); - tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING), - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getLectureData_result.class, metaDataMap); - } - - public getLectureData_result() { - } - - public getLectureData_result( - Map<String,String> success) - { - this(); - this.success = success; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public getLectureData_result(getLectureData_result other) { - if (other.isSetSuccess()) { - Map<String,String> __this__success = new HashMap<String,String>(other.success); - this.success = __this__success; - } - } - - public getLectureData_result deepCopy() { - return new getLectureData_result(this); - } - - @Override - public void clear() { - this.success = null; - } - - public int getSuccessSize() { - return (this.success == null) ? 0 : this.success.size(); - } - - public void putToSuccess(String key, String val) { - if (this.success == null) { - this.success = new HashMap<String,String>(); - } - this.success.put(key, val); - } - - public Map<String,String> getSuccess() { - return this.success; - } - - public getLectureData_result setSuccess(Map<String,String> success) { - this.success = success; - return this; - } - - public void unsetSuccess() { - this.success = null; - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return this.success != null; - } - - public void setSuccessIsSet(boolean value) { - if (!value) { - this.success = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Map<String,String>)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return getSuccess(); - - } - throw new IllegalStateException(); - } - - /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getLectureData_result) - return this.equals((getLectureData_result)that); - return false; - } - - public boolean equals(getLectureData_result that) { - if (that == null) - return false; - - boolean this_present_success = true && this.isSetSuccess(); - boolean that_present_success = true && that.isSetSuccess(); - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (!this.success.equals(that.success)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(getLectureData_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success); - if (lastComparison != 0) { - return lastComparison; - } - } - 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("getLectureData_result("); - boolean first = true; - - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); - } - 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 getLectureData_resultStandardSchemeFactory implements SchemeFactory { - public getLectureData_resultStandardScheme getScheme() { - return new getLectureData_resultStandardScheme(); - } - } - - private static class getLectureData_resultStandardScheme extends StandardScheme<getLectureData_result> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, getLectureData_result struct) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) - { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case 0: // SUCCESS - if (schemeField.type == org.apache.thrift.protocol.TType.MAP) { - { - org.apache.thrift.protocol.TMap _map52 = iprot.readMapBegin(); - struct.success = new HashMap<String,String>(2*_map52.size); - for (int _i53 = 0; _i53 < _map52.size; ++_i53) - { - String _key54; - String _val55; - _key54 = iprot.readString(); - _val55 = iprot.readString(); - struct.success.put(_key54, _val55); - } - iprot.readMapEnd(); - } - struct.setSuccessIsSet(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, getLectureData_result struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.success != null) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size())); - for (Map.Entry<String, String> _iter56 : struct.success.entrySet()) - { - oprot.writeString(_iter56.getKey()); - oprot.writeString(_iter56.getValue()); - } - oprot.writeMapEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class getLectureData_resultTupleSchemeFactory implements SchemeFactory { - public getLectureData_resultTupleScheme getScheme() { - return new getLectureData_resultTupleScheme(); - } - } - - private static class getLectureData_resultTupleScheme extends TupleScheme<getLectureData_result> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetSuccess()) { - optionals.set(0); - } - oprot.writeBitSet(optionals, 1); - if (struct.isSetSuccess()) { - { - oprot.writeI32(struct.success.size()); - for (Map.Entry<String, String> _iter57 : struct.success.entrySet()) - { - oprot.writeString(_iter57.getKey()); - oprot.writeString(_iter57.getValue()); - } - } - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, getLectureData_result struct) throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(1); - if (incoming.get(0)) { - { - org.apache.thrift.protocol.TMap _map58 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); - struct.success = new HashMap<String,String>(2*_map58.size); - for (int _i59 = 0; _i59 < _map58.size; ++_i59) - { - String _key60; - String _val61; - _key60 = iprot.readString(); - _val61 = iprot.readString(); - struct.success.put(_key60, _val61); - } - } - struct.setSuccessIsSet(true); - } - } - } - - } - public static class deleteImageData_args implements org.apache.thrift.TBase<deleteImageData_args, deleteImageData_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteImageData_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_args"); diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index b70f9c74..0ba4d08c 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -302,12 +302,8 @@ public class ServerHandler implements Server.Iface { return false; } - @Override - public Map<String, String> getLectureData(String lecturename) - throws TException { - // TODO Auto-generated method stub - return null; - } + + @Override public List<Lecture> getLectureList() throws TException { @@ -412,6 +408,15 @@ public class ServerHandler implements Server.Iface { } + @Override + public Map<String, String> getLectureData(String lectureid) + throws TException { + log.info(new Date() + " - returning LectureData: " + + sql.getLectureData(lectureid).size() + "items."); + return sql.getLectureData(lectureid); + } + + public static int nthIndexOf(final String string, final String token, final int index) { |
