From a0ee1ad7af0b5d3ce6277fcff94f6c962ab3d328 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2014 11:31:29 +0200 Subject: Code formatiert --- Dozentenmodulserver/src/server/User.java | 1154 ++++++++++++++++-------------- 1 file changed, 602 insertions(+), 552 deletions(-) (limited to 'Dozentenmodulserver/src') diff --git a/Dozentenmodulserver/src/server/User.java b/Dozentenmodulserver/src/server/User.java index 7bf98cc4..5861a6e0 100644 --- a/Dozentenmodulserver/src/server/User.java +++ b/Dozentenmodulserver/src/server/User.java @@ -32,557 +32,607 @@ import java.util.Arrays; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class User implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { - switch(fieldId) { - case -1: // USER_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 other. - */ - 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 { - - 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 { - - @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, + java.io.Serializable, Cloneable, Comparable { + 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not + * found. + */ + public static _Fields findByThriftId(int fieldId) { + switch (fieldId) { + case -1: // USER_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 other. + */ + 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 { + + 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 { + + @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); + } + } + } } - -- cgit v1.2.3-55-g7522 From 31a2f63068f7aef263d562df41d6b2da46d687a1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2014 11:32:32 +0200 Subject: Bugs behoben: -short_description hat nun korrekte Quelle -Filename nun ohne führendes "/" --- Dozentenmodulserver/bin/util/XMLCreator.class | Bin 6292 -> 6327 bytes Dozentenmodulserver/src/util/XMLCreator.java | 6 +++--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'Dozentenmodulserver/src') diff --git a/Dozentenmodulserver/bin/util/XMLCreator.class b/Dozentenmodulserver/bin/util/XMLCreator.class index 025904a6..9700459e 100644 Binary files a/Dozentenmodulserver/bin/util/XMLCreator.class and b/Dozentenmodulserver/bin/util/XMLCreator.class differ diff --git a/Dozentenmodulserver/src/util/XMLCreator.java b/Dozentenmodulserver/src/util/XMLCreator.java index 8a8bd701..3f5866e6 100644 --- a/Dozentenmodulserver/src/util/XMLCreator.java +++ b/Dozentenmodulserver/src/util/XMLCreator.java @@ -33,7 +33,7 @@ public class XMLCreator { private String filePath = "/srv/openslx/nfs/temp/"; // phone param not existing - private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.name as os, m_VLData_lecture.admin_changeTime as time " + private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.name as os, m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName " + "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem " + "WHERE m_user.userID = m_VLData_lecture.admin_owner " + "AND m_VLData_imageInfo.GUID_imageID = m_VLData_lecture.imageID " @@ -118,7 +118,7 @@ public class XMLCreator { Element imgName = doc.createElement("image_name"); entry.appendChild(imgName); String imagePath = rs.getString("image_path").substring( - rs.getString("image_path").lastIndexOf("/")); + rs.getString("image_path").lastIndexOf("/")+1); //+1 um das "/" los zu werden imgName.setAttribute("param", imagePath); @@ -138,7 +138,7 @@ public class XMLCreator { Element shortDesc = doc.createElement("short_description"); entry.appendChild(shortDesc); - shortDesc.setAttribute("param", rs.getString("shortdescription")); + shortDesc.setAttribute("param", rs.getString("lectureName")); // TODO append latest change date and time Element longDesc = doc.createElement("long_description"); -- cgit v1.2.3-55-g7522 From 60d32ae1cbc729c664888b1a255845a10fed34b1 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 8 Apr 2014 15:59:46 +0200 Subject: Logging weiter ausgebaut, XML werden nun mit einem eigenen Namen erzeugt und gespeichert --- Dozentenmodulserver/src/server/BinaryListener.java | 8 +- Dozentenmodulserver/src/server/ServerHandler.java | 2 +- Dozentenmodulserver/src/server/startServer.java | 4 +- Dozentenmodulserver/src/sql/SQL.java | 440 +++++++++++++-------- Dozentenmodulserver/src/util/XMLCreator.java | 40 +- 5 files changed, 316 insertions(+), 178 deletions(-) (limited to 'Dozentenmodulserver/src') diff --git a/Dozentenmodulserver/src/server/BinaryListener.java b/Dozentenmodulserver/src/server/BinaryListener.java index 7d8b94b5..8d592992 100644 --- a/Dozentenmodulserver/src/server/BinaryListener.java +++ b/Dozentenmodulserver/src/server/BinaryListener.java @@ -1,5 +1,7 @@ package server; +import java.util.Date; + import org.apache.log4j.Logger; import org.apache.thrift.server.TServer; import org.apache.thrift.server.TServer.Args; @@ -20,13 +22,13 @@ public class BinaryListener implements Runnable final TServerTransport transport; try { transport = new TServerSocket( 9090 ); - log.info("Connected to Port 9090"); + log.info(new Date()+" - Connected to Port 9090"); } catch ( TTransportException e ) { - log.fatal( "Could not listen on port 9090" ); + log.fatal( new Date() +" - Could not listen on port 9090" ); return; } TServer server = new TSimpleServer( new Args( transport ).processor( processor ) ); - log.info("Starting Running Server"); + log.info(new Date() +" - Started Running Server"); server.serve(); } diff --git a/Dozentenmodulserver/src/server/ServerHandler.java b/Dozentenmodulserver/src/server/ServerHandler.java index d50c65a9..681a9a7c 100644 --- a/Dozentenmodulserver/src/server/ServerHandler.java +++ b/Dozentenmodulserver/src/server/ServerHandler.java @@ -201,7 +201,7 @@ public class ServerHandler implements Server.Iface { XMLCreator xml=new XMLCreator(con, name); try { xml.create(name); - System.out.println("creator durch"); + System.out.println(new Date() + " - Creator beendet"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); diff --git a/Dozentenmodulserver/src/server/startServer.java b/Dozentenmodulserver/src/server/startServer.java index 7a93183d..e1ab22c0 100644 --- a/Dozentenmodulserver/src/server/startServer.java +++ b/Dozentenmodulserver/src/server/startServer.java @@ -23,7 +23,7 @@ public class startServer { public static void main(String[] args) { BasicConfigurator.configure(); - log.info( new Date() + ", starting Application\n" ); + log.info( new Date() + " - starting Application\n" ); Thread t; t = new Thread(new BinaryListener()); servers.add(t); @@ -42,7 +42,7 @@ public class startServer { } } } - log.info( new Date()+", all Servers shut down, exiting...\n" ); + log.info( new Date()+" - all Servers shut down, exiting...\n" ); } diff --git a/Dozentenmodulserver/src/sql/SQL.java b/Dozentenmodulserver/src/sql/SQL.java index f28fdd67..0a2f5ab2 100644 --- a/Dozentenmodulserver/src/sql/SQL.java +++ b/Dozentenmodulserver/src/sql/SQL.java @@ -10,314 +10,434 @@ import java.text.SimpleDateFormat; import java.util.Date; import java.util.Random; +import org.apache.log4j.Logger; + +import server.BinaryListener; public class SQL { + + private static Logger log = Logger.getLogger( BinaryListener.class ); - public Connection getConnection() - { + public Connection getConnection() { try { Class.forName("com.mysql.jdbc.Driver").newInstance(); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); - } + } try { - Connection con=DriverManager.getConnection("jdbc:mysql://127.0.0.1/bwLehrpool?user=root&password=slx-ng-open"); + Connection con = DriverManager + .getConnection("jdbc:mysql://127.0.0.1/bwLehrpool?user=root&password=slx-ng-open"); con.setAutoCommit(false); + log.info(new Date() + " - Connection returned to Client."); return con; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Could not return connection to Client."); e.printStackTrace(); } return null; } - - public int writeFTPUser(Connection con,String user, String pass) - { + + public int writeFTPUser(Connection con, String user, String pass) { Statement stm; try { - stm=con.createStatement(); - - int ret=stm.executeUpdate("INSERT INTO `bwLehrpool`.`FtpUsers`(`User`,`Password`,`Uid`,`Gid`,`Dir`)VALUES('"+user+"',SHA1('"+pass+"'),'10001','12345','/srv/openslx/nfs/temp');"); + stm = con.createStatement(); + + int ret = stm + .executeUpdate("INSERT INTO `bwLehrpool`.`FtpUsers`(`User`,`Password`,`Uid`,`Gid`,`Dir`)VALUES('" + + user + + "',SHA1('" + + pass + + "'),'10001','12345','/srv/openslx/nfs/temp');"); con.commit(); + log.info(new Date() + " - created FTPUser "+user+" : "+pass+"."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - FTPUser not created."); e.printStackTrace(); } return -1; } - - public int DeleteUser(Connection con, String user) - { + + public int DeleteUser(Connection con, String user) { Statement stm; try { - stm=con.createStatement(); - - int ret=stm.executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '"+user+"';"); + stm = con.createStatement(); + + int ret = stm + .executeUpdate("DELETE FROM `bwLehrpool`.`FtpUsers` where User like '" + + user + "';"); con.commit(); + log.info(new Date() + " - FTPUser "+user+" deleted."); return ret; } catch (SQLException e) { // TODO Auto-generated catch block + log.info(new Date() + " - Could not delete FTPUser "+user+"."); e.printStackTrace(); } return -1; } - - public ResultSet getImage(Connection con) - { + + public ResultSet getImage(Connection con) { try { - Statement stm=con.createStatement(); - - return stm.executeQuery("SELECT image_name FROM bwLehrpool.m_VLData_imageInfo;"); - - + Statement stm = con.createStatement(); + + return stm + .executeQuery("SELECT image_name FROM bwLehrpool.m_VLData_imageInfo;"); + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - + return null; } - public ResultSet getPathOfImage(Connection con, String image_id, String version) - { + public ResultSet getPathOfImage(Connection con, String image_id, + String version) { try { - Statement stm=con.createStatement(); - - return stm.executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID='"+image_id+"' and imageVersion='"+version+"';"); - - + Statement stm = con.createStatement(); + + return stm + .executeQuery("SELECT image_path FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID='" + + image_id + + "' and imageVersion='" + + version + + "';"); + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - + return null; } - - public int setInstitution(Connection con,String university) - { + + public int setInstitution(Connection con, String university) { try { - Statement stm=con.createStatement(); - - - - ResultSet ret=stm.executeQuery("SELECT * FROM bwLehrpool.m_institution where name like'"+university+"';"); - if(ret.next()==false) - { - Random rand=new Random(); - int id=rand.nextInt(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_institution`(`institutionID`,`name`)VALUES('"+id+"','"+university+"');"); + Statement stm = con.createStatement(); + + ResultSet ret = stm + .executeQuery("SELECT * FROM bwLehrpool.m_institution where name like'" + + university + "';"); + if (ret.next() == false) { + Random rand = new Random(); + int id = rand.nextInt(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_institution`(`institutionID`,`name`)VALUES('" + + id + "','" + university + "');"); con.commit(); - ResultSet rs=stm.executeQuery("SELECT institutionID FROM bwLehrpool.m_institution WHERE name like '"+university+"';"); + ResultSet rs = stm + .executeQuery("SELECT institutionID FROM bwLehrpool.m_institution WHERE name like '" + + university + "';"); rs.next(); return rs.getInt("institutionID"); - } - else - { + } else { return ret.getInt("institutionID"); } - + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return -1; } - - - - public int setPerson(Connection con,String login, String lastname, String firstname, String mail, Date lastlogin,int Institution) - { + + public int setPerson(Connection con, String login, String lastname, + String firstname, String mail, Date lastlogin, int Institution) { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); try { - Statement stm=con.createStatement(); - - ResultSet ret=stm.executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '"+lastname+"' and Vorname like '"+firstname+"';"); - if(ret.next()==false) - { - Random rand=new Random(); - int id=rand.nextInt(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_user`(`userID`,`loginName`,`nachname`,`vorname`,`mail`,`lastLogin`,`institution`)VALUES('"+id+"','Platzhalter','"+lastname+"','"+firstname+"','"+mail+"','"+formatter.format(new Date())+"','"+Institution+"');"); - con.commit(); - ResultSet rs=stm.executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '"+lastname+"' and Vorname like '"+firstname+"';"); - rs.next(); - return rs.getInt("userID"); - } - else - { + Statement stm = con.createStatement(); + + ResultSet ret = stm + .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" + + lastname + + "' and Vorname like '" + + firstname + + "';"); + if (ret.next() == false) { + Random rand = new Random(); + int id = rand.nextInt(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_user`(`userID`,`loginName`,`nachname`,`vorname`,`mail`,`lastLogin`,`institution`)VALUES('" + + id + + "','Platzhalter','" + + lastname + + "','" + + firstname + + "','" + + mail + + "','" + + formatter.format(new Date()) + + "','" + + Institution + + "');"); + con.commit(); + ResultSet rs = stm + .executeQuery("SELECT userID FROM bwLehrpool.m_user where Nachname like '" + + lastname + + "' and Vorname like '" + + firstname + + "';"); + rs.next(); + return rs.getInt("userID"); + } else { return ret.getInt("userID"); } - + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return -1; } - - public boolean setImageData(Connection con, int pk_person, boolean license, boolean internet, long cpu, long ram, String imagename, String imagePath) - { - + + public boolean setImageData(Connection con, int pk_person, boolean license, + boolean internet, long cpu, long ram, String imagename, + String imagePath) { + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - - int internet_bol=0; - int license_bol=0; - if(internet==true) - { - internet_bol=1; + + int internet_bol = 0; + int license_bol = 0; + if (internet == true) { + internet_bol = 1; } - if(license==true) - { - license_bol=1; + if (license == true) { + license_bol = 1; } try { - Statement stm=con.createStatement(); - Random random=new Random(); - int uid=random.nextInt(); - stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`)VALUES('"+uid+"',1,'"+imagename+"','"+imagePath+"','"+formatter.format(new Date())+"','"+formatter.format(new Date())+"','"+formatter.format(new Date())+"','"+pk_person+"','"+pk_person+"','"+formatter.format(new Date())+"','"+formatter.format(new Date())+"','"+pk_person+"','"+pk_person+"',1,1,1,1,1,1,0,0,'"+license_bol+"','"+internet_bol+"','"+ram+"','"+cpu+"');"); + Statement stm = con.createStatement(); + Random random = new Random(); + int uid = random.nextInt(); + stm.executeUpdate("INSERT INTO `bwLehrpool`.`m_VLData_imageInfo`(`GUID_imageID`,`imageVersion`,`image_name`,`image_path`,`image_lastCall`,`image_create_time`,`image_update_time`,`image_owner`,`image_change_by`,`rec_create_time`,`rec_change_time`,`rec_owner`,`rec_change_by`,`content_operatingSystem`,`status_isCompressed`,`status_isSecure`,`status_isOptimzed`,`status_isValid`,`status_isReady`,`status_isDeleted`,`status_isLastOfficialVersion`,`cond_hasLicenseRestriction`,`cond_hasInternetRestriction`,`cond_minRAM`,`cond_minCPUs`)VALUES('" + + uid //GUID_imageID + + "',1,'" //imageVersion + + imagename //image_name + + "','" + + imagePath //image_path + + "','" + + formatter.format(new Date()) //image_lastCall + + "','" + + formatter.format(new Date()) //image_create_time + + "','" + + formatter.format(new Date()) //image_update_time + + "','" + + pk_person //image_owner + + "','" + + pk_person //image_change_by + + "','" + + formatter.format(new Date()) //rec_create_time + + "','" + + formatter.format(new Date()) //rec_change_time + + "','" + + pk_person //rec_owner + + "','" + + pk_person //rec_change_by + + "',0" //content_operatingSystem + + ",1" //status_isCompressed + + ",1" //status_isSecure + + ",1" //status_isOptimzed + + ",1" //status_isValid + + ",1" //status_isReady + + ",0" //status_isDeleted + + ",0,'" //status_isLastOfficialVersion + + license_bol //cond_hasLicenseRestriction + + "','" + + internet_bol //cond_hasInternetRestriction + + "','" + + ram //cond_minRAM + + "','" + + cpu //cond_minCPUs + + "');"); con.commit(); - + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return true; - + } - - public ResultSet getImageList(Connection con){ + + public ResultSet getImageList(Connection con) { try { - Statement stm=con.createStatement(); - - return stm.executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); - - + Statement stm = con.createStatement(); + + return stm + .executeQuery("SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, '' as lecture,vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and vl.image_owner=u.userID and vl.image_name not in (SELECT vl.image_name FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID) union SELECT vl.GUID_imageID, vl.imageVersion,vl.image_name, vl.cond_hasLicenseRestriction, os.name, lect.name as lecture, vl.image_update_time, Concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_imageInfo vl, bwLehrpool.m_operatingSystem os, bwLehrpool.m_VLData_lecture lect, bwLehrpool.m_user u Where vl.content_operatingSystem=os.operatingSystemID and lect.imageID=vl.GUID_imageID and vl.image_owner=u.userID;"); + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - - public ResultSet getLectureList(Connection con){ + + public ResultSet getLectureList(Connection con) { try { - Statement stm=con.createStatement(); - - return stm.executeQuery("SELECT l.lectureID, l.name, l.isActive,l.startTime,l.endTime,l.lastUsed,l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.m_user u where i.GUID_imageID=l.imageID and l.admin_owner=u.userID;"); - - + Statement stm = con.createStatement(); + + return stm + .executeQuery("SELECT l.lectureID, l.name, l.isActive,l.startTime,l.endTime,l.lastUsed,l.description, i.image_name, concat(u.Nachname,' ',u.Vorname) as user FROM bwLehrpool.m_VLData_lecture l, bwLehrpool.m_VLData_imageInfo i, bwLehrpool.m_user u where i.GUID_imageID=l.imageID and l.admin_owner=u.userID;"); + } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - - - public ResultSet getAllOS(Connection con) - { - - + + public ResultSet getAllOS(Connection con) { + try { - Statement stm=con.createStatement(); - return stm.executeQuery("SELECT name FROM bwLehrpool.m_operatingSystem;"); + Statement stm = con.createStatement(); + return stm + .executeQuery("SELECT name FROM bwLehrpool.m_operatingSystem;"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } - - return null; - + } - - public ResultSet getPersonData(Connection con,String Vorname, String Nachname) - { + + public ResultSet getPersonData(Connection con, String Vorname, + String Nachname) { try { - Statement stm=con.createStatement(); - return stm.executeQuery("SELECT u.Nachname, u.Vorname, u.mail, i.name FROM bwLehrpool.m_user u, bwLehrpool.m_institution i where u.Nachname like '"+Nachname+"' and u.Vorname like '"+Vorname+"' and u.institution=i.institutionID;"); + Statement stm = con.createStatement(); + return stm + .executeQuery("SELECT u.Nachname, u.Vorname, u.mail, i.name FROM bwLehrpool.m_user u, bwLehrpool.m_institution i where u.Nachname like '" + + Nachname + + "' and u.Vorname like '" + + Vorname + + "' and u.institution=i.institutionID;"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - - public int setLectureData(Connection con, int pk_person, int pk_image,int imageversion, String name, String desc, String shortdesc,String start, String end, boolean isactive) - { - + + public int setLectureData(Connection con, int pk_person, int pk_image, + int imageversion, String name, String desc, String shortdesc, + String start, String end, boolean isactive) { + DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - int active_bol=0; + int active_bol = 0; - if(isactive==true) - { - active_bol=1; + 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+"');"); + 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; - + } - - public ResultSet getImageIDandVersion(Connection con,String name) - { + + public ResultSet getImageIDandVersion(Connection con, String name) { try { - Statement stm=con.createStatement(); - return stm.executeQuery("SELECT GUID_imageID, imageVersion FROM bwLehrpool.m_VLData_imageInfo where image_name like '"+name+"';"); + Statement stm = con.createStatement(); + return stm + .executeQuery("SELECT GUID_imageID, imageVersion FROM bwLehrpool.m_VLData_imageInfo where image_name like '" + + name + "';"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - - public ResultSet getImageData(Connection con,String id, String version){ + + public ResultSet getImageData(Connection con, String id, String version) { try { - Statement stm=con.createStatement(); + Statement stm = con.createStatement(); System.out.println("Test"); - return stm.executeQuery("SELECT image_name,cond_hasInternetRestriction,cond_hasLicenseRestriction, cond_minCPUs, cond_minRAM FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '"+id+"' and imageVersion = '"+version+"' ;"); + return stm + .executeQuery("SELECT image_name,cond_hasInternetRestriction,cond_hasLicenseRestriction, cond_minCPUs, cond_minRAM FROM bwLehrpool.m_VLData_imageInfo where GUID_imageID = '" + + id + "' and imageVersion = '" + version + "' ;"); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } return null; } - - public int UpdateImageData(Connection con,String name,String newName,boolean license, boolean internet, long cpu, long ram,String id, String version){ + + public int UpdateImageData(Connection con, String name, String newName, + boolean license, boolean internet, long cpu, long ram, String id, + String version) { try { DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Statement stm=con.createStatement(); - int newVersion=Integer.parseInt(version)+1; - - int internet_bol=0; - int license_bol=0; - if(internet==true) - { - internet_bol=1; + Statement stm = con.createStatement(); + int newVersion = Integer.parseInt(version) + 1; + + int internet_bol = 0; + int license_bol = 0; + if (internet == true) { + internet_bol = 1; } - if(license==true) - { - license_bol=1; + if (license == true) { + license_bol = 1; } System.out.println(internet_bol); System.out.println(license_bol); - stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `imageVersion` = '"+newVersion+"',`image_name` = '"+newName+"',`image_update_time` = '"+formatter.format(new Date())+"',`rec_change_time` = '"+formatter.format(new Date())+"',`cond_hasLicenseRestriction` = '"+license_bol+"',`cond_hasInternetRestriction` = '"+internet_bol+"',`cond_minRAM` = '"+ram+"',`cond_minCPUs` = '"+cpu+"' WHERE `GUID_imageID` = '"+id+"' AND `imageVersion` = '"+version+"';"); + stm.executeUpdate("UPDATE `bwLehrpool`.`m_VLData_imageInfo` SET `imageVersion` = '" + + newVersion + + "',`image_name` = '" + + newName + + "',`image_update_time` = '" + + formatter.format(new Date()) + + "',`rec_change_time` = '" + + formatter.format(new Date()) + + "',`cond_hasLicenseRestriction` = '" + + license_bol + + "',`cond_hasInternetRestriction` = '" + + internet_bol + + "',`cond_minRAM` = '" + + ram + + "',`cond_minCPUs` = '" + + cpu + + "' WHERE `GUID_imageID` = '" + + id + + "' AND `imageVersion` = '" + version + "';"); con.commit(); return 0; } catch (SQLException e) { diff --git a/Dozentenmodulserver/src/util/XMLCreator.java b/Dozentenmodulserver/src/util/XMLCreator.java index 3f5866e6..111a6337 100644 --- a/Dozentenmodulserver/src/util/XMLCreator.java +++ b/Dozentenmodulserver/src/util/XMLCreator.java @@ -5,6 +5,9 @@ import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Date; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -15,10 +18,13 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.dom.DOMSource; import javax.xml.transform.stream.StreamResult; +import org.apache.log4j.Logger; import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.Element; +import server.BinaryListener; + public class XMLCreator { /* @@ -31,13 +37,17 @@ public class XMLCreator { private ResultSet rs = null; private String vmName; private String filePath = "/srv/openslx/nfs/temp/"; + private String imageName; + private String xmlName; + private static Logger log = Logger.getLogger( BinaryListener.class ); // phone param not existing - private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.name as os, m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName " - + "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem " + private String query = "SELECT m_VLData_imageInfo.image_path ,vorname, nachname, mail, shortdescription, description, m_operatingSystem.name as os, m_VLData_lecture.admin_changeTime as time, m_VLData_lecture.name as lectureName, m_user.institution as userInstitution, m_user.loginName as loginName, m_institution.name as institutionName " + + "FROM bwLehrpool.m_VLData_lecture, bwLehrpool.m_VLData_imageInfo, bwLehrpool.m_user, bwLehrpool.m_operatingSystem, bwLehrpool.m_institution " + "WHERE m_user.userID = m_VLData_lecture.admin_owner " + "AND m_VLData_imageInfo.GUID_imageID = m_VLData_lecture.imageID " + "AND m_VLData_imageInfo.content_operatingSystem = m_operatingSystem.operatingSystemID " + + "AND m_user.institution = m_institution.institutionID " + "AND m_VLData_lecture.name = "; public XMLCreator(Connection con) { @@ -61,10 +71,10 @@ public class XMLCreator { boolean success = startCreation(); - if (success) { + if (success) { return true; } - + log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); return false; } @@ -85,6 +95,7 @@ public class XMLCreator { if (success) { return true; } + log.info(new Date() + " - Could not create XML-File '"+vmName+"'. Error in create(String vmName)."); return false; } @@ -117,10 +128,10 @@ public class XMLCreator { Element imgName = doc.createElement("image_name"); entry.appendChild(imgName); - String imagePath = rs.getString("image_path").substring( - rs.getString("image_path").lastIndexOf("/")+1); //+1 um das "/" los zu werden + imageName = rs.getString("image_path").substring( + rs.getString("image_path").lastIndexOf("/")+1); //+1 um das führende "/" los zu werden - imgName.setAttribute("param", imagePath); + imgName.setAttribute("param", imageName); Element creator = doc.createElement("creator"); entry.appendChild(creator); @@ -144,7 +155,7 @@ public class XMLCreator { Element longDesc = doc.createElement("long_description"); entry.appendChild(longDesc); longDesc.setAttribute("param", rs.getString("description") - + " last update: " + rs.getString("time")); + + "; last update: " + rs.getString("time")); Element os = doc.createElement("os"); entry.appendChild(os); @@ -189,10 +200,14 @@ public class XMLCreator { .newInstance(); Transformer transformer = transformerFactory.newTransformer(); DOMSource source = new DOMSource(doc); - - StreamResult result = new StreamResult(new File(filePath - + imagePath.replace("vmdk", "xml"))); // see filepath at top of - // class + + //Set XML-filename + DateFormat formatter = new SimpleDateFormat("yyyMMddhhmmss"); + xmlName=formatter.format(new Date()) + "_" + rs.getString("institutionName") + "_" + rs.getString("loginName") + "_" + rs.getString("lectureName") + ".xml"; + + //Write file + StreamResult result = new StreamResult(new File(filePath+ xmlName)); // see filepath at top of class + transformer.transform(source, result); // cleanup @@ -200,6 +215,7 @@ public class XMLCreator { st.close(); // return + log.info(new Date() + " - XML-File '"+xmlName+"' successfully created."); return true; } } -- cgit v1.2.3-55-g7522 From ec67e80ff104bf90d307bf264283eb79d937f262 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 10 Apr 2014 10:29:52 +0200 Subject: Test --- .../bin/gui/image/FTPCreateUploader_GUI$8.class | Bin 890 -> 1014 bytes .../bin/gui/image/FTPCreateUploader_GUI.class | Bin 12313 -> 12313 bytes .../bin/gui/image/FTPDownloader_GUI$1.class | Bin 1414 -> 1414 bytes .../bin/gui/image/FTPDownloader_GUI$2.class | Bin 1303 -> 1303 bytes .../bin/gui/image/FTPDownloader_GUI$3.class | Bin 1167 -> 1167 bytes .../bin/gui/image/FTPDownloader_GUI$4.class | Bin 785 -> 785 bytes .../bin/gui/image/FTPDownloader_GUI$5.class | Bin 1557 -> 1557 bytes .../bin/gui/image/FTPDownloader_GUI$6.class | Bin 972 -> 972 bytes .../bin/gui/image/FTPDownloader_GUI.class | Bin 10072 -> 9974 bytes Dozentenmodul/bin/gui/intro/Login_GUI$1.class | Bin 1106 -> 1106 bytes Dozentenmodul/bin/gui/intro/Login_GUI$2.class | Bin 665 -> 665 bytes Dozentenmodul/bin/gui/intro/Login_GUI$3.class | Bin 677 -> 677 bytes Dozentenmodul/bin/gui/intro/Login_GUI$4.class | Bin 677 -> 677 bytes Dozentenmodul/bin/gui/intro/Login_GUI$5.class | Bin 674 -> 674 bytes Dozentenmodul/bin/gui/intro/Login_GUI.class | Bin 7783 -> 8052 bytes .../SessionData$SessionDataStandardScheme.class | Bin 2652 -> 2843 bytes ...sionData$SessionDataStandardSchemeFactory.class | Bin 965 -> 965 bytes .../SessionData$SessionDataTupleScheme.class | Bin 2118 -> 2290 bytes ...SessionData$SessionDataTupleSchemeFactory.class | Bin 941 -> 941 bytes Dozentenmodul/bin/thrift/SessionData$_Fields.class | Bin 2934 -> 3030 bytes Dozentenmodul/bin/thrift/SessionData.class | Bin 10381 -> 11687 bytes .../src/gui/image/FTPCreateUploader_GUI.java | 1 + Dozentenmodul/src/gui/image/FTPDownloader_GUI.java | 2 - Dozentenmodul/src/gui/intro/Login_GUI.java | 9 + Dozentenmodul/src/thrift/SessionData.java | 108 +- .../Server$AsyncClient$DeleteFtpUser_call.class | Bin 3131 -> 3131 bytes .../bin/server/Server$AsyncClient$Factory.class | Bin 1442 -> 1442 bytes .../server/Server$AsyncClient$getAllOS_call.class | Bin 2993 -> 2993 bytes .../Server$AsyncClient$getFtpUser_call.class | Bin 2945 -> 2945 bytes .../Server$AsyncClient$getImageData_call.class | Bin 3332 -> 3332 bytes .../Server$AsyncClient$getImageList_call.class | Bin 3021 -> 3021 bytes .../Server$AsyncClient$getLectureData_call.class | Bin 3246 -> 3246 bytes .../Server$AsyncClient$getLectureList_call.class | Bin 3039 -> 3039 bytes .../Server$AsyncClient$getPathOfImage_call.class | Bin 3267 -> 3267 bytes .../Server$AsyncClient$getPersonData_call.class | Bin 3333 -> 3333 bytes .../Server$AsyncClient$startFileCopy_call.class | Bin 3131 -> 3131 bytes .../Server$AsyncClient$updateImageData_call.class | Bin 3863 -> 3863 bytes .../Server$AsyncClient$writeLecturedata_call.class | Bin 4410 -> 4410 bytes .../Server$AsyncClient$writeVLdata_call.class | Bin 4241 -> 4241 bytes .../bin/server/Server$AsyncClient.class | Bin 8238 -> 9469 bytes .../bin/server/Server$AsyncIface.class | Bin 1460 -> 1802 bytes .../Server$AsyncProcessor$DeleteFtpUser$1.class | Bin 2969 -> 2969 bytes .../Server$AsyncProcessor$DeleteFtpUser.class | Bin 3107 -> 3107 bytes .../server/Server$AsyncProcessor$getAllOS$1.class | Bin 2997 -> 2997 bytes .../server/Server$AsyncProcessor$getAllOS.class | Bin 3062 -> 3062 bytes .../Server$AsyncProcessor$getFtpUser$1.class | Bin 2851 -> 2851 bytes .../server/Server$AsyncProcessor$getFtpUser.class | Bin 2996 -> 2996 bytes .../Server$AsyncProcessor$getImageData$1.class | Bin 3081 -> 3081 bytes .../Server$AsyncProcessor$getImageData.class | Bin 3292 -> 3292 bytes .../Server$AsyncProcessor$getImageList$1.class | Bin 3021 -> 3021 bytes .../Server$AsyncProcessor$getImageList.class | Bin 3098 -> 3098 bytes .../Server$AsyncProcessor$getLectureData$1.class | Bin 3099 -> 3099 bytes .../Server$AsyncProcessor$getLectureData.class | Bin 3275 -> 3275 bytes .../Server$AsyncProcessor$getLectureList$1.class | Bin 3045 -> 3045 bytes .../Server$AsyncProcessor$getLectureList.class | Bin 3132 -> 3132 bytes .../Server$AsyncProcessor$getPathOfImage$1.class | Bin 2907 -> 2907 bytes .../Server$AsyncProcessor$getPathOfImage.class | Bin 3174 -> 3174 bytes .../Server$AsyncProcessor$getPersonData$1.class | Bin 3090 -> 3090 bytes .../Server$AsyncProcessor$getPersonData.class | Bin 3301 -> 3301 bytes .../Server$AsyncProcessor$startFileCopy$1.class | Bin 2984 -> 2984 bytes .../Server$AsyncProcessor$startFileCopy.class | Bin 3119 -> 3119 bytes .../Server$AsyncProcessor$updateImageData$1.class | Bin 3002 -> 3002 bytes .../Server$AsyncProcessor$updateImageData.class | Bin 3367 -> 3367 bytes .../Server$AsyncProcessor$writeLecturedata$1.class | Bin 3011 -> 3011 bytes .../Server$AsyncProcessor$writeLecturedata.class | Bin 3648 -> 3648 bytes .../Server$AsyncProcessor$writeVLdata$1.class | Bin 2966 -> 2966 bytes .../server/Server$AsyncProcessor$writeVLdata.class | Bin 3490 -> 3490 bytes .../bin/server/Server$AsyncProcessor.class | Bin 3382 -> 3490 bytes .../bin/server/Server$Client$Factory.class | Bin 1411 -> 1411 bytes Dozentenmodulserver/bin/server/Server$Client.class | Bin 14914 -> 16916 bytes ...ser_args$DeleteFtpUser_argsStandardScheme.class | Bin 2628 -> 2628 bytes ...s$DeleteFtpUser_argsStandardSchemeFactory.class | Bin 1162 -> 1162 bytes ...tpUser_args$DeleteFtpUser_argsTupleScheme.class | Bin 2112 -> 2112 bytes ...args$DeleteFtpUser_argsTupleSchemeFactory.class | Bin 1138 -> 1138 bytes .../server/Server$DeleteFtpUser_args$_Fields.class | Bin 3004 -> 3004 bytes .../bin/server/Server$DeleteFtpUser_args.class | Bin 9460 -> 9460 bytes ...result$DeleteFtpUser_resultStandardScheme.class | Bin 2632 -> 2632 bytes ...DeleteFtpUser_resultStandardSchemeFactory.class | Bin 1194 -> 1194 bytes ...er_result$DeleteFtpUser_resultTupleScheme.class | Bin 2088 -> 2088 bytes ...lt$DeleteFtpUser_resultTupleSchemeFactory.class | Bin 1170 -> 1170 bytes .../Server$DeleteFtpUser_result$_Fields.class | Bin 3030 -> 3030 bytes .../bin/server/Server$DeleteFtpUser_result.class | Bin 9823 -> 9823 bytes Dozentenmodulserver/bin/server/Server$Iface.class | Bin 1695 -> 1992 bytes .../server/Server$Processor$DeleteFtpUser.class | Bin 2029 -> 2029 bytes .../bin/server/Server$Processor$getAllOS.class | Bin 1875 -> 1875 bytes .../bin/server/Server$Processor$getFtpUser.class | Bin 1901 -> 1901 bytes .../bin/server/Server$Processor$getImageData.class | Bin 2047 -> 2047 bytes .../bin/server/Server$Processor$getImageList.class | Bin 1939 -> 1939 bytes .../server/Server$Processor$getLectureData.class | Bin 2036 -> 2036 bytes .../server/Server$Processor$getLectureList.class | Bin 1971 -> 1971 bytes .../server/Server$Processor$getPathOfImage.class | Bin 2060 -> 2060 bytes .../server/Server$Processor$getPersonData.class | Bin 2059 -> 2059 bytes .../server/Server$Processor$startFileCopy.class | Bin 2029 -> 2029 bytes .../server/Server$Processor$updateImageData.class | Bin 2279 -> 2279 bytes .../server/Server$Processor$writeLecturedata.class | Bin 2563 -> 2563 bytes .../bin/server/Server$Processor$writeVLdata.class | Bin 2390 -> 2390 bytes .../bin/server/Server$Processor.class | Bin 3210 -> 3313 bytes .../bin/server/Server$getAllOS_args$_Fields.class | Bin 2848 -> 2848 bytes ...getAllOS_args$getAllOS_argsStandardScheme.class | Bin 2153 -> 2153 bytes ...S_args$getAllOS_argsStandardSchemeFactory.class | Bin 1082 -> 1082 bytes ...er$getAllOS_args$getAllOS_argsTupleScheme.class | Bin 1463 -> 1463 bytes ...llOS_args$getAllOS_argsTupleSchemeFactory.class | Bin 1058 -> 1058 bytes .../bin/server/Server$getAllOS_args.class | Bin 7328 -> 7328 bytes .../server/Server$getAllOS_result$_Fields.class | Bin 2980 -> 2980 bytes ...llOS_result$getAllOS_resultStandardScheme.class | Bin 3464 -> 3464 bytes ...sult$getAllOS_resultStandardSchemeFactory.class | Bin 1114 -> 1114 bytes ...etAllOS_result$getAllOS_resultTupleScheme.class | Bin 2849 -> 2849 bytes ..._result$getAllOS_resultTupleSchemeFactory.class | Bin 1090 -> 1090 bytes .../bin/server/Server$getAllOS_result.class | Bin 10548 -> 10548 bytes .../server/Server$getFtpUser_args$_Fields.class | Bin 2868 -> 2868 bytes ...tpUser_args$getFtpUser_argsStandardScheme.class | Bin 2177 -> 2177 bytes ...args$getFtpUser_argsStandardSchemeFactory.class | Bin 1114 -> 1114 bytes ...etFtpUser_args$getFtpUser_argsTupleScheme.class | Bin 1487 -> 1487 bytes ...er_args$getFtpUser_argsTupleSchemeFactory.class | Bin 1090 -> 1090 bytes .../bin/server/Server$getFtpUser_args.class | Bin 7400 -> 7400 bytes .../server/Server$getFtpUser_result$_Fields.class | Bin 3000 -> 3000 bytes ...er_result$getFtpUser_resultStandardScheme.class | Bin 2624 -> 2624 bytes ...lt$getFtpUser_resultStandardSchemeFactory.class | Bin 1146 -> 1146 bytes ...pUser_result$getFtpUser_resultTupleScheme.class | Bin 2111 -> 2111 bytes ...esult$getFtpUser_resultTupleSchemeFactory.class | Bin 1122 -> 1122 bytes .../bin/server/Server$getFtpUser_result.class | Bin 9665 -> 9665 bytes .../server/Server$getImageData_args$_Fields.class | Bin 3094 -> 3094 bytes ...Data_args$getImageData_argsStandardScheme.class | Bin 2811 -> 2811 bytes ...gs$getImageData_argsStandardSchemeFactory.class | Bin 1146 -> 1146 bytes ...ageData_args$getImageData_argsTupleScheme.class | Bin 2278 -> 2278 bytes ..._args$getImageData_argsTupleSchemeFactory.class | Bin 1122 -> 1122 bytes .../bin/server/Server$getImageData_args.class | Bin 10767 -> 10767 bytes .../Server$getImageData_result$_Fields.class | Bin 3020 -> 3020 bytes ..._result$getImageData_resultStandardScheme.class | Bin 3869 -> 3869 bytes ...$getImageData_resultStandardSchemeFactory.class | Bin 1178 -> 1178 bytes ...ata_result$getImageData_resultTupleScheme.class | Bin 3261 -> 3261 bytes ...ult$getImageData_resultTupleSchemeFactory.class | Bin 1154 -> 1154 bytes .../bin/server/Server$getImageData_result.class | Bin 10534 -> 10534 bytes .../server/Server$getImageList_args$_Fields.class | Bin 2888 -> 2888 bytes ...List_args$getImageList_argsStandardScheme.class | Bin 2201 -> 2201 bytes ...gs$getImageList_argsStandardSchemeFactory.class | Bin 1146 -> 1146 bytes ...ageList_args$getImageList_argsTupleScheme.class | Bin 1511 -> 1511 bytes ..._args$getImageList_argsTupleSchemeFactory.class | Bin 1122 -> 1122 bytes .../bin/server/Server$getImageList_args.class | Bin 7472 -> 7472 bytes .../Server$getImageList_result$_Fields.class | Bin 3020 -> 3020 bytes ..._result$getImageList_resultStandardScheme.class | Bin 3488 -> 3488 bytes ...$getImageList_resultStandardSchemeFactory.class | Bin 1178 -> 1178 bytes ...ist_result$getImageList_resultTupleScheme.class | Bin 2873 -> 2873 bytes ...ult$getImageList_resultTupleSchemeFactory.class | Bin 1154 -> 1154 bytes .../bin/server/Server$getImageList_result.class | Bin 10892 -> 10892 bytes .../Server$getLectureData_args$_Fields.class | Bin 3028 -> 3028 bytes ...ta_args$getLectureData_argsStandardScheme.class | Bin 2654 -> 2654 bytes ...$getLectureData_argsStandardSchemeFactory.class | Bin 1178 -> 1178 bytes ...eData_args$getLectureData_argsTupleScheme.class | Bin 2145 -> 2145 bytes ...rgs$getLectureData_argsTupleSchemeFactory.class | Bin 1154 -> 1154 bytes .../bin/server/Server$getLectureData_args.class | Bin 9574 -> 9574 bytes .../Server$getLectureData_result$_Fields.class | Bin 3040 -> 3040 bytes ...esult$getLectureData_resultStandardScheme.class | Bin 3893 -> 3893 bytes ...etLectureData_resultStandardSchemeFactory.class | Bin 1210 -> 1210 bytes ...a_result$getLectureData_resultTupleScheme.class | Bin 3285 -> 3285 bytes ...t$getLectureData_resultTupleSchemeFactory.class | Bin 1186 -> 1186 bytes .../bin/server/Server$getLectureData_result.class | Bin 10610 -> 10610 bytes .../Server$getLectureList_args$_Fields.class | Bin 2908 -> 2908 bytes ...st_args$getLectureList_argsStandardScheme.class | Bin 2225 -> 2225 bytes ...$getLectureList_argsStandardSchemeFactory.class | Bin 1178 -> 1178 bytes ...eList_args$getLectureList_argsTupleScheme.class | Bin 1535 -> 1535 bytes ...rgs$getLectureList_argsTupleSchemeFactory.class | Bin 1154 -> 1154 bytes .../bin/server/Server$getLectureList_args.class | Bin 7544 -> 7544 bytes .../Server$getLectureList_result$_Fields.class | Bin 3040 -> 3040 bytes ...esult$getLectureList_resultStandardScheme.class | Bin 3518 -> 3518 bytes ...etLectureList_resultStandardSchemeFactory.class | Bin 1210 -> 1210 bytes ...t_result$getLectureList_resultTupleScheme.class | Bin 2905 -> 2905 bytes ...t$getLectureList_resultTupleSchemeFactory.class | Bin 1186 -> 1186 bytes .../bin/server/Server$getLectureList_result.class | Bin 10984 -> 10984 bytes .../Server$getPathOfImage_args$_Fields.class | Bin 3106 -> 3106 bytes ...ge_args$getPathOfImage_argsStandardScheme.class | Bin 2827 -> 2827 bytes ...$getPathOfImage_argsStandardSchemeFactory.class | Bin 1178 -> 1178 bytes ...Image_args$getPathOfImage_argsTupleScheme.class | Bin 2290 -> 2290 bytes ...rgs$getPathOfImage_argsTupleSchemeFactory.class | Bin 1154 -> 1154 bytes .../bin/server/Server$getPathOfImage_args.class | Bin 10797 -> 10797 bytes .../Server$getPathOfImage_result$_Fields.class | Bin 3040 -> 3040 bytes ...esult$getPathOfImage_resultStandardScheme.class | Bin 2670 -> 2670 bytes ...etPathOfImage_resultStandardSchemeFactory.class | Bin 1210 -> 1210 bytes ...e_result$getPathOfImage_resultTupleScheme.class | Bin 2157 -> 2157 bytes ...t$getPathOfImage_resultTupleSchemeFactory.class | Bin 1186 -> 1186 bytes .../bin/server/Server$getPathOfImage_result.class | Bin 9604 -> 9604 bytes .../server/Server$getPersonData_args$_Fields.class | Bin 3096 -> 3096 bytes ...ata_args$getPersonData_argsStandardScheme.class | Bin 2815 -> 2815 bytes ...s$getPersonData_argsStandardSchemeFactory.class | Bin 1162 -> 1162 bytes ...onData_args$getPersonData_argsTupleScheme.class | Bin 2278 -> 2278 bytes ...args$getPersonData_argsTupleSchemeFactory.class | Bin 1138 -> 1138 bytes .../bin/server/Server$getPersonData_args.class | Bin 10760 -> 10760 bytes .../Server$getPersonData_result$_Fields.class | Bin 3030 -> 3030 bytes ...result$getPersonData_resultStandardScheme.class | Bin 3881 -> 3881 bytes ...getPersonData_resultStandardSchemeFactory.class | Bin 1194 -> 1194 bytes ...ta_result$getPersonData_resultTupleScheme.class | Bin 3273 -> 3273 bytes ...lt$getPersonData_resultTupleSchemeFactory.class | Bin 1170 -> 1170 bytes .../bin/server/Server$getPersonData_result.class | Bin 10572 -> 10572 bytes .../server/Server$startFileCopy_args$_Fields.class | Bin 3004 -> 3004 bytes ...opy_args$startFileCopy_argsStandardScheme.class | Bin 2628 -> 2628 bytes ...s$startFileCopy_argsStandardSchemeFactory.class | Bin 1162 -> 1162 bytes ...leCopy_args$startFileCopy_argsTupleScheme.class | Bin 2112 -> 2112 bytes ...args$startFileCopy_argsTupleSchemeFactory.class | Bin 1138 -> 1138 bytes .../bin/server/Server$startFileCopy_args.class | Bin 9460 -> 9460 bytes .../Server$startFileCopy_result$_Fields.class | Bin 3030 -> 3030 bytes ...result$startFileCopy_resultStandardScheme.class | Bin 2620 -> 2620 bytes ...startFileCopy_resultStandardSchemeFactory.class | Bin 1194 -> 1194 bytes ...py_result$startFileCopy_resultTupleScheme.class | Bin 2077 -> 2077 bytes ...lt$startFileCopy_resultTupleSchemeFactory.class | Bin 1170 -> 1170 bytes .../bin/server/Server$startFileCopy_result.class | Bin 9724 -> 9724 bytes .../Server$updateImageData_args$_Fields.class | Bin 3587 -> 3587 bytes ...a_args$updateImageData_argsStandardScheme.class | Bin 3944 -> 3944 bytes ...updateImageData_argsStandardSchemeFactory.class | Bin 1194 -> 1194 bytes ...Data_args$updateImageData_argsTupleScheme.class | Bin 3289 -> 3289 bytes ...gs$updateImageData_argsTupleSchemeFactory.class | Bin 1170 -> 1170 bytes .../bin/server/Server$updateImageData_args.class | Bin 18468 -> 18468 bytes .../Server$updateImageData_result$_Fields.class | Bin 3050 -> 3050 bytes ...sult$updateImageData_resultStandardScheme.class | Bin 2644 -> 2644 bytes ...dateImageData_resultStandardSchemeFactory.class | Bin 1226 -> 1226 bytes ..._result$updateImageData_resultTupleScheme.class | Bin 2101 -> 2101 bytes ...$updateImageData_resultTupleSchemeFactory.class | Bin 1202 -> 1202 bytes .../bin/server/Server$updateImageData_result.class | Bin 9798 -> 9798 bytes .../Server$writeLecturedata_args$_Fields.class | Bin 4053 -> 4053 bytes ..._args$writeLecturedata_argsStandardScheme.class | Bin 4862 -> 4862 bytes ...riteLecturedata_argsStandardSchemeFactory.class | Bin 1210 -> 1210 bytes ...ata_args$writeLecturedata_argsTupleScheme.class | Bin 4056 -> 4056 bytes ...s$writeLecturedata_argsTupleSchemeFactory.class | Bin 1186 -> 1186 bytes .../bin/server/Server$writeLecturedata_args.class | Bin 24604 -> 24604 bytes .../Server$writeLecturedata_result$_Fields.class | Bin 3060 -> 3060 bytes ...ult$writeLecturedata_resultStandardScheme.class | Bin 2656 -> 2656 bytes ...teLecturedata_resultStandardSchemeFactory.class | Bin 1242 -> 1242 bytes ...result$writeLecturedata_resultTupleScheme.class | Bin 2113 -> 2113 bytes ...writeLecturedata_resultTupleSchemeFactory.class | Bin 1218 -> 1218 bytes .../server/Server$writeLecturedata_result.class | Bin 9835 -> 9835 bytes .../server/Server$writeVLdata_args$_Fields.class | Bin 3914 -> 3914 bytes ...Ldata_args$writeVLdata_argsStandardScheme.class | Bin 4637 -> 4637 bytes ...rgs$writeVLdata_argsStandardSchemeFactory.class | Bin 1130 -> 1130 bytes ...teVLdata_args$writeVLdata_argsTupleScheme.class | Bin 3886 -> 3886 bytes ...a_args$writeVLdata_argsTupleSchemeFactory.class | Bin 1106 -> 1106 bytes .../bin/server/Server$writeVLdata_args.class | Bin 23310 -> 23310 bytes .../server/Server$writeVLdata_result$_Fields.class | Bin 3010 -> 3010 bytes ...a_result$writeVLdata_resultStandardScheme.class | Bin 2596 -> 2596 bytes ...t$writeVLdata_resultStandardSchemeFactory.class | Bin 1162 -> 1162 bytes ...data_result$writeVLdata_resultTupleScheme.class | Bin 2053 -> 2053 bytes ...sult$writeVLdata_resultTupleSchemeFactory.class | Bin 1138 -> 1138 bytes .../bin/server/Server$writeVLdata_result.class | Bin 9650 -> 9650 bytes Dozentenmodulserver/bin/server/Server.class | Bin 2354 -> 2508 bytes Dozentenmodulserver/bin/server/ServerHandler.class | Bin 10530 -> 11027 bytes .../bin/server/User$UserStandardScheme.class | Bin 2769 -> 2737 bytes .../server/User$UserStandardSchemeFactory.class | Bin 853 -> 853 bytes .../bin/server/User$UserTupleScheme.class | Bin 2173 -> 2173 bytes .../bin/server/User$UserTupleSchemeFactory.class | Bin 829 -> 829 bytes Dozentenmodulserver/bin/server/User$_Fields.class | Bin 2946 -> 2938 bytes Dozentenmodulserver/bin/server/User.class | Bin 11400 -> 11240 bytes Dozentenmodulserver/bin/sql/SQL.class | Bin 13630 -> 14453 bytes Dozentenmodulserver/src/server/Server.java | 2296 ++++++++++++++++++++ Dozentenmodulserver/src/server/ServerHandler.java | 11 + Dozentenmodulserver/src/server/User.java | 1154 +++++----- Dozentenmodulserver/src/sql/SQL.java | 52 + Dozentenmodulserver/thrift/server.thrift | 1 + 255 files changed, 3026 insertions(+), 608 deletions(-) (limited to 'Dozentenmodulserver/src') diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class index 8feae5df..e3beaa57 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI$8.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class index bddb3425..cec2cfad 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPCreateUploader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class index 40fe319c..28596b7f 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class index 30c1812c..8b17dab5 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class index 6d6c863c..0b03bc49 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class index ef04eb8c..75c93b92 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class index d4bc6778..0c97260a 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class index 623a9c0e..842bbb87 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI$6.class differ diff --git a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class index c8860206..0f9f8a09 100644 Binary files a/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class and b/Dozentenmodul/bin/gui/image/FTPDownloader_GUI.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class index a5df5dde..a064efc0 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$1.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$1.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class index e012848d..9c179a21 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$2.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$2.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$3.class b/Dozentenmodul/bin/gui/intro/Login_GUI$3.class index 110634ac..33e222c7 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$3.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$3.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class index 6a5edcf2..0fa234c1 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$4.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$4.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI$5.class b/Dozentenmodul/bin/gui/intro/Login_GUI$5.class index 95da5c83..c09574b4 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI$5.class and b/Dozentenmodul/bin/gui/intro/Login_GUI$5.class differ diff --git a/Dozentenmodul/bin/gui/intro/Login_GUI.class b/Dozentenmodul/bin/gui/intro/Login_GUI.class index 26499333..7f627245 100644 Binary files a/Dozentenmodul/bin/gui/intro/Login_GUI.class and b/Dozentenmodul/bin/gui/intro/Login_GUI.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class index f7b6f6b6..9b8c9ed9 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class and b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardScheme.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class index 245e7cdc..132cbe65 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class and b/Dozentenmodul/bin/thrift/SessionData$SessionDataStandardSchemeFactory.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class index 9c968929..eaa4e9a6 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class and b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleScheme.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class index 2c83a82f..0abd2b91 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class and b/Dozentenmodul/bin/thrift/SessionData$SessionDataTupleSchemeFactory.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData$_Fields.class b/Dozentenmodul/bin/thrift/SessionData$_Fields.class index 13a9da4f..8a9df0f6 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData$_Fields.class and b/Dozentenmodul/bin/thrift/SessionData$_Fields.class differ diff --git a/Dozentenmodul/bin/thrift/SessionData.class b/Dozentenmodul/bin/thrift/SessionData.class index f8597a01..f084b247 100644 Binary files a/Dozentenmodul/bin/thrift/SessionData.class and b/Dozentenmodul/bin/thrift/SessionData.class differ diff --git a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java index e8c0c4b9..81e34dcc 100644 --- a/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPCreateUploader_GUI.java @@ -350,6 +350,7 @@ public class FTPCreateUploader_GUI extends JFrame implements btnZurck.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dispose(); + thrift.closeThriftConnection(); CreateImageTechnisch_GUI m = new CreateImageTechnisch_GUI(); m.setVisible(true); } diff --git a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java index 4a54e346..dd8782f3 100644 --- a/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java +++ b/Dozentenmodul/src/gui/image/FTPDownloader_GUI.java @@ -47,8 +47,6 @@ public class FTPDownloader_GUI extends JFrame implements PropertyChangeListener JProgressBar progressBar; String host = "141.79.128.121"; int port = 21; - String username = "openslx"; - String password = "openslx-ng"; String downloadFile = ""; static String arg = ""; DownloadTask task; diff --git a/Dozentenmodul/src/gui/intro/Login_GUI.java b/Dozentenmodul/src/gui/intro/Login_GUI.java index 488c6b69..e2db747e 100644 --- a/Dozentenmodul/src/gui/intro/Login_GUI.java +++ b/Dozentenmodul/src/gui/intro/Login_GUI.java @@ -12,6 +12,8 @@ import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.io.File; import java.io.IOException; +import java.nio.channels.SeekableByteChannel; + import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; @@ -23,6 +25,8 @@ import javax.swing.JTextField; import javax.swing.UIManager; import javax.swing.UnsupportedLookAndFeelException; import javax.swing.border.EmptyBorder; + +import models.SessionData; import models.person; import org.apache.thrift.TException; import org.ini4j.Wini; @@ -179,6 +183,10 @@ public class Login_GUI extends JFrame { String passText = new String(pass.getPassword()); System.out.println("Benutzer:" +username.getText() + "\nPasswort" + passText); result = client.authenticate(username.getText(), passText); + SessionData.session.setAuthToken(result.authToken); + SessionData.session.setSessionID(result.sessionId); + SessionData.session.setServerAdress(result.serverAddress); + System.out.println("Server Adresse: "+result.serverAddress); } catch (thrift.AuthenticationException e) { System.out.println("Authentifizierung fehlgeschlagen: " + e.message); @@ -232,6 +240,7 @@ public class Login_GUI extends JFrame { person.verantwortlicher.setVorname(user.firstName); person.verantwortlicher.setEMail(user.eMail); person.verantwortlicher.setHochschule(hochschule); + // Öffne das Hauprmenü MainMenue_GUI main = new MainMenue_GUI(); main.setVisible(true); diff --git a/Dozentenmodul/src/thrift/SessionData.java b/Dozentenmodul/src/thrift/SessionData.java index 98ef43b4..51f0f80b 100644 --- a/Dozentenmodul/src/thrift/SessionData.java +++ b/Dozentenmodul/src/thrift/SessionData.java @@ -37,6 +37,7 @@ public class SessionData implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); static { @@ -46,11 +47,13 @@ public class SessionData implements org.apache.thrift.TBase byName = new HashMap(); @@ -69,6 +72,8 @@ public class SessionData implements org.apache.thrift.TBase 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 { @@ -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 extends org.apache.thrift.TBaseProcessor 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 extends org.apache.thrift.ProcessFunction { + 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 extends org.apache.thrift.TBaseAsyncProcessor { @@ -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 extends org.apache.thrift.AsyncProcessFunction { + public updateLecturedata() { + super("updateLecturedata"); + } + + public updateLecturedata_args getEmptyArgsInstance() { + return new updateLecturedata_args(); + } + + public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback() { + 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 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, java.io.Serializable, Cloneable, Comparable { @@ -14304,4 +14494,2110 @@ public class Server { } + public static class updateLecturedata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // 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 other. + */ + 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 { + + 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 { + + @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, java.io.Serializable, Cloneable, Comparable { + 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 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 other. + */ + 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 { + + 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 { + + @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, - java.io.Serializable, Cloneable, Comparable { - 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); - - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); - } - } - - /** - * Find the _Fields constant that matches fieldId, or null if its not - * found. - */ - public static _Fields findByThriftId(int fieldId) { - switch (fieldId) { - case -1: // USER_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 other. - */ - 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 { - - 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 { - - @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, java.io.Serializable, Cloneable, Comparable { + 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, SchemeFactory> schemes = new HashMap, 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 byName = new HashMap(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case -1: // USER_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 other. + */ + 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 { + + 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 { + + @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; + + } } diff --git a/Dozentenmodulserver/thrift/server.thrift b/Dozentenmodulserver/thrift/server.thrift index 8f845bff..2bcc9ba1 100644 --- a/Dozentenmodulserver/thrift/server.thrift +++ b/Dozentenmodulserver/thrift/server.thrift @@ -46,4 +46,5 @@ service Server{ map getImageData(string imageid, string imageversion), bool updateImageData(string name, string newName,bool license, bool internet, int ram,int cpu, string id, string version), map getLectureData(string lecturename), + bool updateLecturedata(string name, string newName ,string shortdesc, string desc,string startDate, string endDate, bool isActive, string imagename,string firstname,string lastname, string university, string Mail, string Tel,string Fak, string id), } \ No newline at end of file -- cgit v1.2.3-55-g7522