diff options
Diffstat (limited to 'Dozentenmodulserver/src')
| -rw-r--r-- | Dozentenmodulserver/src/server/Server.java | 2296 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/ServerHandler.java | 11 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/server/User.java | 1154 | ||||
| -rw-r--r-- | Dozentenmodulserver/src/sql/SQL.java | 52 |
4 files changed, 2911 insertions, 602 deletions
diff --git a/Dozentenmodulserver/src/server/Server.java b/Dozentenmodulserver/src/server/Server.java index 6e630387..d3e256df 100644 --- a/Dozentenmodulserver/src/server/Server.java +++ b/Dozentenmodulserver/src/server/Server.java @@ -62,6 +62,8 @@ public class Server { public Map<String,String> getLectureData(String lecturename) 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 interface AsyncIface { @@ -92,6 +94,8 @@ public class Server { public void getLectureData(String lecturename, 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 static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -442,6 +446,43 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getLectureData 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); + return recv_updateLecturedata(); + } + + public void send_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 + { + updateLecturedata_args args = new updateLecturedata_args(); + args.setName(name); + args.setNewName(newName); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImagename(imagename); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + args.setId(id); + sendBase("updateLecturedata", args); + } + + public boolean recv_updateLecturedata() throws org.apache.thrift.TException + { + updateLecturedata_result result = new updateLecturedata_result(); + receiveBase(result, "updateLecturedata"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "updateLecturedata 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> { @@ -963,6 +1004,80 @@ public class Server { } } + 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); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class updateLecturedata_call extends org.apache.thrift.async.TAsyncMethodCall { + private String name; + private String newName; + private String shortdesc; + private String desc; + private String startDate; + private String endDate; + private boolean isActive; + private String imagename; + private String firstname; + private String lastname; + private String university; + private String Mail; + private String Tel; + private String Fak; + private String id; + public updateLecturedata_call(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, 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.name = name; + this.newName = newName; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + this.imagename = imagename; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + 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("updateLecturedata", org.apache.thrift.protocol.TMessageType.CALL, 0)); + updateLecturedata_args args = new updateLecturedata_args(); + args.setName(name); + args.setNewName(newName); + args.setShortdesc(shortdesc); + args.setDesc(desc); + args.setStartDate(startDate); + args.setEndDate(endDate); + args.setIsActive(isActive); + args.setImagename(imagename); + args.setFirstname(firstname); + args.setLastname(lastname); + args.setUniversity(university); + args.setMail(Mail); + args.setTel(Tel); + args.setFak(Fak); + 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_updateLecturedata(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -989,6 +1104,7 @@ public class Server { processMap.put("getImageData", new getImageData()); processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("updateLecturedata", new updateLecturedata()); return processMap; } @@ -1257,6 +1373,27 @@ public class Server { } } + public static class updateLecturedata<I extends Iface> extends org.apache.thrift.ProcessFunction<I, updateLecturedata_args> { + public updateLecturedata() { + super("updateLecturedata"); + } + + public updateLecturedata_args getEmptyArgsInstance() { + return new updateLecturedata_args(); + } + + protected boolean isOneway() { + return false; + } + + public updateLecturedata_result getResult(I iface, updateLecturedata_args args) throws org.apache.thrift.TException { + updateLecturedata_result result = new updateLecturedata_result(); + result.success = iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, args.id); + result.setSuccessIsSet(true); + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -1283,6 +1420,7 @@ public class Server { processMap.put("getImageData", new getImageData()); processMap.put("updateImageData", new updateImageData()); processMap.put("getLectureData", new getLectureData()); + processMap.put("updateLecturedata", new updateLecturedata()); return processMap; } @@ -1954,6 +2092,58 @@ public class Server { } } + public static class updateLecturedata<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, updateLecturedata_args, Boolean> { + public updateLecturedata() { + super("updateLecturedata"); + } + + public updateLecturedata_args getEmptyArgsInstance() { + return new updateLecturedata_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) { + updateLecturedata_result result = new updateLecturedata_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; + updateLecturedata_result result = new updateLecturedata_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, updateLecturedata_args args, org.apache.thrift.async.AsyncMethodCallback<Boolean> resultHandler) throws TException { + iface.updateLecturedata(args.name, args.newName, args.shortdesc, args.desc, args.startDate, args.endDate, args.isActive, args.imagename, args.firstname, args.lastname, args.university, args.Mail, args.Tel, args.Fak, 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> { @@ -14304,4 +14494,2110 @@ public class Server { } + 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"); + + private static final org.apache.thrift.protocol.TField NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("name", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField NEW_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("newName", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField SHORTDESC_FIELD_DESC = new org.apache.thrift.protocol.TField("shortdesc", org.apache.thrift.protocol.TType.STRING, (short)-3); + private static final org.apache.thrift.protocol.TField DESC_FIELD_DESC = new org.apache.thrift.protocol.TField("desc", org.apache.thrift.protocol.TType.STRING, (short)-4); + private static final org.apache.thrift.protocol.TField START_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("startDate", org.apache.thrift.protocol.TType.STRING, (short)-5); + private static final org.apache.thrift.protocol.TField END_DATE_FIELD_DESC = new org.apache.thrift.protocol.TField("endDate", org.apache.thrift.protocol.TType.STRING, (short)-6); + private static final org.apache.thrift.protocol.TField IS_ACTIVE_FIELD_DESC = new org.apache.thrift.protocol.TField("isActive", org.apache.thrift.protocol.TType.BOOL, (short)-7); + private static final org.apache.thrift.protocol.TField IMAGENAME_FIELD_DESC = new org.apache.thrift.protocol.TField("imagename", org.apache.thrift.protocol.TType.STRING, (short)-8); + private static final org.apache.thrift.protocol.TField FIRSTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("firstname", org.apache.thrift.protocol.TType.STRING, (short)-9); + private static final org.apache.thrift.protocol.TField LASTNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("lastname", org.apache.thrift.protocol.TType.STRING, (short)-10); + private static final org.apache.thrift.protocol.TField UNIVERSITY_FIELD_DESC = new org.apache.thrift.protocol.TField("university", org.apache.thrift.protocol.TType.STRING, (short)-11); + private static final org.apache.thrift.protocol.TField MAIL_FIELD_DESC = new org.apache.thrift.protocol.TField("Mail", org.apache.thrift.protocol.TType.STRING, (short)-12); + private static final org.apache.thrift.protocol.TField TEL_FIELD_DESC = new org.apache.thrift.protocol.TField("Tel", org.apache.thrift.protocol.TType.STRING, (short)-13); + private static final org.apache.thrift.protocol.TField FAK_FIELD_DESC = new org.apache.thrift.protocol.TField("Fak", org.apache.thrift.protocol.TType.STRING, (short)-14); + 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)-15); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new updateLecturedata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateLecturedata_argsTupleSchemeFactory()); + } + + public String name; // required + public String newName; // required + public String shortdesc; // required + public String desc; // required + public String startDate; // required + public String endDate; // required + public boolean isActive; // required + public String imagename; // required + public String firstname; // required + public String lastname; // required + public String university; // required + public String Mail; // required + public String Tel; // required + public String Fak; // required + 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 { + NAME((short)-1, "name"), + NEW_NAME((short)-2, "newName"), + SHORTDESC((short)-3, "shortdesc"), + DESC((short)-4, "desc"), + START_DATE((short)-5, "startDate"), + END_DATE((short)-6, "endDate"), + IS_ACTIVE((short)-7, "isActive"), + IMAGENAME((short)-8, "imagename"), + FIRSTNAME((short)-9, "firstname"), + LASTNAME((short)-10, "lastname"), + UNIVERSITY((short)-11, "university"), + MAIL((short)-12, "Mail"), + TEL((short)-13, "Tel"), + FAK((short)-14, "Fak"), + ID((short)-15, "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: // NAME + return NAME; + case -2: // NEW_NAME + return NEW_NAME; + case -3: // SHORTDESC + return SHORTDESC; + case -4: // DESC + return DESC; + case -5: // START_DATE + return START_DATE; + case -6: // END_DATE + return END_DATE; + case -7: // IS_ACTIVE + return IS_ACTIVE; + case -8: // IMAGENAME + return IMAGENAME; + case -9: // FIRSTNAME + return FIRSTNAME; + case -10: // LASTNAME + return LASTNAME; + case -11: // UNIVERSITY + return UNIVERSITY; + case -12: // MAIL + return MAIL; + case -13: // TEL + return TEL; + case -14: // FAK + return FAK; + case -15: // 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 + private static final int __ISACTIVE_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.NAME, new org.apache.thrift.meta_data.FieldMetaData("name", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NEW_NAME, new org.apache.thrift.meta_data.FieldMetaData("newName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.SHORTDESC, new org.apache.thrift.meta_data.FieldMetaData("shortdesc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DESC, new org.apache.thrift.meta_data.FieldMetaData("desc", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.START_DATE, new org.apache.thrift.meta_data.FieldMetaData("startDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.END_DATE, new org.apache.thrift.meta_data.FieldMetaData("endDate", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.IS_ACTIVE, new org.apache.thrift.meta_data.FieldMetaData("isActive", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.IMAGENAME, new org.apache.thrift.meta_data.FieldMetaData("imagename", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FIRSTNAME, new org.apache.thrift.meta_data.FieldMetaData("firstname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.LASTNAME, new org.apache.thrift.meta_data.FieldMetaData("lastname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.UNIVERSITY, new org.apache.thrift.meta_data.FieldMetaData("university", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.MAIL, new org.apache.thrift.meta_data.FieldMetaData("Mail", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.TEL, new org.apache.thrift.meta_data.FieldMetaData("Tel", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FAK, new org.apache.thrift.meta_data.FieldMetaData("Fak", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + 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(updateLecturedata_args.class, metaDataMap); + } + + public updateLecturedata_args() { + } + + public updateLecturedata_args( + 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) + { + this(); + this.name = name; + this.newName = newName; + this.shortdesc = shortdesc; + this.desc = desc; + this.startDate = startDate; + this.endDate = endDate; + this.isActive = isActive; + setIsActiveIsSet(true); + this.imagename = imagename; + this.firstname = firstname; + this.lastname = lastname; + this.university = university; + this.Mail = Mail; + this.Tel = Tel; + this.Fak = Fak; + this.id = id; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public updateLecturedata_args(updateLecturedata_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetName()) { + this.name = other.name; + } + if (other.isSetNewName()) { + this.newName = other.newName; + } + if (other.isSetShortdesc()) { + this.shortdesc = other.shortdesc; + } + if (other.isSetDesc()) { + this.desc = other.desc; + } + if (other.isSetStartDate()) { + this.startDate = other.startDate; + } + if (other.isSetEndDate()) { + this.endDate = other.endDate; + } + this.isActive = other.isActive; + if (other.isSetImagename()) { + this.imagename = other.imagename; + } + if (other.isSetFirstname()) { + this.firstname = other.firstname; + } + if (other.isSetLastname()) { + this.lastname = other.lastname; + } + if (other.isSetUniversity()) { + this.university = other.university; + } + if (other.isSetMail()) { + this.Mail = other.Mail; + } + if (other.isSetTel()) { + this.Tel = other.Tel; + } + if (other.isSetFak()) { + this.Fak = other.Fak; + } + if (other.isSetId()) { + this.id = other.id; + } + } + + public updateLecturedata_args deepCopy() { + return new updateLecturedata_args(this); + } + + @Override + public void clear() { + this.name = null; + this.newName = null; + this.shortdesc = null; + this.desc = null; + this.startDate = null; + this.endDate = null; + setIsActiveIsSet(false); + this.isActive = false; + this.imagename = null; + this.firstname = null; + this.lastname = null; + this.university = null; + this.Mail = null; + this.Tel = null; + this.Fak = null; + this.id = null; + } + + public String getName() { + return this.name; + } + + public updateLecturedata_args setName(String name) { + this.name = name; + return this; + } + + public void unsetName() { + this.name = null; + } + + /** Returns true if field name is set (has been assigned a value) and false otherwise */ + public boolean isSetName() { + return this.name != null; + } + + public void setNameIsSet(boolean value) { + if (!value) { + this.name = null; + } + } + + public String getNewName() { + return this.newName; + } + + public updateLecturedata_args setNewName(String newName) { + this.newName = newName; + return this; + } + + public void unsetNewName() { + this.newName = null; + } + + /** Returns true if field newName is set (has been assigned a value) and false otherwise */ + public boolean isSetNewName() { + return this.newName != null; + } + + public void setNewNameIsSet(boolean value) { + if (!value) { + this.newName = null; + } + } + + public String getShortdesc() { + return this.shortdesc; + } + + public updateLecturedata_args setShortdesc(String shortdesc) { + this.shortdesc = shortdesc; + return this; + } + + public void unsetShortdesc() { + this.shortdesc = null; + } + + /** Returns true if field shortdesc is set (has been assigned a value) and false otherwise */ + public boolean isSetShortdesc() { + return this.shortdesc != null; + } + + public void setShortdescIsSet(boolean value) { + if (!value) { + this.shortdesc = null; + } + } + + public String getDesc() { + return this.desc; + } + + public updateLecturedata_args setDesc(String desc) { + this.desc = desc; + return this; + } + + public void unsetDesc() { + this.desc = null; + } + + /** Returns true if field desc is set (has been assigned a value) and false otherwise */ + public boolean isSetDesc() { + return this.desc != null; + } + + public void setDescIsSet(boolean value) { + if (!value) { + this.desc = null; + } + } + + public String getStartDate() { + return this.startDate; + } + + public updateLecturedata_args setStartDate(String startDate) { + this.startDate = startDate; + return this; + } + + public void unsetStartDate() { + this.startDate = null; + } + + /** Returns true if field startDate is set (has been assigned a value) and false otherwise */ + public boolean isSetStartDate() { + return this.startDate != null; + } + + public void setStartDateIsSet(boolean value) { + if (!value) { + this.startDate = null; + } + } + + public String getEndDate() { + return this.endDate; + } + + public updateLecturedata_args setEndDate(String endDate) { + this.endDate = endDate; + return this; + } + + public void unsetEndDate() { + this.endDate = null; + } + + /** Returns true if field endDate is set (has been assigned a value) and false otherwise */ + public boolean isSetEndDate() { + return this.endDate != null; + } + + public void setEndDateIsSet(boolean value) { + if (!value) { + this.endDate = null; + } + } + + public boolean isIsActive() { + return this.isActive; + } + + public updateLecturedata_args setIsActive(boolean isActive) { + this.isActive = isActive; + setIsActiveIsSet(true); + return this; + } + + public void unsetIsActive() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + /** Returns true if field isActive is set (has been assigned a value) and false otherwise */ + public boolean isSetIsActive() { + return EncodingUtils.testBit(__isset_bitfield, __ISACTIVE_ISSET_ID); + } + + public void setIsActiveIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ISACTIVE_ISSET_ID, value); + } + + public String getImagename() { + return this.imagename; + } + + public updateLecturedata_args setImagename(String imagename) { + this.imagename = imagename; + return this; + } + + public void unsetImagename() { + this.imagename = null; + } + + /** Returns true if field imagename is set (has been assigned a value) and false otherwise */ + public boolean isSetImagename() { + return this.imagename != null; + } + + public void setImagenameIsSet(boolean value) { + if (!value) { + this.imagename = null; + } + } + + public String getFirstname() { + return this.firstname; + } + + public updateLecturedata_args setFirstname(String firstname) { + this.firstname = firstname; + return this; + } + + public void unsetFirstname() { + this.firstname = null; + } + + /** Returns true if field firstname is set (has been assigned a value) and false otherwise */ + public boolean isSetFirstname() { + return this.firstname != null; + } + + public void setFirstnameIsSet(boolean value) { + if (!value) { + this.firstname = null; + } + } + + public String getLastname() { + return this.lastname; + } + + public updateLecturedata_args setLastname(String lastname) { + this.lastname = lastname; + return this; + } + + public void unsetLastname() { + this.lastname = null; + } + + /** Returns true if field lastname is set (has been assigned a value) and false otherwise */ + public boolean isSetLastname() { + return this.lastname != null; + } + + public void setLastnameIsSet(boolean value) { + if (!value) { + this.lastname = null; + } + } + + public String getUniversity() { + return this.university; + } + + public updateLecturedata_args setUniversity(String university) { + this.university = university; + return this; + } + + public void unsetUniversity() { + this.university = null; + } + + /** Returns true if field university is set (has been assigned a value) and false otherwise */ + public boolean isSetUniversity() { + return this.university != null; + } + + public void setUniversityIsSet(boolean value) { + if (!value) { + this.university = null; + } + } + + public String getMail() { + return this.Mail; + } + + public updateLecturedata_args setMail(String Mail) { + this.Mail = Mail; + return this; + } + + public void unsetMail() { + this.Mail = null; + } + + /** Returns true if field Mail is set (has been assigned a value) and false otherwise */ + public boolean isSetMail() { + return this.Mail != null; + } + + public void setMailIsSet(boolean value) { + if (!value) { + this.Mail = null; + } + } + + public String getTel() { + return this.Tel; + } + + public updateLecturedata_args setTel(String Tel) { + this.Tel = Tel; + return this; + } + + public void unsetTel() { + this.Tel = null; + } + + /** Returns true if field Tel is set (has been assigned a value) and false otherwise */ + public boolean isSetTel() { + return this.Tel != null; + } + + public void setTelIsSet(boolean value) { + if (!value) { + this.Tel = null; + } + } + + public String getFak() { + return this.Fak; + } + + public updateLecturedata_args setFak(String Fak) { + this.Fak = Fak; + return this; + } + + public void unsetFak() { + this.Fak = null; + } + + /** Returns true if field Fak is set (has been assigned a value) and false otherwise */ + public boolean isSetFak() { + return this.Fak != null; + } + + public void setFakIsSet(boolean value) { + if (!value) { + this.Fak = null; + } + } + + public String getId() { + return this.id; + } + + public updateLecturedata_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 NAME: + if (value == null) { + unsetName(); + } else { + setName((String)value); + } + break; + + case NEW_NAME: + if (value == null) { + unsetNewName(); + } else { + setNewName((String)value); + } + break; + + case SHORTDESC: + if (value == null) { + unsetShortdesc(); + } else { + setShortdesc((String)value); + } + break; + + case DESC: + if (value == null) { + unsetDesc(); + } else { + setDesc((String)value); + } + break; + + case START_DATE: + if (value == null) { + unsetStartDate(); + } else { + setStartDate((String)value); + } + break; + + case END_DATE: + if (value == null) { + unsetEndDate(); + } else { + setEndDate((String)value); + } + break; + + case IS_ACTIVE: + if (value == null) { + unsetIsActive(); + } else { + setIsActive((Boolean)value); + } + break; + + case IMAGENAME: + if (value == null) { + unsetImagename(); + } else { + setImagename((String)value); + } + break; + + case FIRSTNAME: + if (value == null) { + unsetFirstname(); + } else { + setFirstname((String)value); + } + break; + + case LASTNAME: + if (value == null) { + unsetLastname(); + } else { + setLastname((String)value); + } + break; + + case UNIVERSITY: + if (value == null) { + unsetUniversity(); + } else { + setUniversity((String)value); + } + break; + + case MAIL: + if (value == null) { + unsetMail(); + } else { + setMail((String)value); + } + break; + + case TEL: + if (value == null) { + unsetTel(); + } else { + setTel((String)value); + } + break; + + case FAK: + if (value == null) { + unsetFak(); + } else { + setFak((String)value); + } + break; + + case ID: + if (value == null) { + unsetId(); + } else { + setId((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case NAME: + return getName(); + + case NEW_NAME: + return getNewName(); + + case SHORTDESC: + return getShortdesc(); + + case DESC: + return getDesc(); + + case START_DATE: + return getStartDate(); + + case END_DATE: + return getEndDate(); + + case IS_ACTIVE: + return Boolean.valueOf(isIsActive()); + + case IMAGENAME: + return getImagename(); + + case FIRSTNAME: + return getFirstname(); + + case LASTNAME: + return getLastname(); + + case UNIVERSITY: + return getUniversity(); + + case MAIL: + return getMail(); + + case TEL: + return getTel(); + + case FAK: + return getFak(); + + 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 NAME: + return isSetName(); + case NEW_NAME: + return isSetNewName(); + case SHORTDESC: + return isSetShortdesc(); + case DESC: + return isSetDesc(); + case START_DATE: + return isSetStartDate(); + case END_DATE: + return isSetEndDate(); + case IS_ACTIVE: + return isSetIsActive(); + case IMAGENAME: + return isSetImagename(); + case FIRSTNAME: + return isSetFirstname(); + case LASTNAME: + return isSetLastname(); + case UNIVERSITY: + return isSetUniversity(); + case MAIL: + return isSetMail(); + case TEL: + return isSetTel(); + case FAK: + return isSetFak(); + case ID: + return isSetId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof updateLecturedata_args) + return this.equals((updateLecturedata_args)that); + return false; + } + + public boolean equals(updateLecturedata_args that) { + if (that == null) + return false; + + boolean this_present_name = true && this.isSetName(); + boolean that_present_name = true && that.isSetName(); + if (this_present_name || that_present_name) { + if (!(this_present_name && that_present_name)) + return false; + if (!this.name.equals(that.name)) + return false; + } + + boolean this_present_newName = true && this.isSetNewName(); + boolean that_present_newName = true && that.isSetNewName(); + if (this_present_newName || that_present_newName) { + if (!(this_present_newName && that_present_newName)) + return false; + if (!this.newName.equals(that.newName)) + return false; + } + + boolean this_present_shortdesc = true && this.isSetShortdesc(); + boolean that_present_shortdesc = true && that.isSetShortdesc(); + if (this_present_shortdesc || that_present_shortdesc) { + if (!(this_present_shortdesc && that_present_shortdesc)) + return false; + if (!this.shortdesc.equals(that.shortdesc)) + return false; + } + + boolean this_present_desc = true && this.isSetDesc(); + boolean that_present_desc = true && that.isSetDesc(); + if (this_present_desc || that_present_desc) { + if (!(this_present_desc && that_present_desc)) + return false; + if (!this.desc.equals(that.desc)) + return false; + } + + boolean this_present_startDate = true && this.isSetStartDate(); + boolean that_present_startDate = true && that.isSetStartDate(); + if (this_present_startDate || that_present_startDate) { + if (!(this_present_startDate && that_present_startDate)) + return false; + if (!this.startDate.equals(that.startDate)) + return false; + } + + boolean this_present_endDate = true && this.isSetEndDate(); + boolean that_present_endDate = true && that.isSetEndDate(); + if (this_present_endDate || that_present_endDate) { + if (!(this_present_endDate && that_present_endDate)) + return false; + if (!this.endDate.equals(that.endDate)) + return false; + } + + boolean this_present_isActive = true; + boolean that_present_isActive = true; + if (this_present_isActive || that_present_isActive) { + if (!(this_present_isActive && that_present_isActive)) + return false; + if (this.isActive != that.isActive) + return false; + } + + boolean this_present_imagename = true && this.isSetImagename(); + boolean that_present_imagename = true && that.isSetImagename(); + if (this_present_imagename || that_present_imagename) { + if (!(this_present_imagename && that_present_imagename)) + return false; + if (!this.imagename.equals(that.imagename)) + return false; + } + + boolean this_present_firstname = true && this.isSetFirstname(); + boolean that_present_firstname = true && that.isSetFirstname(); + if (this_present_firstname || that_present_firstname) { + if (!(this_present_firstname && that_present_firstname)) + return false; + if (!this.firstname.equals(that.firstname)) + return false; + } + + boolean this_present_lastname = true && this.isSetLastname(); + boolean that_present_lastname = true && that.isSetLastname(); + if (this_present_lastname || that_present_lastname) { + if (!(this_present_lastname && that_present_lastname)) + return false; + if (!this.lastname.equals(that.lastname)) + return false; + } + + boolean this_present_university = true && this.isSetUniversity(); + boolean that_present_university = true && that.isSetUniversity(); + if (this_present_university || that_present_university) { + if (!(this_present_university && that_present_university)) + return false; + if (!this.university.equals(that.university)) + return false; + } + + boolean this_present_Mail = true && this.isSetMail(); + boolean that_present_Mail = true && that.isSetMail(); + if (this_present_Mail || that_present_Mail) { + if (!(this_present_Mail && that_present_Mail)) + return false; + if (!this.Mail.equals(that.Mail)) + return false; + } + + boolean this_present_Tel = true && this.isSetTel(); + boolean that_present_Tel = true && that.isSetTel(); + if (this_present_Tel || that_present_Tel) { + if (!(this_present_Tel && that_present_Tel)) + return false; + if (!this.Tel.equals(that.Tel)) + return false; + } + + boolean this_present_Fak = true && this.isSetFak(); + boolean that_present_Fak = true && that.isSetFak(); + if (this_present_Fak || that_present_Fak) { + if (!(this_present_Fak && that_present_Fak)) + return false; + if (!this.Fak.equals(that.Fak)) + 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(updateLecturedata_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetName()).compareTo(other.isSetName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.name, other.name); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNewName()).compareTo(other.isSetNewName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNewName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.newName, other.newName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetShortdesc()).compareTo(other.isSetShortdesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetShortdesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.shortdesc, other.shortdesc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDesc()).compareTo(other.isSetDesc()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDesc()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.desc, other.desc); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetStartDate()).compareTo(other.isSetStartDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetStartDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.startDate, other.startDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEndDate()).compareTo(other.isSetEndDate()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEndDate()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.endDate, other.endDate); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetIsActive()).compareTo(other.isSetIsActive()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetIsActive()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.isActive, other.isActive); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetImagename()).compareTo(other.isSetImagename()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetImagename()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.imagename, other.imagename); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFirstname()).compareTo(other.isSetFirstname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFirstname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.firstname, other.firstname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetLastname()).compareTo(other.isSetLastname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetLastname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.lastname, other.lastname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetUniversity()).compareTo(other.isSetUniversity()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUniversity()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.university, other.university); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetMail()).compareTo(other.isSetMail()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMail()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Mail, other.Mail); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetTel()).compareTo(other.isSetTel()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetTel()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Tel, other.Tel); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFak()).compareTo(other.isSetFak()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFak()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Fak, other.Fak); + if (lastComparison != 0) { + return lastComparison; + } + } + 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("updateLecturedata_args("); + boolean first = true; + + sb.append("name:"); + if (this.name == null) { + sb.append("null"); + } else { + sb.append(this.name); + } + first = false; + if (!first) sb.append(", "); + sb.append("newName:"); + if (this.newName == null) { + sb.append("null"); + } else { + sb.append(this.newName); + } + first = false; + if (!first) sb.append(", "); + sb.append("shortdesc:"); + if (this.shortdesc == null) { + sb.append("null"); + } else { + sb.append(this.shortdesc); + } + first = false; + if (!first) sb.append(", "); + sb.append("desc:"); + if (this.desc == null) { + sb.append("null"); + } else { + sb.append(this.desc); + } + first = false; + if (!first) sb.append(", "); + sb.append("startDate:"); + if (this.startDate == null) { + sb.append("null"); + } else { + sb.append(this.startDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("endDate:"); + if (this.endDate == null) { + sb.append("null"); + } else { + sb.append(this.endDate); + } + first = false; + if (!first) sb.append(", "); + sb.append("isActive:"); + sb.append(this.isActive); + first = false; + if (!first) sb.append(", "); + sb.append("imagename:"); + if (this.imagename == null) { + sb.append("null"); + } else { + sb.append(this.imagename); + } + first = false; + if (!first) sb.append(", "); + sb.append("firstname:"); + if (this.firstname == null) { + sb.append("null"); + } else { + sb.append(this.firstname); + } + first = false; + if (!first) sb.append(", "); + sb.append("lastname:"); + if (this.lastname == null) { + sb.append("null"); + } else { + sb.append(this.lastname); + } + first = false; + if (!first) sb.append(", "); + sb.append("university:"); + if (this.university == null) { + sb.append("null"); + } else { + sb.append(this.university); + } + first = false; + if (!first) sb.append(", "); + sb.append("Mail:"); + if (this.Mail == null) { + sb.append("null"); + } else { + sb.append(this.Mail); + } + first = false; + if (!first) sb.append(", "); + sb.append("Tel:"); + if (this.Tel == null) { + sb.append("null"); + } else { + sb.append(this.Tel); + } + first = false; + if (!first) sb.append(", "); + sb.append("Fak:"); + if (this.Fak == null) { + sb.append("null"); + } else { + sb.append(this.Fak); + } + first = false; + if (!first) sb.append(", "); + 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 { + // 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 updateLecturedata_argsStandardSchemeFactory implements SchemeFactory { + public updateLecturedata_argsStandardScheme getScheme() { + return new updateLecturedata_argsStandardScheme(); + } + } + + private static class updateLecturedata_argsStandardScheme extends StandardScheme<updateLecturedata_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_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: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // NEW_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // SHORTDESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -4: // DESC + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -5: // START_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -6: // END_DATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -7: // IS_ACTIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -8: // IMAGENAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -9: // FIRSTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -10: // LASTNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -11: // UNIVERSITY + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -12: // MAIL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -13: // TEL + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -14: // FAK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -15: // 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, updateLecturedata_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(); + } + if (struct.Fak != null) { + oprot.writeFieldBegin(FAK_FIELD_DESC); + oprot.writeString(struct.Fak); + oprot.writeFieldEnd(); + } + if (struct.Tel != null) { + oprot.writeFieldBegin(TEL_FIELD_DESC); + oprot.writeString(struct.Tel); + oprot.writeFieldEnd(); + } + if (struct.Mail != null) { + oprot.writeFieldBegin(MAIL_FIELD_DESC); + oprot.writeString(struct.Mail); + oprot.writeFieldEnd(); + } + if (struct.university != null) { + oprot.writeFieldBegin(UNIVERSITY_FIELD_DESC); + oprot.writeString(struct.university); + oprot.writeFieldEnd(); + } + if (struct.lastname != null) { + oprot.writeFieldBegin(LASTNAME_FIELD_DESC); + oprot.writeString(struct.lastname); + oprot.writeFieldEnd(); + } + if (struct.firstname != null) { + oprot.writeFieldBegin(FIRSTNAME_FIELD_DESC); + oprot.writeString(struct.firstname); + oprot.writeFieldEnd(); + } + if (struct.imagename != null) { + oprot.writeFieldBegin(IMAGENAME_FIELD_DESC); + oprot.writeString(struct.imagename); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(IS_ACTIVE_FIELD_DESC); + oprot.writeBool(struct.isActive); + oprot.writeFieldEnd(); + if (struct.endDate != null) { + oprot.writeFieldBegin(END_DATE_FIELD_DESC); + oprot.writeString(struct.endDate); + oprot.writeFieldEnd(); + } + if (struct.startDate != null) { + oprot.writeFieldBegin(START_DATE_FIELD_DESC); + oprot.writeString(struct.startDate); + oprot.writeFieldEnd(); + } + if (struct.desc != null) { + oprot.writeFieldBegin(DESC_FIELD_DESC); + oprot.writeString(struct.desc); + oprot.writeFieldEnd(); + } + if (struct.shortdesc != null) { + oprot.writeFieldBegin(SHORTDESC_FIELD_DESC); + oprot.writeString(struct.shortdesc); + oprot.writeFieldEnd(); + } + if (struct.newName != null) { + oprot.writeFieldBegin(NEW_NAME_FIELD_DESC); + oprot.writeString(struct.newName); + oprot.writeFieldEnd(); + } + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class updateLecturedata_argsTupleSchemeFactory implements SchemeFactory { + public updateLecturedata_argsTupleScheme getScheme() { + return new updateLecturedata_argsTupleScheme(); + } + } + + private static class updateLecturedata_argsTupleScheme extends TupleScheme<updateLecturedata_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetName()) { + optionals.set(0); + } + if (struct.isSetNewName()) { + optionals.set(1); + } + if (struct.isSetShortdesc()) { + optionals.set(2); + } + if (struct.isSetDesc()) { + optionals.set(3); + } + if (struct.isSetStartDate()) { + optionals.set(4); + } + if (struct.isSetEndDate()) { + optionals.set(5); + } + if (struct.isSetIsActive()) { + optionals.set(6); + } + if (struct.isSetImagename()) { + optionals.set(7); + } + if (struct.isSetFirstname()) { + optionals.set(8); + } + if (struct.isSetLastname()) { + optionals.set(9); + } + if (struct.isSetUniversity()) { + optionals.set(10); + } + if (struct.isSetMail()) { + optionals.set(11); + } + if (struct.isSetTel()) { + optionals.set(12); + } + if (struct.isSetFak()) { + optionals.set(13); + } + if (struct.isSetId()) { + optionals.set(14); + } + oprot.writeBitSet(optionals, 15); + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetNewName()) { + oprot.writeString(struct.newName); + } + if (struct.isSetShortdesc()) { + oprot.writeString(struct.shortdesc); + } + if (struct.isSetDesc()) { + oprot.writeString(struct.desc); + } + if (struct.isSetStartDate()) { + oprot.writeString(struct.startDate); + } + if (struct.isSetEndDate()) { + oprot.writeString(struct.endDate); + } + if (struct.isSetIsActive()) { + oprot.writeBool(struct.isActive); + } + if (struct.isSetImagename()) { + oprot.writeString(struct.imagename); + } + if (struct.isSetFirstname()) { + oprot.writeString(struct.firstname); + } + if (struct.isSetLastname()) { + oprot.writeString(struct.lastname); + } + if (struct.isSetUniversity()) { + oprot.writeString(struct.university); + } + if (struct.isSetMail()) { + oprot.writeString(struct.Mail); + } + if (struct.isSetTel()) { + oprot.writeString(struct.Tel); + } + if (struct.isSetFak()) { + oprot.writeString(struct.Fak); + } + if (struct.isSetId()) { + oprot.writeString(struct.id); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(15); + if (incoming.get(0)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(1)) { + struct.newName = iprot.readString(); + struct.setNewNameIsSet(true); + } + if (incoming.get(2)) { + struct.shortdesc = iprot.readString(); + struct.setShortdescIsSet(true); + } + if (incoming.get(3)) { + struct.desc = iprot.readString(); + struct.setDescIsSet(true); + } + if (incoming.get(4)) { + struct.startDate = iprot.readString(); + struct.setStartDateIsSet(true); + } + if (incoming.get(5)) { + struct.endDate = iprot.readString(); + struct.setEndDateIsSet(true); + } + if (incoming.get(6)) { + struct.isActive = iprot.readBool(); + struct.setIsActiveIsSet(true); + } + if (incoming.get(7)) { + struct.imagename = iprot.readString(); + struct.setImagenameIsSet(true); + } + if (incoming.get(8)) { + struct.firstname = iprot.readString(); + struct.setFirstnameIsSet(true); + } + if (incoming.get(9)) { + struct.lastname = iprot.readString(); + struct.setLastnameIsSet(true); + } + if (incoming.get(10)) { + struct.university = iprot.readString(); + struct.setUniversityIsSet(true); + } + if (incoming.get(11)) { + struct.Mail = iprot.readString(); + struct.setMailIsSet(true); + } + if (incoming.get(12)) { + struct.Tel = iprot.readString(); + struct.setTelIsSet(true); + } + if (incoming.get(13)) { + struct.Fak = iprot.readString(); + struct.setFakIsSet(true); + } + if (incoming.get(14)) { + struct.id = iprot.readString(); + struct.setIdIsSet(true); + } + } + } + + } + + public static class updateLecturedata_result implements org.apache.thrift.TBase<updateLecturedata_result, updateLecturedata_result._Fields>, java.io.Serializable, Cloneable, Comparable<updateLecturedata_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("updateLecturedata_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 updateLecturedata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new updateLecturedata_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(updateLecturedata_result.class, metaDataMap); + } + + public updateLecturedata_result() { + } + + public updateLecturedata_result( + boolean success) + { + this(); + this.success = success; + setSuccessIsSet(true); + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public updateLecturedata_result(updateLecturedata_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + } + + public updateLecturedata_result deepCopy() { + return new updateLecturedata_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + } + + public boolean isSuccess() { + return this.success; + } + + public updateLecturedata_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 updateLecturedata_result) + return this.equals((updateLecturedata_result)that); + return false; + } + + public boolean equals(updateLecturedata_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(updateLecturedata_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("updateLecturedata_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 updateLecturedata_resultStandardSchemeFactory implements SchemeFactory { + public updateLecturedata_resultStandardScheme getScheme() { + return new updateLecturedata_resultStandardScheme(); + } + } + + private static class updateLecturedata_resultStandardScheme extends StandardScheme<updateLecturedata_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, updateLecturedata_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, updateLecturedata_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 updateLecturedata_resultTupleSchemeFactory implements SchemeFactory { + public updateLecturedata_resultTupleScheme getScheme() { + return new updateLecturedata_resultTupleScheme(); + } + } + + private static class updateLecturedata_resultTupleScheme extends TupleScheme<updateLecturedata_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, updateLecturedata_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, updateLecturedata_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 681a9a7c..c7ab500b 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -304,4 +304,15 @@ public class ServerHandler implements Server.Iface { 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 { + // TODO Auto-generated method stub + return false; + } + } diff --git a/Dozentenmodulserver/src/server/User.java b/Dozentenmodulserver/src/server/User.java index 5861a6e0..7bf98cc4 100644 --- a/Dozentenmodulserver/src/server/User.java +++ b/Dozentenmodulserver/src/server/User.java @@ -32,607 +32,557 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class User implements org.apache.thrift.TBase<User, User._Fields>, - java.io.Serializable, Cloneable, Comparable<User> { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( - "User"); - - private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField( - "userName", org.apache.thrift.protocol.TType.STRING, (short) -1); - private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField( - "password", org.apache.thrift.protocol.TType.STRING, (short) -2); - private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField( - "path", org.apache.thrift.protocol.TType.STRING, (short) -3); - - private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); - static { - schemes.put(StandardScheme.class, new UserStandardSchemeFactory()); - schemes.put(TupleScheme.class, new UserTupleSchemeFactory()); - } - - public String userName; // required - public String password; // required - public String path; // required - - /** - * The set of fields this struct contains, along with convenience methods - * for finding and manipulating them. - */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - USER_NAME((short) -1, "userName"), PASSWORD((short) -2, "password"), PATH( - (short) -3, "path"); - - private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not - * found. - */ - public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { - case -1: // USER_NAME - return USER_NAME; - case -2: // PASSWORD - return PASSWORD; - case -3: // PATH - return PATH; - default: - return null; - } - } - - /** - * Find the _Fields constant that matches fieldId, throwing an exception - * if it is not found. - */ - public static _Fields findByThriftIdOrThrow(int fieldId) { - _Fields fields = findByThriftId(fieldId); - if (fields == null) - throw new IllegalArgumentException("Field " + fieldId - + " doesn't exist!"); - return fields; - } - - /** - * Find the _Fields constant that matches name, or null if its not - * found. - */ - public static _Fields findByName(String name) { - return byName.get(name); - } - - private final short _thriftId; - private final String _fieldName; - - _Fields(short thriftId, String fieldName) { - _thriftId = thriftId; - _fieldName = fieldName; - } - - public short getThriftFieldId() { - return _thriftId; - } - - public String getFieldName() { - return _fieldName; - } - } - - // isset id assignments - public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; - static { - Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>( - _Fields.class); - tmpMap.put(_Fields.USER_NAME, - new org.apache.thrift.meta_data.FieldMetaData("userName", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PASSWORD, - new org.apache.thrift.meta_data.FieldMetaData("password", - org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData( - org.apache.thrift.protocol.TType.STRING))); - tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData( - "path", 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( - User.class, metaDataMap); - } - - public User() { - } - - public User(String userName, String password, String path) { - this(); - this.userName = userName; - this.password = password; - this.path = path; - } - - /** - * Performs a deep copy on <i>other</i>. - */ - public User(User other) { - if (other.isSetUserName()) { - this.userName = other.userName; - } - if (other.isSetPassword()) { - this.password = other.password; - } - if (other.isSetPath()) { - this.path = other.path; - } - } - - public User deepCopy() { - return new User(this); - } - - @Override - public void clear() { - this.userName = null; - this.password = null; - this.path = null; - } - - public String getUserName() { - return this.userName; - } - - public User setUserName(String userName) { - this.userName = userName; - return this; - } - - public void unsetUserName() { - this.userName = null; - } - - /** - * Returns true if field userName is set (has been assigned a value) and - * false otherwise - */ - public boolean isSetUserName() { - return this.userName != null; - } - - public void setUserNameIsSet(boolean value) { - if (!value) { - this.userName = null; - } - } - - public String getPassword() { - return this.password; - } - - public User setPassword(String password) { - this.password = password; - return this; - } - - public void unsetPassword() { - this.password = null; - } - - /** - * Returns true if field password is set (has been assigned a value) and - * false otherwise - */ - public boolean isSetPassword() { - return this.password != null; - } - - public void setPasswordIsSet(boolean value) { - if (!value) { - this.password = null; - } - } - - public String getPath() { - return this.path; - } - - public User setPath(String path) { - this.path = path; - return this; - } - - public void unsetPath() { - this.path = null; - } - - /** - * Returns true if field path is set (has been assigned a value) and false - * otherwise - */ - public boolean isSetPath() { - return this.path != null; - } - - public void setPathIsSet(boolean value) { - if (!value) { - this.path = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case USER_NAME: - if (value == null) { - unsetUserName(); - } else { - setUserName((String) value); - } - break; - - case PASSWORD: - if (value == null) { - unsetPassword(); - } else { - setPassword((String) value); - } - break; - - case PATH: - if (value == null) { - unsetPath(); - } else { - setPath((String) value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case USER_NAME: - return getUserName(); - - case PASSWORD: - return getPassword(); - - case PATH: - return getPath(); - - } - throw new IllegalStateException(); - } - - /** - * Returns true if field corresponding to fieldID is set (has been assigned - * a value) and false otherwise - */ - public boolean isSet(_Fields field) { - if (field == null) { - throw new IllegalArgumentException(); - } - - switch (field) { - case USER_NAME: - return isSetUserName(); - case PASSWORD: - return isSetPassword(); - case PATH: - return isSetPath(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof User) - return this.equals((User) that); - return false; - } - - public boolean equals(User that) { - if (that == null) - return false; - - boolean this_present_userName = true && this.isSetUserName(); - boolean that_present_userName = true && that.isSetUserName(); - if (this_present_userName || that_present_userName) { - if (!(this_present_userName && that_present_userName)) - return false; - if (!this.userName.equals(that.userName)) - return false; - } - - boolean this_present_password = true && this.isSetPassword(); - boolean that_present_password = true && that.isSetPassword(); - if (this_present_password || that_present_password) { - if (!(this_present_password && that_present_password)) - return false; - if (!this.password.equals(that.password)) - return false; - } - - boolean this_present_path = true && this.isSetPath(); - boolean that_present_path = true && that.isSetPath(); - if (this_present_path || that_present_path) { - if (!(this_present_path && that_present_path)) - return false; - if (!this.path.equals(that.path)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - @Override - public int compareTo(User other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - - lastComparison = Boolean.valueOf(isSetUserName()).compareTo( - other.isSetUserName()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetUserName()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo( - this.userName, other.userName); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPassword()).compareTo( - other.isSetPassword()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPassword()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo( - this.password, other.password); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetPath()).compareTo( - other.isSetPath()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetPath()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, - other.path); - 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("User("); - boolean first = true; - - sb.append("userName:"); - if (this.userName == null) { - sb.append("null"); - } else { - sb.append(this.userName); - } - first = false; - if (!first) - sb.append(", "); - sb.append("password:"); - if (this.password == null) { - sb.append("null"); - } else { - sb.append(this.password); - } - first = false; - if (!first) - sb.append(", "); - sb.append("path:"); - if (this.path == null) { - sb.append("null"); - } else { - sb.append(this.path); - } - 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 UserStandardSchemeFactory implements SchemeFactory { - public UserStandardScheme getScheme() { - return new UserStandardScheme(); - } - } - - private static class UserStandardScheme extends StandardScheme<User> { - - public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) - throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField schemeField; - iprot.readStructBegin(); - while (true) { - schemeField = iprot.readFieldBegin(); - if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (schemeField.id) { - case -1: // USER_NAME - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.userName = iprot.readString(); - struct.setUserNameIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, - schemeField.type); - } - break; - case -2: // PASSWORD - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, - schemeField.type); - } - break; - case -3: // PATH - if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { - struct.path = iprot.readString(); - struct.setPathIsSet(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, - User struct) throws org.apache.thrift.TException { - struct.validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (struct.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(struct.path); - oprot.writeFieldEnd(); - } - if (struct.password != null) { - oprot.writeFieldBegin(PASSWORD_FIELD_DESC); - oprot.writeString(struct.password); - oprot.writeFieldEnd(); - } - if (struct.userName != null) { - oprot.writeFieldBegin(USER_NAME_FIELD_DESC); - oprot.writeString(struct.userName); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - } - - private static class UserTupleSchemeFactory implements SchemeFactory { - public UserTupleScheme getScheme() { - return new UserTupleScheme(); - } - } - - private static class UserTupleScheme extends TupleScheme<User> { - - @Override - public void write(org.apache.thrift.protocol.TProtocol prot, User struct) - throws org.apache.thrift.TException { - TTupleProtocol oprot = (TTupleProtocol) prot; - BitSet optionals = new BitSet(); - if (struct.isSetUserName()) { - optionals.set(0); - } - if (struct.isSetPassword()) { - optionals.set(1); - } - if (struct.isSetPath()) { - optionals.set(2); - } - oprot.writeBitSet(optionals, 3); - if (struct.isSetUserName()) { - oprot.writeString(struct.userName); - } - if (struct.isSetPassword()) { - oprot.writeString(struct.password); - } - if (struct.isSetPath()) { - oprot.writeString(struct.path); - } - } - - @Override - public void read(org.apache.thrift.protocol.TProtocol prot, User struct) - throws org.apache.thrift.TException { - TTupleProtocol iprot = (TTupleProtocol) prot; - BitSet incoming = iprot.readBitSet(3); - if (incoming.get(0)) { - struct.userName = iprot.readString(); - struct.setUserNameIsSet(true); - } - if (incoming.get(1)) { - struct.password = iprot.readString(); - struct.setPasswordIsSet(true); - } - if (incoming.get(2)) { - struct.path = iprot.readString(); - struct.setPathIsSet(true); - } - } - } +public class User implements org.apache.thrift.TBase<User, User._Fields>, java.io.Serializable, Cloneable, Comparable<User> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("User"); + + private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)-1); + private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)-2); + private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)-3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new UserStandardSchemeFactory()); + schemes.put(TupleScheme.class, new UserTupleSchemeFactory()); + } + + public String userName; // required + public String password; // required + public String path; // required + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { + USER_NAME((short)-1, "userName"), + PASSWORD((short)-2, "password"), + PATH((short)-3, "path"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // USER_NAME + return USER_NAME; + case -2: // PASSWORD + return PASSWORD; + case -3: // PATH + return PATH; + default: + return null; + } + } + + /** + * Find the _Fields constant that matches fieldId, throwing an exception + * if it is not found. + */ + public static _Fields findByThriftIdOrThrow(int fieldId) { + _Fields fields = findByThriftId(fieldId); + if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!"); + return fields; + } + + /** + * Find the _Fields constant that matches name, or null if its not found. + */ + public static _Fields findByName(String name) { + return byName.get(name); + } + + private final short _thriftId; + private final String _fieldName; + + _Fields(short thriftId, String fieldName) { + _thriftId = thriftId; + _fieldName = fieldName; + } + + public short getThriftFieldId() { + return _thriftId; + } + + public String getFieldName() { + return _fieldName; + } + } + + // isset id assignments + public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap; + static { + Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class); + tmpMap.put(_Fields.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", 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(User.class, metaDataMap); + } + + public User() { + } + + public User( + String userName, + String password, + String path) + { + this(); + this.userName = userName; + this.password = password; + this.path = path; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public User(User other) { + if (other.isSetUserName()) { + this.userName = other.userName; + } + if (other.isSetPassword()) { + this.password = other.password; + } + if (other.isSetPath()) { + this.path = other.path; + } + } + + public User deepCopy() { + return new User(this); + } + + @Override + public void clear() { + this.userName = null; + this.password = null; + this.path = null; + } + + public String getUserName() { + return this.userName; + } + + public User setUserName(String userName) { + this.userName = userName; + return this; + } + + public void unsetUserName() { + this.userName = null; + } + + /** Returns true if field userName is set (has been assigned a value) and false otherwise */ + public boolean isSetUserName() { + return this.userName != null; + } + + public void setUserNameIsSet(boolean value) { + if (!value) { + this.userName = null; + } + } + + public String getPassword() { + return this.password; + } + + public User setPassword(String password) { + this.password = password; + return this; + } + + public void unsetPassword() { + this.password = null; + } + + /** Returns true if field password is set (has been assigned a value) and false otherwise */ + public boolean isSetPassword() { + return this.password != null; + } + + public void setPasswordIsSet(boolean value) { + if (!value) { + this.password = null; + } + } + + public String getPath() { + return this.path; + } + + public User setPath(String path) { + this.path = path; + return this; + } + + public void unsetPath() { + this.path = null; + } + + /** Returns true if field path is set (has been assigned a value) and false otherwise */ + public boolean isSetPath() { + return this.path != null; + } + + public void setPathIsSet(boolean value) { + if (!value) { + this.path = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_NAME: + if (value == null) { + unsetUserName(); + } else { + setUserName((String)value); + } + break; + + case PASSWORD: + if (value == null) { + unsetPassword(); + } else { + setPassword((String)value); + } + break; + + case PATH: + if (value == null) { + unsetPath(); + } else { + setPath((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_NAME: + return getUserName(); + + case PASSWORD: + return getPassword(); + + case PATH: + return getPath(); + + } + throw new IllegalStateException(); + } + + /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ + public boolean isSet(_Fields field) { + if (field == null) { + throw new IllegalArgumentException(); + } + + switch (field) { + case USER_NAME: + return isSetUserName(); + case PASSWORD: + return isSetPassword(); + case PATH: + return isSetPath(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof User) + return this.equals((User)that); + return false; + } + + public boolean equals(User that) { + if (that == null) + return false; + + boolean this_present_userName = true && this.isSetUserName(); + boolean that_present_userName = true && that.isSetUserName(); + if (this_present_userName || that_present_userName) { + if (!(this_present_userName && that_present_userName)) + return false; + if (!this.userName.equals(that.userName)) + return false; + } + + boolean this_present_password = true && this.isSetPassword(); + boolean that_present_password = true && that.isSetPassword(); + if (this_present_password || that_present_password) { + if (!(this_present_password && that_present_password)) + return false; + if (!this.password.equals(that.password)) + return false; + } + + boolean this_present_path = true && this.isSetPath(); + boolean that_present_path = true && that.isSetPath(); + if (this_present_path || that_present_path) { + if (!(this_present_path && that_present_path)) + return false; + if (!this.path.equals(that.path)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(User other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUserName()).compareTo(other.isSetUserName()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserName()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPassword()).compareTo(other.isSetPassword()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPassword()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetPath()).compareTo(other.isSetPath()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetPath()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.path, other.path); + 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("User("); + boolean first = true; + + sb.append("userName:"); + if (this.userName == null) { + sb.append("null"); + } else { + sb.append(this.userName); + } + first = false; + if (!first) sb.append(", "); + sb.append("password:"); + if (this.password == null) { + sb.append("null"); + } else { + sb.append(this.password); + } + first = false; + if (!first) sb.append(", "); + sb.append("path:"); + if (this.path == null) { + sb.append("null"); + } else { + sb.append(this.path); + } + 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 UserStandardSchemeFactory implements SchemeFactory { + public UserStandardScheme getScheme() { + return new UserStandardScheme(); + } + } + + private static class UserStandardScheme extends StandardScheme<User> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, User struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case -1: // USER_NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userName = iprot.readString(); + struct.setUserNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -2: // PASSWORD + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case -3: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(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, User struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + if (struct.password != null) { + oprot.writeFieldBegin(PASSWORD_FIELD_DESC); + oprot.writeString(struct.password); + oprot.writeFieldEnd(); + } + if (struct.userName != null) { + oprot.writeFieldBegin(USER_NAME_FIELD_DESC); + oprot.writeString(struct.userName); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class UserTupleSchemeFactory implements SchemeFactory { + public UserTupleScheme getScheme() { + return new UserTupleScheme(); + } + } + + private static class UserTupleScheme extends TupleScheme<User> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserName()) { + optionals.set(0); + } + if (struct.isSetPassword()) { + optionals.set(1); + } + if (struct.isSetPath()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUserName()) { + oprot.writeString(struct.userName); + } + if (struct.isSetPassword()) { + oprot.writeString(struct.password); + } + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, User struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.userName = iprot.readString(); + struct.setUserNameIsSet(true); + } + if (incoming.get(1)) { + struct.password = iprot.readString(); + struct.setPasswordIsSet(true); + } + if (incoming.get(2)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } } + diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index 0a2f5ab2..ec1ea11f 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -446,4 +446,56 @@ public class SQL { }
return -1;
}
+
+ public int updateLectureData(Connection con, int pk_person, int pk_image,
+ int imageversion, String name, 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;
+
+ if (isactive == true) {
+ active_bol = 1;
+ }
+ try {
+ Statement stm = con.createStatement();
+ Random random = new Random();
+ int uid = random.nextInt();
+ stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_lecture`(`lectureID`,`name`,`isActive`,`startTime`,`endTime`,`lastUsed`,`shortDescription`,`description`,`imageID`,`imageVersion`,`admin_createTime`,`admin_changeTime`,`admin_owner`,`admin_change_by`)VALUES('"
+ + uid
+ + "','"
+ + name
+ + "','"
+ + active_bol
+ + "','"
+ + start
+ + "','"
+ + end
+ + "','"
+ + formatter.format(new Date())
+ + "','"
+ + shortdesc
+ + "','"
+ + desc
+ + "','"
+ + pk_image
+ + "','"
+ + imageversion
+ + "','"
+ + formatter.format(new Date())
+ + "','"
+ + formatter.format(new Date())
+ + "','"
+ + pk_person
+ + "','"
+ + pk_person + "');");
+ con.commit();
+
+ } catch (SQLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ return 0;
+
+ }
}
|
