diff options
Diffstat (limited to 'Dozentenmodulserver/src')
| -rw-r--r-- | Dozentenmodulserver/src/server/BinaryListener.java | 2 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/Server.java | 3680 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/ServerHandler.java | 345 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/startServer.java | 2 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/sql/SQL.java | 191 |
5 files changed, 4019 insertions, 201 deletions
diff --git a/Dozentenmodulserver/src/server/BinaryListener.java b/Dozentenmodulserver/src/server/BinaryListener.java index 8d592992..97793778 100644 --- a/Dozentenmodulserver/src/server/BinaryListener.java +++ b/Dozentenmodulserver/src/server/BinaryListener.java @@ -28,7 +28,7 @@ public class BinaryListener implements Runnable return; } TServer server = new TSimpleServer( new Args( transport ).processor( processor ) ); - log.info(new Date() +" - Started Running Server"); + log.info(new Date() +" - Started running BinaryListener"); server.serve(); } diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index d3e256df..fac89b2c 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -62,8 +62,16 @@ public class Server { public Map<String,String> getLectureData(String lecturename) throws org.apache.thrift.TException; + public boolean deleteImageData(String id, String version) throws org.apache.thrift.TException; + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException; + public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException; + + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException; + + public boolean deleteLecture(String id) throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -94,8 +102,16 @@ public class Server { public void getLectureData(String lecturename, 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; + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void deleteLecture(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -446,6 +462,30 @@ public class Server { 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); + return recv_deleteImageData(); + } + + public void send_deleteImageData(String id, String version) throws org.apache.thrift.TException + { + deleteImageData_args args = new deleteImageData_args(); + args.setId(id); + args.setVersion(version); + sendBase("deleteImageData", args); + } + + public boolean recv_deleteImageData() throws org.apache.thrift.TException + { + deleteImageData_result result = new deleteImageData_result(); + receiveBase(result, "deleteImageData"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageData failed: unknown result"); + } + public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws org.apache.thrift.TException { send_updateLecturedata(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id); @@ -483,6 +523,77 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateLecturedata failed: unknown result"); } + public boolean deleteImageServer(String id, String version) throws org.apache.thrift.TException + { + send_deleteImageServer(id, version); + return recv_deleteImageServer(); + } + + public void send_deleteImageServer(String id, String version) throws org.apache.thrift.TException + { + deleteImageServer_args args = new deleteImageServer_args(); + args.setId(id); + args.setVersion(version); + sendBase("deleteImageServer", args); + } + + public boolean recv_deleteImageServer() throws org.apache.thrift.TException + { + deleteImageServer_result result = new deleteImageServer_result(); + receiveBase(result, "deleteImageServer"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteImageServer failed: unknown result"); + } + + public boolean connectedToLecture(String id, String version) throws org.apache.thrift.TException + { + send_connectedToLecture(id, version); + return recv_connectedToLecture(); + } + + public void send_connectedToLecture(String id, String version) throws org.apache.thrift.TException + { + connectedToLecture_args args = new connectedToLecture_args(); + args.setId(id); + args.setVersion(version); + sendBase("connectedToLecture", args); + } + + public boolean recv_connectedToLecture() throws org.apache.thrift.TException + { + connectedToLecture_result result = new connectedToLecture_result(); + receiveBase(result, "connectedToLecture"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "connectedToLecture failed: unknown result"); + } + + public boolean deleteLecture(String id) throws org.apache.thrift.TException + { + send_deleteLecture(id); + return recv_deleteLecture(); + } + + public void send_deleteLecture(String id) throws org.apache.thrift.TException + { + deleteLecture_args args = new deleteLecture_args(); + args.setId(id); + sendBase("deleteLecture", args); + } + + public boolean recv_deleteLecture() throws org.apache.thrift.TException + { + deleteLecture_result result = new deleteLecture_result(); + receiveBase(result, "deleteLecture"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteLecture failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { @@ -1004,6 +1115,41 @@ public class Server { } } + 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); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteImageData_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public deleteImageData_call(String id, String version, 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.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageData", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteImageData_args args = new deleteImageData_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean 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_deleteImageData(); + } + } + public void updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); updateLecturedata_call method_call = new updateLecturedata_call(name, newName, shortdesc, desc, startDate, endDate, isActive, imagename, firstname, lastname, university, Mail, Tel, Fak, id, resultHandler, this, ___protocolFactory, ___transport); @@ -1078,6 +1224,108 @@ public class Server { } } + public void deleteImageServer(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteImageServer_call method_call = new deleteImageServer_call(id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteImageServer_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public deleteImageServer_call(String id, String version, 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.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteImageServer", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteImageServer_args args = new deleteImageServer_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean 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_deleteImageServer(); + } + } + + public void connectedToLecture(String id, String version, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + connectedToLecture_call method_call = new connectedToLecture_call(id, version, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class connectedToLecture_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + private String version; + public connectedToLecture_call(String id, String version, 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.id = id; + this.version = version; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("connectedToLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); + connectedToLecture_args args = new connectedToLecture_args(); + args.setId(id); + args.setVersion(version); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean 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_connectedToLecture(); + } + } + + public void deleteLecture(String id, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + deleteLecture_call method_call = new deleteLecture_call(id, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class deleteLecture_call extends org.apache.thrift.async.TAsyncMethodCall { + private String id; + public deleteLecture_call(String id, 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.id = id; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteLecture", org.apache.thrift.protocol.TMessageType.CALL, 0)); + deleteLecture_args args = new deleteLecture_args(); + args.setId(id); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean 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_deleteLecture(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -1104,7 +1352,11 @@ public class Server { processMap.put("getImageData", new getImageData()); processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); + processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("connectedToLecture", new connectedToLecture()); + processMap.put("deleteLecture", new deleteLecture()); return processMap; } @@ -1373,6 +1625,27 @@ public class Server { } } + public static class deleteImageData<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteImageData_args> { + public deleteImageData() { + super("deleteImageData"); + } + + public deleteImageData_args getEmptyArgsInstance() { + return new deleteImageData_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteImageData_result getResult(I iface, deleteImageData_args args) throws org.apache.thrift.TException { + deleteImageData_result result = new deleteImageData_result(); + result.success = iface.deleteImageData(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + public static class updateLecturedata<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateLecturedata_args> { public updateLecturedata() { super("updateLecturedata"); @@ -1394,6 +1667,69 @@ public class Server { } } + public static class deleteImageServer<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteImageServer_args> { + public deleteImageServer() { + super("deleteImageServer"); + } + + public deleteImageServer_args getEmptyArgsInstance() { + return new deleteImageServer_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteImageServer_result getResult(I iface, deleteImageServer_args args) throws org.apache.thrift.TException { + deleteImageServer_result result = new deleteImageServer_result(); + result.success = iface.deleteImageServer(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + + public static class connectedToLecture<I extends Iface> extends org.apache.thrift.ProcessFunction<I, connectedToLecture_args> { + public connectedToLecture() { + super("connectedToLecture"); + } + + public connectedToLecture_args getEmptyArgsInstance() { + return new connectedToLecture_args(); + } + + protected boolean isOneway() { + return false; + } + + public connectedToLecture_result getResult(I iface, connectedToLecture_args args) throws org.apache.thrift.TException { + connectedToLecture_result result = new connectedToLecture_result(); + result.success = iface.connectedToLecture(args.id, args.version); + result.setSuccessIsSet(true); + return result; + } + } + + public static class deleteLecture<I extends Iface> extends org.apache.thrift.ProcessFunction<I, deleteLecture_args> { + public deleteLecture() { + super("deleteLecture"); + } + + public deleteLecture_args getEmptyArgsInstance() { + return new deleteLecture_args(); + } + + protected boolean isOneway() { + return false; + } + + public deleteLecture_result getResult(I iface, deleteLecture_args args) throws org.apache.thrift.TException { + deleteLecture_result result = new deleteLecture_result(); + result.success = iface.deleteLecture(args.id); + result.setSuccessIsSet(true); + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -1420,7 +1756,11 @@ public class Server { processMap.put("getImageData", new getImageData()); processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("deleteImageData", new deleteImageData()); processMap.put("updateLecturedata", new updateLecturedata()); + processMap.put("deleteImageServer", new deleteImageServer()); + processMap.put("connectedToLecture", new connectedToLecture()); + processMap.put("deleteLecture", new deleteLecture()); return processMap; } @@ -2092,6 +2432,58 @@ public class Server { } } + public static class deleteImageData<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteImageData_args, Boolean> { + public deleteImageData() { + super("deleteImageData"); + } + + public deleteImageData_args getEmptyArgsInstance() { + return new deleteImageData_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + deleteImageData_result result = new deleteImageData_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + deleteImageData_result result = new deleteImageData_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()); + } + 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, deleteImageData_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.deleteImageData(args.id, args.version,resultHandler); + } + } + public static class updateLecturedata<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateLecturedata_args, Boolean> { public updateLecturedata() { super("updateLecturedata"); @@ -2144,6 +2536,162 @@ public class Server { } } + public static class deleteImageServer<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteImageServer_args, Boolean> { + public deleteImageServer() { + super("deleteImageServer"); + } + + public deleteImageServer_args getEmptyArgsInstance() { + return new deleteImageServer_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + deleteImageServer_result result = new deleteImageServer_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + deleteImageServer_result result = new deleteImageServer_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()); + } + 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, deleteImageServer_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.deleteImageServer(args.id, args.version,resultHandler); + } + } + + public static class connectedToLecture<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, connectedToLecture_args, Boolean> { + public connectedToLecture() { + super("connectedToLecture"); + } + + public connectedToLecture_args getEmptyArgsInstance() { + return new connectedToLecture_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + connectedToLecture_result result = new connectedToLecture_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + connectedToLecture_result result = new connectedToLecture_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()); + } + 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, connectedToLecture_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.connectedToLecture(args.id, args.version,resultHandler); + } + } + + public static class deleteLecture<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteLecture_args, Boolean> { + public deleteLecture() { + super("deleteLecture"); + } + + public deleteLecture_args getEmptyArgsInstance() { + return new deleteLecture_args(); + } + + public AsyncMethodCallback<Boolean> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<Boolean>() { + public void onComplete(Boolean o) { + deleteLecture_result result = new deleteLecture_result(); + result.success = o; + result.setSuccessIsSet(true); + 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; + deleteLecture_result result = new deleteLecture_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()); + } + 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, deleteLecture_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.deleteLecture(args.id,resultHandler); + } + } + } public static class getFtpUser_args implements org.apache.thrift.TBase<getFtpUser_args, getFtpUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFtpUser_args> { @@ -14494,6 +15042,814 @@ public class Server { } + 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"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageData_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageData_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // 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 { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + 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: // ID + return ID; + case -2: // VERSION + return VERSION; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", 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(deleteImageData_args.class, metaDataMap); + } + + public deleteImageData_args() { + } + + public deleteImageData_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteImageData_args(deleteImageData_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public deleteImageData_args deepCopy() { + return new deleteImageData_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public deleteImageData_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public deleteImageData_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + 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 ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageData_args) + return this.equals((deleteImageData_args)that); + return false; + } + + public boolean equals(deleteImageData_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageData_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + 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("deleteImageData_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + 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 deleteImageData_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageData_argsStandardScheme getScheme() { + return new deleteImageData_argsStandardScheme(); + } + } + + private static class deleteImageData_argsStandardScheme extends StandardScheme<deleteImageData_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(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, deleteImageData_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageData_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageData_argsTupleScheme getScheme() { + return new deleteImageData_argsTupleScheme(); + } + } + + private static class deleteImageData_argsTupleScheme extends TupleScheme<deleteImageData_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class deleteImageData_result implements org.apache.thrift.TBase<deleteImageData_result, deleteImageData_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteImageData_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageData_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageData_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageData_resultTupleSchemeFactory()); + } + + public boolean 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 + private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageData_result.class, metaDataMap); + } + + public deleteImageData_result() { + } + + public deleteImageData_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteImageData_result(deleteImageData_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteImageData_result deepCopy() { + return new deleteImageData_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteImageData_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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 deleteImageData_result) + return this.equals((deleteImageData_result)that); + return false; + } + + public boolean equals(deleteImageData_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageData_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("deleteImageData_result("); + boolean first = true; + + sb.append("success:"); + 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 { + // 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 deleteImageData_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageData_resultStandardScheme getScheme() { + return new deleteImageData_resultStandardScheme(); + } + } + + private static class deleteImageData_resultStandardScheme extends StandardScheme<deleteImageData_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageData_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.BOOL) { + struct.success = iprot.readBool(); + 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, deleteImageData_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageData_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageData_resultTupleScheme getScheme() { + return new deleteImageData_resultTupleScheme(); + } + } + + private static class deleteImageData_resultTupleScheme extends TupleScheme<deleteImageData_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageData_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.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageData_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + public static class updateLecturedata_args implements org.apache.thrift.TBase<updateLecturedata_args, updateLecturedata_args._Fields>, java.io.Serializable, Cloneable, Comparable<updateLecturedata_args> { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_args"); @@ -16600,4 +17956,2328 @@ public class Server { } + public static class deleteImageServer_args implements org.apache.thrift.TBase<deleteImageServer_args, deleteImageServer_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteImageServer_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // 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 { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + 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: // ID + return ID; + case -2: // VERSION + return VERSION; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", 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(deleteImageServer_args.class, metaDataMap); + } + + public deleteImageServer_args() { + } + + public deleteImageServer_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteImageServer_args(deleteImageServer_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public deleteImageServer_args deepCopy() { + return new deleteImageServer_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public deleteImageServer_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public deleteImageServer_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + 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 ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteImageServer_args) + return this.equals((deleteImageServer_args)that); + return false; + } + + public boolean equals(deleteImageServer_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageServer_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + 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("deleteImageServer_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + 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 deleteImageServer_argsStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_argsStandardScheme getScheme() { + return new deleteImageServer_argsStandardScheme(); + } + } + + private static class deleteImageServer_argsStandardScheme extends StandardScheme<deleteImageServer_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(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, deleteImageServer_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageServer_argsTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_argsTupleScheme getScheme() { + return new deleteImageServer_argsTupleScheme(); + } + } + + private static class deleteImageServer_argsTupleScheme extends TupleScheme<deleteImageServer_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class deleteImageServer_result implements org.apache.thrift.TBase<deleteImageServer_result, deleteImageServer_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteImageServer_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteImageServer_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteImageServer_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteImageServer_resultTupleSchemeFactory()); + } + + public boolean 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 + private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteImageServer_result.class, metaDataMap); + } + + public deleteImageServer_result() { + } + + public deleteImageServer_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteImageServer_result(deleteImageServer_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteImageServer_result deepCopy() { + return new deleteImageServer_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteImageServer_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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 deleteImageServer_result) + return this.equals((deleteImageServer_result)that); + return false; + } + + public boolean equals(deleteImageServer_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteImageServer_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("deleteImageServer_result("); + boolean first = true; + + sb.append("success:"); + 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 { + // 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 deleteImageServer_resultStandardSchemeFactory implements SchemeFactory { + public deleteImageServer_resultStandardScheme getScheme() { + return new deleteImageServer_resultStandardScheme(); + } + } + + private static class deleteImageServer_resultStandardScheme extends StandardScheme<deleteImageServer_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteImageServer_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.BOOL) { + struct.success = iprot.readBool(); + 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, deleteImageServer_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteImageServer_resultTupleSchemeFactory implements SchemeFactory { + public deleteImageServer_resultTupleScheme getScheme() { + return new deleteImageServer_resultTupleScheme(); + } + } + + private static class deleteImageServer_resultTupleScheme extends TupleScheme<deleteImageServer_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_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.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteImageServer_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class connectedToLecture_args implements org.apache.thrift.TBase<connectedToLecture_args, connectedToLecture_args._Fields>, java.io.Serializable, Cloneable, Comparable<connectedToLecture_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("version", org.apache.thrift.protocol.TType.STRING, (short)-2); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new connectedToLecture_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new connectedToLecture_argsTupleSchemeFactory()); + } + + public String id; // required + public String version; // 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 { + ID((short)-1, "id"), + VERSION((short)-2, "version"); + + 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: // ID + return ID; + case -2: // VERSION + return VERSION; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VERSION, new org.apache.thrift.meta_data.FieldMetaData("version", 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(connectedToLecture_args.class, metaDataMap); + } + + public connectedToLecture_args() { + } + + public connectedToLecture_args( + String id, + String version) + { + this(); + this.id = id; + this.version = version; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public connectedToLecture_args(connectedToLecture_args other) { + if (other.isSetId()) { + this.id = other.id; + } + if (other.isSetVersion()) { + this.version = other.version; + } + } + + public connectedToLecture_args deepCopy() { + return new connectedToLecture_args(this); + } + + @Override + public void clear() { + this.id = null; + this.version = null; + } + + public String getId() { + return this.id; + } + + public connectedToLecture_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public String getVersion() { + return this.version; + } + + public connectedToLecture_args setVersion(String version) { + this.version = version; + return this; + } + + public void unsetVersion() { + this.version = null; + } + + /** Returns true if field version is set (has been assigned a value) and false otherwise */ + public boolean isSetVersion() { + return this.version != null; + } + + public void setVersionIsSet(boolean value) { + if (!value) { + this.version = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + case VERSION: + if (value == null) { + unsetVersion(); + } else { + setVersion((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + case VERSION: + return getVersion(); + + } + 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 ID: + return isSetId(); + case VERSION: + return isSetVersion(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof connectedToLecture_args) + return this.equals((connectedToLecture_args)that); + return false; + } + + public boolean equals(connectedToLecture_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + boolean this_present_version = true && this.isSetVersion(); + boolean that_present_version = true && that.isSetVersion(); + if (this_present_version || that_present_version) { + if (!(this_present_version && that_present_version)) + return false; + if (!this.version.equals(that.version)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(connectedToLecture_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVersion()).compareTo(other.isSetVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.version, other.version); + 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("connectedToLecture_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + first = false; + if (!first) sb.append(", "); + sb.append("version:"); + if (this.version == null) { + sb.append("null"); + } else { + sb.append(this.version); + } + 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 connectedToLecture_argsStandardSchemeFactory implements SchemeFactory { + public connectedToLecture_argsStandardScheme getScheme() { + return new connectedToLecture_argsStandardScheme(); + } + } + + private static class connectedToLecture_argsStandardScheme extends StandardScheme<connectedToLecture_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.version = iprot.readString(); + struct.setVersionIsSet(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, connectedToLecture_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.version != null) { + oprot.writeFieldBegin(VERSION_FIELD_DESC); + oprot.writeString(struct.version); + oprot.writeFieldEnd(); + } + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class connectedToLecture_argsTupleSchemeFactory implements SchemeFactory { + public connectedToLecture_argsTupleScheme getScheme() { + return new connectedToLecture_argsTupleScheme(); + } + } + + private static class connectedToLecture_argsTupleScheme extends TupleScheme<connectedToLecture_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetVersion()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + if (struct.isSetVersion()) { + oprot.writeString(struct.version); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.version = iprot.readString(); + struct.setVersionIsSet(true); + } + } + } + + } + + public static class connectedToLecture_result implements org.apache.thrift.TBase<connectedToLecture_result, connectedToLecture_result._Fields>, java.io.Serializable, Cloneable, Comparable<connectedToLecture_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connectedToLecture_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new connectedToLecture_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new connectedToLecture_resultTupleSchemeFactory()); + } + + public boolean 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 + private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connectedToLecture_result.class, metaDataMap); + } + + public connectedToLecture_result() { + } + + public connectedToLecture_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public connectedToLecture_result(connectedToLecture_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public connectedToLecture_result deepCopy() { + return new connectedToLecture_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public connectedToLecture_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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 connectedToLecture_result) + return this.equals((connectedToLecture_result)that); + return false; + } + + public boolean equals(connectedToLecture_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(connectedToLecture_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("connectedToLecture_result("); + boolean first = true; + + sb.append("success:"); + 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 { + // 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 connectedToLecture_resultStandardSchemeFactory implements SchemeFactory { + public connectedToLecture_resultStandardScheme getScheme() { + return new connectedToLecture_resultStandardScheme(); + } + } + + private static class connectedToLecture_resultStandardScheme extends StandardScheme<connectedToLecture_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, connectedToLecture_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.BOOL) { + struct.success = iprot.readBool(); + 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, connectedToLecture_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class connectedToLecture_resultTupleSchemeFactory implements SchemeFactory { + public connectedToLecture_resultTupleScheme getScheme() { + return new connectedToLecture_resultTupleScheme(); + } + } + + private static class connectedToLecture_resultTupleScheme extends TupleScheme<connectedToLecture_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_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.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, connectedToLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class deleteLecture_args implements org.apache.thrift.TBase<deleteLecture_args, deleteLecture_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteLecture_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_args"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", 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 deleteLecture_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLecture_argsTupleSchemeFactory()); + } + + public String id; // 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 { + ID((short)-1, "id"); + + 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: // ID + return ID; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.ID, new org.apache.thrift.meta_data.FieldMetaData("id", 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(deleteLecture_args.class, metaDataMap); + } + + public deleteLecture_args() { + } + + public deleteLecture_args( + String id) + { + this(); + this.id = id; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteLecture_args(deleteLecture_args other) { + if (other.isSetId()) { + this.id = other.id; + } + } + + public deleteLecture_args deepCopy() { + return new deleteLecture_args(this); + } + + @Override + public void clear() { + this.id = null; + } + + public String getId() { + return this.id; + } + + public deleteLecture_args setId(String id) { + this.id = id; + return this; + } + + public void unsetId() { + this.id = null; + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return this.id != null; + } + + public void setIdIsSet(boolean value) { + if (!value) { + this.id = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return getId(); + + } + 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 ID: + return isSetId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof deleteLecture_args) + return this.equals((deleteLecture_args)that); + return false; + } + + public boolean equals(deleteLecture_args that) { + if (that == null) + return false; + + boolean this_present_id = true && this.isSetId(); + boolean that_present_id = true && that.isSetId(); + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (!this.id.equals(that.id)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteLecture_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(other.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, other.id); + 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("deleteLecture_args("); + boolean first = true; + + sb.append("id:"); + if (this.id == null) { + sb.append("null"); + } else { + sb.append(this.id); + } + 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 deleteLecture_argsStandardSchemeFactory implements SchemeFactory { + public deleteLecture_argsStandardScheme getScheme() { + return new deleteLecture_argsStandardScheme(); + } + } + + private static class deleteLecture_argsStandardScheme extends StandardScheme<deleteLecture_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_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: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.id = iprot.readString(); + struct.setIdIsSet(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, deleteLecture_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.id != null) { + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeString(struct.id); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLecture_argsTupleSchemeFactory implements SchemeFactory { + public deleteLecture_argsTupleScheme getScheme() { + return new deleteLecture_argsTupleScheme(); + } + } + + private static class deleteLecture_argsTupleScheme extends TupleScheme<deleteLecture_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + } + } + + } + + public static class deleteLecture_result implements org.apache.thrift.TBase<deleteLecture_result, deleteLecture_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteLecture_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteLecture_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new deleteLecture_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new deleteLecture_resultTupleSchemeFactory()); + } + + public boolean 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 + private static final int __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteLecture_result.class, metaDataMap); + } + + public deleteLecture_result() { + } + + public deleteLecture_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public deleteLecture_result(deleteLecture_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public deleteLecture_result deepCopy() { + return new deleteLecture_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public deleteLecture_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + } + 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 deleteLecture_result) + return this.equals((deleteLecture_result)that); + return false; + } + + public boolean equals(deleteLecture_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(deleteLecture_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("deleteLecture_result("); + boolean first = true; + + sb.append("success:"); + 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 { + // 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 deleteLecture_resultStandardSchemeFactory implements SchemeFactory { + public deleteLecture_resultStandardScheme getScheme() { + return new deleteLecture_resultStandardScheme(); + } + } + + private static class deleteLecture_resultStandardScheme extends StandardScheme<deleteLecture_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, deleteLecture_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.BOOL) { + struct.success = iprot.readBool(); + 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, deleteLecture_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class deleteLecture_resultTupleSchemeFactory implements SchemeFactory { + public deleteLecture_resultTupleScheme getScheme() { + return new deleteLecture_resultTupleScheme(); + } + } + + private static class deleteLecture_resultTupleScheme extends TupleScheme<deleteLecture_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, deleteLecture_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.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, deleteLecture_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + + } + } diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index d5d3aba1..14157a61 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -19,154 +19,174 @@ import javax.xml.parsers.ParserConfigurationException; import javax.xml.transform.TransformerException; import org.apache.commons.io.FileUtils; +import org.apache.log4j.Logger; import org.apache.thrift.TException; import sql.SQL; import util.XMLCreator; - public class ServerHandler implements Server.Iface { - static SQL sql=new SQL(); - static Connection con=sql.getConnection(); + static SQL sql = new SQL(); + static Connection con = sql.getConnection(); + private static Logger log = Logger.getLogger(ServerHandler.class); + /** * @param args */ - /*public static void main(String[] args) { - // TODO Auto-generated method stub - - }*/ + /* + * public static void main(String[] args) { // TODO Auto-generated method + * stub + * + * } + */ @Override public User getFtpUser() throws TException { - User user=new User(); + log.info(new Date() + " - returing FTPUser..."); + User user = new User(); user.setUserName(UUID.randomUUID().toString().substring(0, 8)); - user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString().substring(0, 8))); + user.setPassword(getEncodedSha1Sum(UUID.randomUUID().toString() + .substring(0, 8))); user.setPath("/srv/openslx/nfs/temp"); - SQL sql=new SQL(); - Connection con=sql.getConnection(); + SQL sql = new SQL(); + Connection con = sql.getConnection(); sql.writeFTPUser(con, user.getUserName(), user.getPassword()); + log.info(new Date() + " - successfully returned FTPUser"); return user; } - public String getEncodedSha1Sum(String key) { - try { - MessageDigest md = MessageDigest.getInstance( "SHA1" ); - md.update( key.getBytes() ); - return new BigInteger(1, md.digest()).toString(16); - } - catch (NoSuchAlgorithmException e) { - // handle error case to taste - } + try { + log.info(new Date() + " - returned EncodedSha1Sum..."); + MessageDigest md = MessageDigest.getInstance("SHA1"); + md.update(key.getBytes()); + log.info(new Date() + " - successfully returned EncodedSha1Sum"); + return new BigInteger(1, md.digest()).toString(16); + } catch (NoSuchAlgorithmException e) { + // handle error case to taste + } return null; } @Override public long DeleteFtpUser(String user) throws TException { int ret = sql.DeleteUser(con, user); + log.info(new Date() + " - deleting FTPUser"); return ret; } @Override - public String getPathOfImage(String image_id, String version) throws TException { - + public String getPathOfImage(String image_id, String version) + throws TException { + try { - ResultSet rs=sql.getPathOfImage(con, image_id, version); + log.info(new Date() + " - returning PathOfImage..."); + ResultSet rs = sql.getPathOfImage(con, image_id, version); System.out.println("Path SQL erfolgreich"); rs.next(); System.out.println(rs.getString("image_path")); + log.info(new Date() + " - successfully returned PathOfImage: " + + rs.getString("image_path")); return rs.getString("image_path"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - + log.info(new Date() + " - returning PathOfImage: null"); return null; } @Override public boolean writeVLdata(String imagename, String firstname, String lastname, String university, String Mail, String Tel, - String Fak, boolean license, boolean internet, long ram, long cpu, String imagePath) - throws TException { - String login="tete"; - - int pk_institution=sql.setInstitution(con, university); - - int pk_person=sql.setPerson(con, login, lastname, firstname, Mail, new Date(), pk_institution); - - sql.setImageData(con, pk_person, license, internet, cpu, ram, imagename, imagePath); + String Fak, boolean license, boolean internet, long ram, long cpu, + String imagePath) throws TException { + String login = "tete"; + + int pk_institution = sql.setInstitution(con, university); + + int pk_person = sql.setPerson(con, login, lastname, firstname, Mail, + new Date(), pk_institution); + sql.setImageData(con, pk_person, license, internet, cpu, ram, + imagename, imagePath); + + log.info(new Date() + " - writing VLdata"); // TODO Auto-generated method stub return true; } @Override public List<Image> getImageList() throws TException { - ResultSet res=sql.getImageList(con); - + ResultSet res = sql.getImageList(con); + List<Image> list = new ArrayList<Image>(); try { - - while(res.next()) - { - - list.add(new Image(res.getString("GUID_imageID"),res.getString("imageVersion"),res.getString("image_name"),res.getString("cond_hasLicenseRestriction"),res.getString("name"),res.getString("lecture"),res.getString("image_update_time"),res.getString("user"))); - + + while (res.next()) { + + list.add(new Image(res.getString("GUID_imageID"), res + .getString("imageVersion"), + res.getString("image_name"), res + .getString("cond_hasLicenseRestriction"), res + .getString("name"), res.getString("lecture"), + res.getString("image_update_time"), res + .getString("user"))); + } - + log.info(new Date() + " - returning ImageList: " + list.size()); return list; } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - + log.info(new Date() + " - returning ImageList: " + list.size()); return null; } - @Override public List<String> getAllOS() throws TException { - List<String> list=new ArrayList<>(); - ResultSet rs=sql.getAllOS(con); + List<String> list = new ArrayList<>(); + ResultSet rs = sql.getAllOS(con); try { - while(rs.next()) - { + while (rs.next()) { list.add(rs.getString("name")); } + log.info(new Date() + " - returning AllOS: " + list.size()); return list; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } + log.info(new Date() + " - returning AllOS: " + list.size()); return null; } @Override public Map<String, String> getPersonData(String Vorname, String Nachname) throws TException { - Map<String,String> map=new HashMap<String, String>(); - - ResultSet rs=sql.getPersonData(con, Vorname, Nachname); + Map<String, String> map = new HashMap<String, String>(); + + ResultSet rs = sql.getPersonData(con, Vorname, Nachname); try { - while(rs.next()) - { - + while (rs.next()) { + map.put("mail", rs.getString("mail")); map.put("Nachname", rs.getString("Nachname")); map.put("Vorname", rs.getString("Vorname")); map.put("Hochschule", rs.getString("name")); - } + log.info(new Date() + " - returning PersonData: " + map.size()); return map; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } + log.info(new Date() + " - returning PersonData: " + map.size()); return null; } @@ -177,100 +197,117 @@ public class ServerHandler implements Server.Iface { String university, String Mail, String Tel, String Fak) throws TException { int pk_image = 0; - String login="tete"; + String login = "tete"; int imageversion = 0; - int pk_institution=sql.setInstitution(con, university); - int pk_person=sql.setPerson(con, login, lastname, firstname, Mail, new Date(), pk_institution); - - ResultSet image=sql.getImageIDandVersion(con, imagename); - - try { - while(image.next()) - { - pk_image=image.getInt("GUID_imageID"); - imageversion=image.getInt("imageVersion"); - } - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - System.out.println(startDate); - sql.setLectureData(con, pk_person, pk_image, imageversion, name, desc, shortdesc, startDate, endDate, isActive); - XMLCreator xml=new XMLCreator(con, name); - try { - xml.create(name); - System.out.println(new Date() + " - Creator beendet"); - } catch (SQLException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (ParserConfigurationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (TransformerException e) { - // TODO Auto-generated catch block - e.printStackTrace(); + int pk_institution = sql.setInstitution(con, university); + int pk_person = sql.setPerson(con, login, lastname, firstname, Mail, + new Date(), pk_institution); + + ResultSet image = sql.getImageIDandVersion(con, imagename); + + try { + while (image.next()) { + pk_image = image.getInt("GUID_imageID"); + imageversion = image.getInt("imageVersion"); } + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + System.out.println(startDate); + sql.setLectureData(con, pk_person, pk_image, imageversion, name, desc, + shortdesc, startDate, endDate, isActive); + XMLCreator xml = new XMLCreator(con, name); + try { + xml.create(name); + log.info(new Date() + " - XML created"); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (ParserConfigurationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (TransformerException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } return false; } @Override public boolean startFileCopy(String file) throws TException { - File tmpFile=new File(file); + File tmpFile = new File(file); - System.out.println("Vor Move" +new Date()); + System.out.println("Vor Move" + new Date()); try { + + //der übergebene Filename ist falsch - hier muss der generierte name geholt werden, nicht der ursprüngliche name. wo wird dieser eingelesen? + FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"+tmpFile.getName())); + //der übergebene Filename ist falsch - hier muss der generierte name geholt werden, nicht der ursprüngliche name. wo wird dieser eingelesen? FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/"+tmpFile.getName())); + + // der übergebene Filename ist falsch - hier muss der generierte + // name geholt werden, nicht der ursprüngliche name. wo wird dieser + // eingelesen? + FileUtils.moveFile(tmpFile, new File("141.79.128.103:/srv/nfs4slx/" + + tmpFile.getName())); + log.info(new Date() + " - file moved"); + } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - System.out.println("Nach Move"+new Date()); return true; } - @Override - public Map<String, String> getImageData(String imageid, String imageversion) throws TException { - - ResultSet data=sql.getImageData(con, imageid, imageversion); - - Map<String,String> map=new HashMap<String, String>(); + public Map<String, String> getImageData(String imageid, String imageversion) + throws TException { + + ResultSet data = sql.getImageData(con, imageid, imageversion); + + Map<String, String> map = new HashMap<String, String>(); try { - while(data.next()) - { - System.out.println(data.getString("cond_hasInternetRestriction")+data.getString("cond_hasLicenseRestriction")+data.getString("cond_minCPUs")+data.getString("cond_minRAM")); - map.put("name",data.getString("image_name")); - map.put("internet", data.getString("cond_hasInternetRestriction")); + while (data.next()) { + System.out.println(data + .getString("cond_hasInternetRestriction") + + data.getString("cond_hasLicenseRestriction") + + data.getString("cond_minCPUs") + + data.getString("cond_minRAM")); + map.put("name", data.getString("image_name")); + map.put("internet", + data.getString("cond_hasInternetRestriction")); map.put("license", data.getString("cond_hasLicenseRestriction")); map.put("cpu", data.getString("cond_minCPUs")); map.put("ram", data.getString("cond_minRAM")); - + } System.out.println("return success"); + log.info(new Date() + " - returning ImageData: "+map.size()); return map; } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } + log.info(new Date() + " - returning ImageData: "+map.size()); return null; } - @Override - public boolean updateImageData(String name, String newName,boolean license, - boolean internet, long ram, long cpu,String id, String version) throws TException { + public boolean updateImageData(String name, String newName, + boolean license, boolean internet, long ram, long cpu, String id, + String version) throws TException { System.out.println("Server: Vor Update"); - sql.UpdateImageData(con, name, newName ,license, internet, cpu, ram, id, version); + sql.UpdateImageData(con, name, newName, license, internet, cpu, ram, + id, version); System.out.println("Update erfolgreich"); + log.info(new Date() + " - updated ImageData"); return false; } - @Override public Map<String, String> getLectureData(String lecturename) throws TException { @@ -278,53 +315,53 @@ public class ServerHandler implements Server.Iface { return null; } - @Override public List<Lecture> getLectureList() throws TException { - ResultSet res=sql.getLectureList(con); - + ResultSet res = sql.getLectureList(con); + List<Lecture> list = new ArrayList<Lecture>(); try { - - while(res.next()) - { - - list.add(new Lecture(res.getString("lectureID"), res.getString("name"), res.getString("isActive"), res.getString("startTime"), res.getString("endTime"), res.getString("lastUsed"), res.getString("description"), res.getString("image_name"), res.getString("user"))); - - } - + while (res.next()) { + + list.add(new Lecture(res.getString("lectureID"), res + .getString("name"), res.getString("isActive"), res + .getString("startTime"), res.getString("endTime"), res + .getString("lastUsed"), res.getString("description"), + res.getString("image_name"), res.getString("user"))); + + } + log.info(new Date() + " - returning LectureList: "+list.size()); return list; } catch (SQLException e1) { // TODO Auto-generated catch block e1.printStackTrace(); } - + log.info(new Date() + " - returning LectureList: "+list.size()); return null; } - @Override public boolean updateLecturedata(String name, String newName, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String firstname, String lastname, String university, String Mail, String Tel, String Fak, String id) throws TException { - int pk_image=0; - int imageversion=0; - ResultSet image=sql.getImageIDandVersion(con, imagename); + int pk_image = 0; + int imageversion = 0; + ResultSet image = sql.getImageIDandVersion(con, imagename); try { - while(image.next()) - { - pk_image=image.getInt("GUID_imageID"); - imageversion=image.getInt("imageVersion"); + while (image.next()) { + pk_image = image.getInt("GUID_imageID"); + imageversion = image.getInt("imageVersion"); } } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } +<<<<<<< HEAD sql.updateLectureData(con, pk_image, imageversion, lastname, newName, desc, shortdesc, startDate, endDate, isActive, id); XMLCreator xml=new XMLCreator(con, newName); @@ -336,7 +373,57 @@ public class ServerHandler implements Server.Iface { e.printStackTrace(); } +======= + sql.updateLectureData(con, pk_image, imageversion, lastname, newName, + desc, shortdesc, startDate, endDate, isActive, id); + log.info(new Date() + " - updated LectureData"); +>>>>>>> a3c0327dbd49efc29ede542f7093638941a7ae13 return false; } + + @Override + public boolean deleteImageServer(String imageid, String imageversion) throws TException{ + /* + * + * + * + * File noch iniziieren + */ + // Pfad der Datei aus der DB auslesen und hier eintragen + //File tmpFile=new File("127.0.0.1:/srv/openslx/nfs/temp/"); + File tmpFile = null; + + try { + //File wird von Server gelöscht + FileUtils.forceDelete(tmpFile); + + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + + } + + return true; + } + + @Override + public boolean deleteImageData(String id, String version) throws TException { + + return sql.deleteImage(con, id, version); + } + + @Override + public boolean connectedToLecture(String id, String version) + throws TException { + // TODO Auto-generated method stub + return sql.connectedToLecture(con, id, version); + } + + public boolean deleteLecture(String id){ + return sql.deleteLecture(con, id); + } + + + } diff --git a/Dozentenmodulserver/src/server/startServer.java b/Dozentenmodulserver/src/server/startServer.java index e1ab22c0..542c92b8 100644 --- a/Dozentenmodulserver/src/server/startServer.java +++ b/Dozentenmodulserver/src/server/startServer.java @@ -28,6 +28,8 @@ public class startServer { t = new Thread(new BinaryListener()); servers.add(t); t.start(); + //information + log.info( new Date()+" - new thread created. Now "+servers.size()+" thread(s).\n" ); // Run more servers // ... // Wait for all servers to die diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 27bdc17c..5c5b0ec6 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -1,24 +1,18 @@ package sql;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
+import java.sql.*;
+
import java.text.DateFormat;
-import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;
-
import org.apache.log4j.Logger;
-
import server.BinaryListener;
public class SQL {
- private static Logger log = Logger.getLogger( BinaryListener.class );
-
+ private static Logger log = Logger.getLogger(BinaryListener.class);
+
public Connection getConnection() {
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
@@ -53,7 +47,8 @@ public class SQL { + pass
+ "'),'10001','12345','/srv/openslx/nfs/temp');");
con.commit();
- log.info(new Date() + " - created FTPUser "+user+" : "+pass+".");
+ log.info(new Date() + " - created FTPUser " + user + " : " + pass
+ + ".");
return ret;
} catch (SQLException e) {
// TODO Auto-generated catch block
@@ -72,11 +67,11 @@ public class SQL { .executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '"
+ user + "';");
con.commit();
- log.info(new Date() + " - FTPUser "+user+" deleted.");
+ log.info(new Date() + " - FTPUser " + user + " deleted.");
return ret;
} catch (SQLException e) {
// TODO Auto-generated catch block
- log.info(new Date() + " - Could not delete FTPUser "+user+".");
+ log.info(new Date() + " - Could not delete FTPUser " + user + ".");
e.printStackTrace();
}
return -1;
@@ -214,44 +209,31 @@ public class SQL { Random random = new Random();
int uid = random.nextInt();
stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`)VALUES('"
- + uid //GUID_imageID
- + "',1,'" //imageVersion
- + imagename //image_name
- + "','"
- + imagePath //image_path
- + "','"
- + formatter.format(new Date()) //image_lastCall
- + "','"
- + formatter.format(new Date()) //image_create_time
- + "','"
- + formatter.format(new Date()) //image_update_time
- + "','"
- + pk_person //image_owner
- + "','"
- + pk_person //image_change_by
- + "','"
- + formatter.format(new Date()) //rec_create_time
- + "','"
- + formatter.format(new Date()) //rec_change_time
- + "','"
- + pk_person //rec_owner
- + "','"
- + pk_person //rec_change_by
- + "',0" //content_operatingSystem
- + ",1" //status_isCompressed
- + ",1" //status_isSecure
- + ",1" //status_isOptimzed
- + ",1" //status_isValid
- + ",1" //status_isReady
- + ",0" //status_isDeleted
- + ",0,'" //status_isLastOfficialVersion
- + license_bol //cond_hasLicenseRestriction
- + "','"
- + internet_bol //cond_hasInternetRestriction
- + "','"
- + ram //cond_minRAM
- + "','"
- + cpu //cond_minCPUs
+ + uid // GUID_imageID
+ + "',1,'" // imageVersion
+ + imagename // image_name
+ + "','" + imagePath // image_path
+ + "','" + formatter.format(new Date()) // image_lastCall
+ + "','" + formatter.format(new Date()) // image_create_time
+ + "','" + formatter.format(new Date()) // image_update_time
+ + "','" + pk_person // image_owner
+ + "','" + pk_person // image_change_by
+ + "','" + formatter.format(new Date()) // rec_create_time
+ + "','" + formatter.format(new Date()) // rec_change_time
+ + "','" + pk_person // rec_owner
+ + "','" + pk_person // rec_change_by
+ + "',0" // content_operatingSystem
+ + ",1" // status_isCompressed
+ + ",1" // status_isSecure
+ + ",1" // status_isOptimzed
+ + ",1" // status_isValid
+ + ",1" // status_isReady
+ + ",0" // status_isDeleted
+ + ",0,'" // status_isLastOfficialVersion
+ + license_bol // cond_hasLicenseRestriction
+ + "','" + internet_bol // cond_hasInternetRestriction
+ + "','" + ram // cond_minRAM
+ + "','" + cpu // cond_minCPUs
+ "');");
con.commit();
@@ -447,10 +429,39 @@ public class SQL { }
return -1;
}
-
+
+ /**
+ *
+ * @param id
+ * @param version
+ * @return
+ */
+
+ public boolean deleteImage(Connection con, String id, String version) {
+
+ try {
+
+ Statement stm = con.createStatement();
+
+ stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"
+ + id + "' " + "AND imageVersion = '" + version + "';");
+
+ con.commit();
+
+ return true;
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return false;
+ }
+
public int updateLectureData(Connection con, int pk_image,
- int imageversion, String name, String newName ,String desc, String shortdesc,
- String start, String end, boolean isactive, String id) {
+ int imageversion, String name, String newName, String desc,
+ String shortdesc, String start, String end, boolean isactive,
+ String id) {
DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
int active_bol = 0;
@@ -461,30 +472,68 @@ public class SQL { try {
Statement stm = con.createStatement();
stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_lecture` SET `name` = '"
- +newName
- +"',`isActive` = '"
- +active_bol
- +"',`startTime` = '"
- +start
- +"',`endTime` = '"
- +end
- +"',`description` = '"
- +desc
- +"',`imageID` = '"
- +pk_image
- +"',`imageVersion` = '"
- +imageversion
- +"',`admin_changeTime` = '"
- +formatter.format(new Date())
- +"'WHERE `lectureID` = '"
- +id+"';" );
+ + newName
+ + "',`isActive` = '"
+ + active_bol
+ + "',`startTime` = '"
+ + start
+ + "',`endTime` = '"
+ + end
+ + "',`description` = '"
+ + desc
+ + "',`imageID` = '"
+ + pk_image
+ + "',`imageVersion` = '"
+ + imageversion
+ + "',`admin_changeTime` = '"
+ + formatter.format(new Date())
+ + "'WHERE `lectureID` = '" + id + "';");
con.commit();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
+
return 0;
}
+
+ public boolean connectedToLecture(Connection con, String id, String version) {
+
+ try {
+
+ Statement stm = con.createStatement();
+
+ ResultSet rs = stm.executeQuery("SELECT lectureID FROM "
+ + "bwLehrpool.m_VLData_lecture WHERE imageID = '" + id
+ + "' AND imageVersion = '" + version + "';");
+
+ return rs.first();
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return false;
+
+ }
+
+ public boolean deleteLecture(Connection con, String id) {
+
+ try {
+ Statement stm = con.createStatement();
+ stm.executeUpdate("DELETE FROM bwLehrpool.m_VLData_lecture WHERE lectureID = '"+ id + "';");
+
+ con.commit();
+
+ return true;
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ return false;
+ }
}
|
