summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java')
-rw-r--r--dozentenmodulserver/src/main/java/server/ServerHandler.java15
-rw-r--r--dozentenmodulserver/src/main/java/server/generated/Server.java1152
-rw-r--r--dozentenmodulserver/src/main/java/sql/SQL.java208
3 files changed, 1178 insertions, 197 deletions
diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java
index 179c2c1c..5676339a 100644
--- a/dozentenmodulserver/src/main/java/server/ServerHandler.java
+++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java
@@ -84,7 +84,6 @@ public class ServerHandler implements Server.Iface {
try {
Runtime.getRuntime().exec("chmod 777 " + path);
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
log.info("folder '" + path + "' successfully created");
@@ -119,7 +118,6 @@ public class ServerHandler implements Server.Iface {
try {
Runtime.getRuntime().exec("chmod 777 " + path);
} catch (IOException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
log.info("folder '" + path
@@ -194,7 +192,6 @@ public class ServerHandler implements Server.Iface {
imagePath, filesize, mode, pk_os);
log.info("written VLdata");
- // TODO Auto-generated method stub
return true;
}
@@ -271,13 +268,10 @@ public class ServerHandler implements Server.Iface {
xml.create(name);
log.info("XML created.");
} catch (SQLException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (ParserConfigurationException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
} catch (TransformerException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
@@ -303,7 +297,6 @@ public class ServerHandler implements Server.Iface {
}
} catch (IOException e) {
- // TODO Auto-generated catch block
log.info("Failed to move file.");
e.printStackTrace();
}
@@ -383,7 +376,6 @@ public class ServerHandler implements Server.Iface {
try {
FileUtils.forceDelete(tmpFile);
} catch (IOException e1) {
- // TODO Auto-generated catch block
e1.printStackTrace();
}
XMLCreator xml = new XMLCreator(sql.getConnection(), newName);
@@ -391,7 +383,6 @@ public class ServerHandler implements Server.Iface {
xml.create(newName);
} catch (SQLException | ParserConfigurationException
| TransformerException e) {
- // TODO Auto-generated catch block
e.printStackTrace();
}
@@ -436,7 +427,6 @@ public class ServerHandler implements Server.Iface {
@Override
public boolean connectedToLecture(String id, String version)
throws TException {
- // TODO Auto-generated method stub
return sql.connectedToLecture(id, version);
}
@@ -678,5 +668,10 @@ public class ServerHandler implements Server.Iface {
return sql.getOsNameForGuestOs(guestOS);
}
+ @Override
+ public Map<String, String> getItemOwner(String itemID) throws TException {
+ return sql.getItemOwner(itemID);
+ }
+
}// end class
diff --git a/dozentenmodulserver/src/main/java/server/generated/Server.java b/dozentenmodulserver/src/main/java/server/generated/Server.java
index fc1e7dae..b4458cc2 100644
--- a/dozentenmodulserver/src/main/java/server/generated/Server.java
+++ b/dozentenmodulserver/src/main/java/server/generated/Server.java
@@ -72,6 +72,8 @@ public class Server {
public Map<String,String> getPersonData(String Vorname, String Nachname) throws org.apache.thrift.TException;
+ public Map<String,String> getItemOwner(String itemID) throws org.apache.thrift.TException;
+
public void setPerson(String login, String lastname, String firstname, String mail, String Institution) throws org.apache.thrift.TException;
public boolean writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak) throws org.apache.thrift.TException;
@@ -160,6 +162,8 @@ public class Server {
public void getPersonData(String Vorname, String Nachname, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+ public void getItemOwner(String itemID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+
public void setPerson(String login, String lastname, String firstname, String mail, String Institution, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void writeLecturedata(String name, String shortdesc, String desc, String startDate, String endDate, boolean isActive, String imagename, String login, String firstname, String lastname, String university, String Mail, String Tel, String Fak, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
@@ -658,6 +662,29 @@ public class Server {
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getPersonData failed: unknown result");
}
+ public Map<String,String> getItemOwner(String itemID) throws org.apache.thrift.TException
+ {
+ send_getItemOwner(itemID);
+ return recv_getItemOwner();
+ }
+
+ public void send_getItemOwner(String itemID) throws org.apache.thrift.TException
+ {
+ getItemOwner_args args = new getItemOwner_args();
+ args.setItemID(itemID);
+ sendBase("getItemOwner", args);
+ }
+
+ public Map<String,String> recv_getItemOwner() throws org.apache.thrift.TException
+ {
+ getItemOwner_result result = new getItemOwner_result();
+ receiveBase(result, "getItemOwner");
+ if (result.isSetSuccess()) {
+ return result.success;
+ }
+ throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getItemOwner failed: unknown result");
+ }
+
public void setPerson(String login, String lastname, String firstname, String mail, String Institution) throws org.apache.thrift.TException
{
send_setPerson(login, lastname, firstname, mail, Institution);
@@ -1918,6 +1945,38 @@ public class Server {
}
}
+ public void getItemOwner(String itemID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+ checkReady();
+ getItemOwner_call method_call = new getItemOwner_call(itemID, resultHandler, this, ___protocolFactory, ___transport);
+ this.___currentMethod = method_call;
+ ___manager.call(method_call);
+ }
+
+ public static class getItemOwner_call extends org.apache.thrift.async.TAsyncMethodCall {
+ private String itemID;
+ public getItemOwner_call(String itemID, 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.itemID = itemID;
+ }
+
+ public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
+ prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getItemOwner", org.apache.thrift.protocol.TMessageType.CALL, 0));
+ getItemOwner_args args = new getItemOwner_args();
+ args.setItemID(itemID);
+ args.write(prot);
+ prot.writeMessageEnd();
+ }
+
+ public Map<String,String> getResult() throws org.apache.thrift.TException {
+ if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
+ throw new IllegalStateException("Method call not finished!");
+ }
+ org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
+ org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
+ return (new Client(prot)).recv_getItemOwner();
+ }
+ }
+
public void setPerson(String login, String lastname, String firstname, String mail, String Institution, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
setPerson_call method_call = new setPerson_call(login, lastname, firstname, mail, Institution, resultHandler, this, ___protocolFactory, ___transport);
@@ -2960,6 +3019,7 @@ public class Server {
processMap.put("getAllOS", new getAllOS());
processMap.put("getAllUniversities", new getAllUniversities());
processMap.put("getPersonData", new getPersonData());
+ processMap.put("getItemOwner", new getItemOwner());
processMap.put("setPerson", new setPerson());
processMap.put("writeLecturedata", new writeLecturedata());
processMap.put("startFileCopy", new startFileCopy());
@@ -3349,6 +3409,26 @@ public class Server {
}
}
+ public static class getItemOwner<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getItemOwner_args> {
+ public getItemOwner() {
+ super("getItemOwner");
+ }
+
+ public getItemOwner_args getEmptyArgsInstance() {
+ return new getItemOwner_args();
+ }
+
+ protected boolean isOneway() {
+ return false;
+ }
+
+ public getItemOwner_result getResult(I iface, getItemOwner_args args) throws org.apache.thrift.TException {
+ getItemOwner_result result = new getItemOwner_result();
+ result.success = iface.getItemOwner(args.itemID);
+ return result;
+ }
+ }
+
public static class setPerson<I extends Iface> extends org.apache.thrift.ProcessFunction<I, setPerson_args> {
public setPerson() {
super("setPerson");
@@ -3874,6 +3954,7 @@ public class Server {
processMap.put("getAllOS", new getAllOS());
processMap.put("getAllUniversities", new getAllUniversities());
processMap.put("getPersonData", new getPersonData());
+ processMap.put("getItemOwner", new getItemOwner());
processMap.put("setPerson", new setPerson());
processMap.put("writeLecturedata", new writeLecturedata());
processMap.put("startFileCopy", new startFileCopy());
@@ -4821,6 +4902,57 @@ public class Server {
}
}
+ public static class getItemOwner<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getItemOwner_args, Map<String,String>> {
+ public getItemOwner() {
+ super("getItemOwner");
+ }
+
+ public getItemOwner_args getEmptyArgsInstance() {
+ return new getItemOwner_args();
+ }
+
+ public AsyncMethodCallback<Map<String,String>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
+ final org.apache.thrift.AsyncProcessFunction fcall = this;
+ return new AsyncMethodCallback<Map<String,String>>() {
+ public void onComplete(Map<String,String> o) {
+ getItemOwner_result result = new getItemOwner_result();
+ result.success = o;
+ 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;
+ getItemOwner_result result = new getItemOwner_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, getItemOwner_args args, org.apache.thrift.async.AsyncMethodCallback<Map<String,String>> resultHandler) throws TException {
+ iface.getItemOwner(args.itemID,resultHandler);
+ }
+ }
+
public static class setPerson<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, setPerson_args, Void> {
public setPerson() {
super("setPerson");
@@ -20819,6 +20951,766 @@ public class Server {
}
+ public static class getItemOwner_args implements org.apache.thrift.TBase<getItemOwner_args, getItemOwner_args._Fields>, java.io.Serializable, Cloneable, Comparable<getItemOwner_args> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemOwner_args");
+
+ private static final org.apache.thrift.protocol.TField ITEM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("itemID", org.apache.thrift.protocol.TType.STRING, (short)1);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getItemOwner_argsStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getItemOwner_argsTupleSchemeFactory());
+ }
+
+ public String itemID; // 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 {
+ ITEM_ID((short)1, "itemID");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 1: // ITEM_ID
+ return ITEM_ID;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.ITEM_ID, new org.apache.thrift.meta_data.FieldMetaData("itemID", 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(getItemOwner_args.class, metaDataMap);
+ }
+
+ public getItemOwner_args() {
+ }
+
+ public getItemOwner_args(
+ String itemID)
+ {
+ this();
+ this.itemID = itemID;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getItemOwner_args(getItemOwner_args other) {
+ if (other.isSetItemID()) {
+ this.itemID = other.itemID;
+ }
+ }
+
+ public getItemOwner_args deepCopy() {
+ return new getItemOwner_args(this);
+ }
+
+ @Override
+ public void clear() {
+ this.itemID = null;
+ }
+
+ public String getItemID() {
+ return this.itemID;
+ }
+
+ public getItemOwner_args setItemID(String itemID) {
+ this.itemID = itemID;
+ return this;
+ }
+
+ public void unsetItemID() {
+ this.itemID = null;
+ }
+
+ /** Returns true if field itemID is set (has been assigned a value) and false otherwise */
+ public boolean isSetItemID() {
+ return this.itemID != null;
+ }
+
+ public void setItemIDIsSet(boolean value) {
+ if (!value) {
+ this.itemID = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case ITEM_ID:
+ if (value == null) {
+ unsetItemID();
+ } else {
+ setItemID((String)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case ITEM_ID:
+ return getItemID();
+
+ }
+ 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 ITEM_ID:
+ return isSetItemID();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getItemOwner_args)
+ return this.equals((getItemOwner_args)that);
+ return false;
+ }
+
+ public boolean equals(getItemOwner_args that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_itemID = true && this.isSetItemID();
+ boolean that_present_itemID = true && that.isSetItemID();
+ if (this_present_itemID || that_present_itemID) {
+ if (!(this_present_itemID && that_present_itemID))
+ return false;
+ if (!this.itemID.equals(that.itemID))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getItemOwner_args other) {
+ if (!getClass().equals(other.getClass())) {
+ return getClass().getName().compareTo(other.getClass().getName());
+ }
+
+ int lastComparison = 0;
+
+ lastComparison = Boolean.valueOf(isSetItemID()).compareTo(other.isSetItemID());
+ if (lastComparison != 0) {
+ return lastComparison;
+ }
+ if (isSetItemID()) {
+ lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.itemID, other.itemID);
+ 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("getItemOwner_args(");
+ boolean first = true;
+
+ sb.append("itemID:");
+ if (this.itemID == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.itemID);
+ }
+ 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 getItemOwner_argsStandardSchemeFactory implements SchemeFactory {
+ public getItemOwner_argsStandardScheme getScheme() {
+ return new getItemOwner_argsStandardScheme();
+ }
+ }
+
+ private static class getItemOwner_argsStandardScheme extends StandardScheme<getItemOwner_args> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getItemOwner_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: // ITEM_ID
+ if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+ struct.itemID = iprot.readString();
+ struct.setItemIDIsSet(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, getItemOwner_args struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.itemID != null) {
+ oprot.writeFieldBegin(ITEM_ID_FIELD_DESC);
+ oprot.writeString(struct.itemID);
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getItemOwner_argsTupleSchemeFactory implements SchemeFactory {
+ public getItemOwner_argsTupleScheme getScheme() {
+ return new getItemOwner_argsTupleScheme();
+ }
+ }
+
+ private static class getItemOwner_argsTupleScheme extends TupleScheme<getItemOwner_args> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getItemOwner_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetItemID()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetItemID()) {
+ oprot.writeString(struct.itemID);
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getItemOwner_args struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ struct.itemID = iprot.readString();
+ struct.setItemIDIsSet(true);
+ }
+ }
+ }
+
+ }
+
+ public static class getItemOwner_result implements org.apache.thrift.TBase<getItemOwner_result, getItemOwner_result._Fields>, java.io.Serializable, Cloneable, Comparable<getItemOwner_result> {
+ private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getItemOwner_result");
+
+ private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.MAP, (short)0);
+
+ private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
+ static {
+ schemes.put(StandardScheme.class, new getItemOwner_resultStandardSchemeFactory());
+ schemes.put(TupleScheme.class, new getItemOwner_resultTupleSchemeFactory());
+ }
+
+ public Map<String,String> success; // required
+
+ /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
+ public enum _Fields implements org.apache.thrift.TFieldIdEnum {
+ SUCCESS((short)0, "success");
+
+ private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
+
+ static {
+ for (_Fields field : EnumSet.allOf(_Fields.class)) {
+ byName.put(field.getFieldName(), field);
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, or null if its not found.
+ */
+ public static _Fields findByThriftId(int fieldId) {
+ switch(fieldId) {
+ case 0: // SUCCESS
+ return SUCCESS;
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * Find the _Fields constant that matches fieldId, throwing an exception
+ * if it is not found.
+ */
+ public static _Fields findByThriftIdOrThrow(int fieldId) {
+ _Fields fields = findByThriftId(fieldId);
+ if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
+ return fields;
+ }
+
+ /**
+ * Find the _Fields constant that matches name, or null if its not found.
+ */
+ public static _Fields findByName(String name) {
+ return byName.get(name);
+ }
+
+ private final short _thriftId;
+ private final String _fieldName;
+
+ _Fields(short thriftId, String fieldName) {
+ _thriftId = thriftId;
+ _fieldName = fieldName;
+ }
+
+ public short getThriftFieldId() {
+ return _thriftId;
+ }
+
+ public String getFieldName() {
+ return _fieldName;
+ }
+ }
+
+ // isset id assignments
+ public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
+ static {
+ Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
+ tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT,
+ new org.apache.thrift.meta_data.MapMetaData(org.apache.thrift.protocol.TType.MAP,
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING),
+ new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))));
+ metaDataMap = Collections.unmodifiableMap(tmpMap);
+ org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getItemOwner_result.class, metaDataMap);
+ }
+
+ public getItemOwner_result() {
+ }
+
+ public getItemOwner_result(
+ Map<String,String> success)
+ {
+ this();
+ this.success = success;
+ }
+
+ /**
+ * Performs a deep copy on <i>other</i>.
+ */
+ public getItemOwner_result(getItemOwner_result other) {
+ if (other.isSetSuccess()) {
+ Map<String,String> __this__success = new HashMap<String,String>(other.success);
+ this.success = __this__success;
+ }
+ }
+
+ public getItemOwner_result deepCopy() {
+ return new getItemOwner_result(this);
+ }
+
+ @Override
+ public void clear() {
+ this.success = null;
+ }
+
+ public int getSuccessSize() {
+ return (this.success == null) ? 0 : this.success.size();
+ }
+
+ public void putToSuccess(String key, String val) {
+ if (this.success == null) {
+ this.success = new HashMap<String,String>();
+ }
+ this.success.put(key, val);
+ }
+
+ public Map<String,String> getSuccess() {
+ return this.success;
+ }
+
+ public getItemOwner_result setSuccess(Map<String,String> success) {
+ this.success = success;
+ return this;
+ }
+
+ public void unsetSuccess() {
+ this.success = null;
+ }
+
+ /** Returns true if field success is set (has been assigned a value) and false otherwise */
+ public boolean isSetSuccess() {
+ return this.success != null;
+ }
+
+ public void setSuccessIsSet(boolean value) {
+ if (!value) {
+ this.success = null;
+ }
+ }
+
+ public void setFieldValue(_Fields field, Object value) {
+ switch (field) {
+ case SUCCESS:
+ if (value == null) {
+ unsetSuccess();
+ } else {
+ setSuccess((Map<String,String>)value);
+ }
+ break;
+
+ }
+ }
+
+ public Object getFieldValue(_Fields field) {
+ switch (field) {
+ case SUCCESS:
+ return getSuccess();
+
+ }
+ throw new IllegalStateException();
+ }
+
+ /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
+ public boolean isSet(_Fields field) {
+ if (field == null) {
+ throw new IllegalArgumentException();
+ }
+
+ switch (field) {
+ case SUCCESS:
+ return isSetSuccess();
+ }
+ throw new IllegalStateException();
+ }
+
+ @Override
+ public boolean equals(Object that) {
+ if (that == null)
+ return false;
+ if (that instanceof getItemOwner_result)
+ return this.equals((getItemOwner_result)that);
+ return false;
+ }
+
+ public boolean equals(getItemOwner_result that) {
+ if (that == null)
+ return false;
+
+ boolean this_present_success = true && this.isSetSuccess();
+ boolean that_present_success = true && that.isSetSuccess();
+ if (this_present_success || that_present_success) {
+ if (!(this_present_success && that_present_success))
+ return false;
+ if (!this.success.equals(that.success))
+ return false;
+ }
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ return 0;
+ }
+
+ @Override
+ public int compareTo(getItemOwner_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("getItemOwner_result(");
+ boolean first = true;
+
+ sb.append("success:");
+ if (this.success == null) {
+ sb.append("null");
+ } else {
+ sb.append(this.success);
+ }
+ first = false;
+ sb.append(")");
+ return sb.toString();
+ }
+
+ public void validate() throws org.apache.thrift.TException {
+ // check for required fields
+ // check for sub-struct validity
+ }
+
+ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
+ try {
+ write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException {
+ try {
+ read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in)));
+ } catch (org.apache.thrift.TException te) {
+ throw new java.io.IOException(te);
+ }
+ }
+
+ private static class getItemOwner_resultStandardSchemeFactory implements SchemeFactory {
+ public getItemOwner_resultStandardScheme getScheme() {
+ return new getItemOwner_resultStandardScheme();
+ }
+ }
+
+ private static class getItemOwner_resultStandardScheme extends StandardScheme<getItemOwner_result> {
+
+ public void read(org.apache.thrift.protocol.TProtocol iprot, getItemOwner_result struct) throws org.apache.thrift.TException {
+ org.apache.thrift.protocol.TField schemeField;
+ iprot.readStructBegin();
+ while (true)
+ {
+ schemeField = iprot.readFieldBegin();
+ if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
+ break;
+ }
+ switch (schemeField.id) {
+ case 0: // SUCCESS
+ if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
+ {
+ org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin();
+ struct.success = new HashMap<String,String>(2*_map106.size);
+ for (int _i107 = 0; _i107 < _map106.size; ++_i107)
+ {
+ String _key108;
+ String _val109;
+ _key108 = iprot.readString();
+ _val109 = iprot.readString();
+ struct.success.put(_key108, _val109);
+ }
+ iprot.readMapEnd();
+ }
+ struct.setSuccessIsSet(true);
+ } else {
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ break;
+ default:
+ org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+ }
+ iprot.readFieldEnd();
+ }
+ iprot.readStructEnd();
+
+ // check for required fields of primitive type, which can't be checked in the validate method
+ struct.validate();
+ }
+
+ public void write(org.apache.thrift.protocol.TProtocol oprot, getItemOwner_result struct) throws org.apache.thrift.TException {
+ struct.validate();
+
+ oprot.writeStructBegin(STRUCT_DESC);
+ if (struct.success != null) {
+ oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
+ {
+ oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
+ for (Map.Entry<String, String> _iter110 : struct.success.entrySet())
+ {
+ oprot.writeString(_iter110.getKey());
+ oprot.writeString(_iter110.getValue());
+ }
+ oprot.writeMapEnd();
+ }
+ oprot.writeFieldEnd();
+ }
+ oprot.writeFieldStop();
+ oprot.writeStructEnd();
+ }
+
+ }
+
+ private static class getItemOwner_resultTupleSchemeFactory implements SchemeFactory {
+ public getItemOwner_resultTupleScheme getScheme() {
+ return new getItemOwner_resultTupleScheme();
+ }
+ }
+
+ private static class getItemOwner_resultTupleScheme extends TupleScheme<getItemOwner_result> {
+
+ @Override
+ public void write(org.apache.thrift.protocol.TProtocol prot, getItemOwner_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol oprot = (TTupleProtocol) prot;
+ BitSet optionals = new BitSet();
+ if (struct.isSetSuccess()) {
+ optionals.set(0);
+ }
+ oprot.writeBitSet(optionals, 1);
+ if (struct.isSetSuccess()) {
+ {
+ oprot.writeI32(struct.success.size());
+ for (Map.Entry<String, String> _iter111 : struct.success.entrySet())
+ {
+ oprot.writeString(_iter111.getKey());
+ oprot.writeString(_iter111.getValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public void read(org.apache.thrift.protocol.TProtocol prot, getItemOwner_result struct) throws org.apache.thrift.TException {
+ TTupleProtocol iprot = (TTupleProtocol) prot;
+ BitSet incoming = iprot.readBitSet(1);
+ if (incoming.get(0)) {
+ {
+ org.apache.thrift.protocol.TMap _map112 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new HashMap<String,String>(2*_map112.size);
+ for (int _i113 = 0; _i113 < _map112.size; ++_i113)
+ {
+ String _key114;
+ String _val115;
+ _key114 = iprot.readString();
+ _val115 = iprot.readString();
+ struct.success.put(_key114, _val115);
+ }
+ }
+ struct.setSuccessIsSet(true);
+ }
+ }
+ }
+
+ }
+
public static class setPerson_args implements org.apache.thrift.TBase<setPerson_args, setPerson_args._Fields>, java.io.Serializable, Cloneable, Comparable<setPerson_args> {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("setPerson_args");
@@ -25290,15 +26182,15 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map106 = iprot.readMapBegin();
- struct.success = new HashMap<String,String>(2*_map106.size);
- for (int _i107 = 0; _i107 < _map106.size; ++_i107)
+ org.apache.thrift.protocol.TMap _map116 = iprot.readMapBegin();
+ struct.success = new HashMap<String,String>(2*_map116.size);
+ for (int _i117 = 0; _i117 < _map116.size; ++_i117)
{
- String _key108;
- String _val109;
- _key108 = iprot.readString();
- _val109 = iprot.readString();
- struct.success.put(_key108, _val109);
+ String _key118;
+ String _val119;
+ _key118 = iprot.readString();
+ _val119 = iprot.readString();
+ struct.success.put(_key118, _val119);
}
iprot.readMapEnd();
}
@@ -25326,10 +26218,10 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
- for (Map.Entry<String, String> _iter110 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter120 : struct.success.entrySet())
{
- oprot.writeString(_iter110.getKey());
- oprot.writeString(_iter110.getValue());
+ oprot.writeString(_iter120.getKey());
+ oprot.writeString(_iter120.getValue());
}
oprot.writeMapEnd();
}
@@ -25360,10 +26252,10 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Map.Entry<String, String> _iter111 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter121 : struct.success.entrySet())
{
- oprot.writeString(_iter111.getKey());
- oprot.writeString(_iter111.getValue());
+ oprot.writeString(_iter121.getKey());
+ oprot.writeString(_iter121.getValue());
}
}
}
@@ -25375,15 +26267,15 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map112 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.success = new HashMap<String,String>(2*_map112.size);
- for (int _i113 = 0; _i113 < _map112.size; ++_i113)
+ org.apache.thrift.protocol.TMap _map122 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new HashMap<String,String>(2*_map122.size);
+ for (int _i123 = 0; _i123 < _map122.size; ++_i123)
{
- String _key114;
- String _val115;
- _key114 = iprot.readString();
- _val115 = iprot.readString();
- struct.success.put(_key114, _val115);
+ String _key124;
+ String _val125;
+ _key124 = iprot.readString();
+ _val125 = iprot.readString();
+ struct.success.put(_key124, _val125);
}
}
struct.setSuccessIsSet(true);
@@ -26050,15 +26942,15 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.MAP) {
{
- org.apache.thrift.protocol.TMap _map116 = iprot.readMapBegin();
- struct.success = new HashMap<String,String>(2*_map116.size);
- for (int _i117 = 0; _i117 < _map116.size; ++_i117)
+ org.apache.thrift.protocol.TMap _map126 = iprot.readMapBegin();
+ struct.success = new HashMap<String,String>(2*_map126.size);
+ for (int _i127 = 0; _i127 < _map126.size; ++_i127)
{
- String _key118;
- String _val119;
- _key118 = iprot.readString();
- _val119 = iprot.readString();
- struct.success.put(_key118, _val119);
+ String _key128;
+ String _val129;
+ _key128 = iprot.readString();
+ _val129 = iprot.readString();
+ struct.success.put(_key128, _val129);
}
iprot.readMapEnd();
}
@@ -26086,10 +26978,10 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeMapBegin(new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, struct.success.size()));
- for (Map.Entry<String, String> _iter120 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter130 : struct.success.entrySet())
{
- oprot.writeString(_iter120.getKey());
- oprot.writeString(_iter120.getValue());
+ oprot.writeString(_iter130.getKey());
+ oprot.writeString(_iter130.getValue());
}
oprot.writeMapEnd();
}
@@ -26120,10 +27012,10 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Map.Entry<String, String> _iter121 : struct.success.entrySet())
+ for (Map.Entry<String, String> _iter131 : struct.success.entrySet())
{
- oprot.writeString(_iter121.getKey());
- oprot.writeString(_iter121.getValue());
+ oprot.writeString(_iter131.getKey());
+ oprot.writeString(_iter131.getValue());
}
}
}
@@ -26135,15 +27027,15 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TMap _map122 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.success = new HashMap<String,String>(2*_map122.size);
- for (int _i123 = 0; _i123 < _map122.size; ++_i123)
+ org.apache.thrift.protocol.TMap _map132 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new HashMap<String,String>(2*_map132.size);
+ for (int _i133 = 0; _i133 < _map132.size; ++_i133)
{
- String _key124;
- String _val125;
- _key124 = iprot.readString();
- _val125 = iprot.readString();
- struct.success.put(_key124, _val125);
+ String _key134;
+ String _val135;
+ _key134 = iprot.readString();
+ _val135 = iprot.readString();
+ struct.success.put(_key134, _val135);
}
}
struct.setSuccessIsSet(true);
@@ -40781,13 +41673,13 @@ public class Server {
case 1: // USER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list126 = iprot.readListBegin();
- struct.userID = new ArrayList<String>(_list126.size);
- for (int _i127 = 0; _i127 < _list126.size; ++_i127)
+ org.apache.thrift.protocol.TList _list136 = iprot.readListBegin();
+ struct.userID = new ArrayList<String>(_list136.size);
+ for (int _i137 = 0; _i137 < _list136.size; ++_i137)
{
- String _elem128;
- _elem128 = iprot.readString();
- struct.userID.add(_elem128);
+ String _elem138;
+ _elem138 = iprot.readString();
+ struct.userID.add(_elem138);
}
iprot.readListEnd();
}
@@ -40815,9 +41707,9 @@ public class Server {
oprot.writeFieldBegin(USER_ID_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.userID.size()));
- for (String _iter129 : struct.userID)
+ for (String _iter139 : struct.userID)
{
- oprot.writeString(_iter129);
+ oprot.writeString(_iter139);
}
oprot.writeListEnd();
}
@@ -40848,9 +41740,9 @@ public class Server {
if (struct.isSetUserID()) {
{
oprot.writeI32(struct.userID.size());
- for (String _iter130 : struct.userID)
+ for (String _iter140 : struct.userID)
{
- oprot.writeString(_iter130);
+ oprot.writeString(_iter140);
}
}
}
@@ -40862,13 +41754,13 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list131 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.userID = new ArrayList<String>(_list131.size);
- for (int _i132 = 0; _i132 < _list131.size; ++_i132)
+ org.apache.thrift.protocol.TList _list141 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.userID = new ArrayList<String>(_list141.size);
+ for (int _i142 = 0; _i142 < _list141.size; ++_i142)
{
- String _elem133;
- _elem133 = iprot.readString();
- struct.userID.add(_elem133);
+ String _elem143;
+ _elem143 = iprot.readString();
+ struct.userID.add(_elem143);
}
}
struct.setUserIDIsSet(true);
@@ -41187,14 +42079,14 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list134 = iprot.readListBegin();
- struct.success = new ArrayList<Person>(_list134.size);
- for (int _i135 = 0; _i135 < _list134.size; ++_i135)
+ org.apache.thrift.protocol.TList _list144 = iprot.readListBegin();
+ struct.success = new ArrayList<Person>(_list144.size);
+ for (int _i145 = 0; _i145 < _list144.size; ++_i145)
{
- Person _elem136;
- _elem136 = new Person();
- _elem136.read(iprot);
- struct.success.add(_elem136);
+ Person _elem146;
+ _elem146 = new Person();
+ _elem146.read(iprot);
+ struct.success.add(_elem146);
}
iprot.readListEnd();
}
@@ -41222,9 +42114,9 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (Person _iter137 : struct.success)
+ for (Person _iter147 : struct.success)
{
- _iter137.write(oprot);
+ _iter147.write(oprot);
}
oprot.writeListEnd();
}
@@ -41255,9 +42147,9 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Person _iter138 : struct.success)
+ for (Person _iter148 : struct.success)
{
- _iter138.write(oprot);
+ _iter148.write(oprot);
}
}
}
@@ -41269,14 +42161,14 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list139 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<Person>(_list139.size);
- for (int _i140 = 0; _i140 < _list139.size; ++_i140)
+ org.apache.thrift.protocol.TList _list149 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<Person>(_list149.size);
+ for (int _i150 = 0; _i150 < _list149.size; ++_i150)
{
- Person _elem141;
- _elem141 = new Person();
- _elem141.read(iprot);
- struct.success.add(_elem141);
+ Person _elem151;
+ _elem151 = new Person();
+ _elem151.read(iprot);
+ struct.success.add(_elem151);
}
}
struct.setSuccessIsSet(true);
@@ -42049,14 +42941,14 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list142 = iprot.readListBegin();
- struct.success = new ArrayList<Person>(_list142.size);
- for (int _i143 = 0; _i143 < _list142.size; ++_i143)
+ org.apache.thrift.protocol.TList _list152 = iprot.readListBegin();
+ struct.success = new ArrayList<Person>(_list152.size);
+ for (int _i153 = 0; _i153 < _list152.size; ++_i153)
{
- Person _elem144;
- _elem144 = new Person();
- _elem144.read(iprot);
- struct.success.add(_elem144);
+ Person _elem154;
+ _elem154 = new Person();
+ _elem154.read(iprot);
+ struct.success.add(_elem154);
}
iprot.readListEnd();
}
@@ -42084,9 +42976,9 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (Person _iter145 : struct.success)
+ for (Person _iter155 : struct.success)
{
- _iter145.write(oprot);
+ _iter155.write(oprot);
}
oprot.writeListEnd();
}
@@ -42117,9 +43009,9 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Person _iter146 : struct.success)
+ for (Person _iter156 : struct.success)
{
- _iter146.write(oprot);
+ _iter156.write(oprot);
}
}
}
@@ -42131,14 +43023,14 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list147 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<Person>(_list147.size);
- for (int _i148 = 0; _i148 < _list147.size; ++_i148)
+ org.apache.thrift.protocol.TList _list157 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<Person>(_list157.size);
+ for (int _i158 = 0; _i158 < _list157.size; ++_i158)
{
- Person _elem149;
- _elem149 = new Person();
- _elem149.read(iprot);
- struct.success.add(_elem149);
+ Person _elem159;
+ _elem159 = new Person();
+ _elem159.read(iprot);
+ struct.success.add(_elem159);
}
}
struct.setSuccessIsSet(true);
@@ -42808,13 +43700,13 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list150 = iprot.readListBegin();
- struct.success = new ArrayList<String>(_list150.size);
- for (int _i151 = 0; _i151 < _list150.size; ++_i151)
+ org.apache.thrift.protocol.TList _list160 = iprot.readListBegin();
+ struct.success = new ArrayList<String>(_list160.size);
+ for (int _i161 = 0; _i161 < _list160.size; ++_i161)
{
- String _elem152;
- _elem152 = iprot.readString();
- struct.success.add(_elem152);
+ String _elem162;
+ _elem162 = iprot.readString();
+ struct.success.add(_elem162);
}
iprot.readListEnd();
}
@@ -42842,9 +43734,9 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size()));
- for (String _iter153 : struct.success)
+ for (String _iter163 : struct.success)
{
- oprot.writeString(_iter153);
+ oprot.writeString(_iter163);
}
oprot.writeListEnd();
}
@@ -42875,9 +43767,9 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (String _iter154 : struct.success)
+ for (String _iter164 : struct.success)
{
- oprot.writeString(_iter154);
+ oprot.writeString(_iter164);
}
}
}
@@ -42889,13 +43781,13 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list155 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
- struct.success = new ArrayList<String>(_list155.size);
- for (int _i156 = 0; _i156 < _list155.size; ++_i156)
+ org.apache.thrift.protocol.TList _list165 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32());
+ struct.success = new ArrayList<String>(_list165.size);
+ for (int _i166 = 0; _i166 < _list165.size; ++_i166)
{
- String _elem157;
- _elem157 = iprot.readString();
- struct.success.add(_elem157);
+ String _elem167;
+ _elem167 = iprot.readString();
+ struct.success.add(_elem167);
}
}
struct.setSuccessIsSet(true);
@@ -43668,14 +44560,14 @@ public class Server {
case 0: // SUCCESS
if (schemeField.type == org.apache.thrift.protocol.TType.LIST) {
{
- org.apache.thrift.protocol.TList _list158 = iprot.readListBegin();
- struct.success = new ArrayList<Person>(_list158.size);
- for (int _i159 = 0; _i159 < _list158.size; ++_i159)
+ org.apache.thrift.protocol.TList _list168 = iprot.readListBegin();
+ struct.success = new ArrayList<Person>(_list168.size);
+ for (int _i169 = 0; _i169 < _list168.size; ++_i169)
{
- Person _elem160;
- _elem160 = new Person();
- _elem160.read(iprot);
- struct.success.add(_elem160);
+ Person _elem170;
+ _elem170 = new Person();
+ _elem170.read(iprot);
+ struct.success.add(_elem170);
}
iprot.readListEnd();
}
@@ -43703,9 +44595,9 @@ public class Server {
oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
{
oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size()));
- for (Person _iter161 : struct.success)
+ for (Person _iter171 : struct.success)
{
- _iter161.write(oprot);
+ _iter171.write(oprot);
}
oprot.writeListEnd();
}
@@ -43736,9 +44628,9 @@ public class Server {
if (struct.isSetSuccess()) {
{
oprot.writeI32(struct.success.size());
- for (Person _iter162 : struct.success)
+ for (Person _iter172 : struct.success)
{
- _iter162.write(oprot);
+ _iter172.write(oprot);
}
}
}
@@ -43750,14 +44642,14 @@ public class Server {
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
{
- org.apache.thrift.protocol.TList _list163 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
- struct.success = new ArrayList<Person>(_list163.size);
- for (int _i164 = 0; _i164 < _list163.size; ++_i164)
+ org.apache.thrift.protocol.TList _list173 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
+ struct.success = new ArrayList<Person>(_list173.size);
+ for (int _i174 = 0; _i174 < _list173.size; ++_i174)
{
- Person _elem165;
- _elem165 = new Person();
- _elem165.read(iprot);
- struct.success.add(_elem165);
+ Person _elem175;
+ _elem175 = new Person();
+ _elem175.read(iprot);
+ struct.success.add(_elem175);
}
}
struct.setSuccessIsSet(true);
diff --git a/dozentenmodulserver/src/main/java/sql/SQL.java b/dozentenmodulserver/src/main/java/sql/SQL.java
index 10afee96..dd40c774 100644
--- a/dozentenmodulserver/src/main/java/sql/SQL.java
+++ b/dozentenmodulserver/src/main/java/sql/SQL.java
@@ -36,7 +36,7 @@ public class SQL {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch (InstantiationException | IllegalAccessException
| ClassNotFoundException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
try {
@@ -48,7 +48,7 @@ public class SQL {
return con;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to return connection to Client.");
e.printStackTrace();
}
@@ -78,7 +78,7 @@ public class SQL {
+ ".");
return ret;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to writeFTPUser.");
e.printStackTrace();
}
@@ -113,7 +113,7 @@ public class SQL {
log.info("FTPUser " + user + " deleted.");
return ret;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to DeleteUser.");
e.printStackTrace();
}
@@ -136,7 +136,7 @@ public class SQL {
return rs;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getImage.");
e.printStackTrace();
}
@@ -177,7 +177,7 @@ public class SQL {
return path;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getPathOfImage.");
e.printStackTrace();
}
@@ -251,7 +251,7 @@ public class SQL {
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setInstitution.");
e.printStackTrace();
}
@@ -378,7 +378,7 @@ public class SQL {
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setPerson.");
e.printStackTrace();
}
@@ -507,7 +507,7 @@ public class SQL {
//con.commit();
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setImageData.");
e.printStackTrace();
}
@@ -563,7 +563,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -618,7 +618,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -661,7 +661,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -722,7 +722,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -779,7 +779,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -824,7 +824,7 @@ public class SQL {
}
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -870,7 +870,7 @@ public class SQL {
con.close();
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getLectureListPermissionRead.");
e.printStackTrace();
}
@@ -920,7 +920,7 @@ public class SQL {
con.close();
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getLectureListPermissionWrite.");
e.printStackTrace();
}
@@ -969,7 +969,7 @@ public class SQL {
con.close();
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getLectureListPermissionAdmin.");
e.printStackTrace();
}
@@ -1005,7 +1005,7 @@ public class SQL {
con.close();
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getLectureList.");
e.printStackTrace();
}
@@ -1030,7 +1030,7 @@ public class SQL {
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getAllOS.");
e.printStackTrace();
}
@@ -1081,15 +1081,104 @@ public class SQL {
con.close();
return map;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getPersonData.");
e.printStackTrace();
}
return null;
- }
+ }//end getPersonData
+
+
+
+
+ public Map<String, String> getPersonData(String userID) {
+ Map<String, String> map = new HashMap<String, String>();
+ try {
+ Connection con = getConnection();
+ String sql = "SELECT userID, loginName, Nachname, Vorname, mail, m_institution.name as institution FROM bwLehrpool.m_user, m_institution WHERE userID=? AND m_user.institution=m_institution.institutionID;";
+
+ PreparedStatement prest = con.prepareStatement(sql);
+ prest.setString(1, userID);
+
+ ResultSet rs = prest.executeQuery();
+ con.commit();
+ while (rs.next())
+ {
+ map.put("userID", rs.getString("userID"));
+ map.put("loginName", rs.getString("loginName"));
+ map.put("Nachname", rs.getString("Nachname"));
+ map.put("Vorname", rs.getString("Vorname"));
+ map.put("mail", rs.getString("mail"));
+ map.put("institution", rs.getString("institution"));
+
+ }
+ con.close();
+ return map;
+ } catch (SQLException e) {
+ log.info("Failed to getPersonData with userID='"+userID+"'.");
+ e.printStackTrace();
+ }
+ return null;
+ }//end getPersonData
+
+
+
+ public Map<String, String> getItemOwner(String itemID) {
+
+ Map<String, String> map = new HashMap<String, String>();
+ Connection con = getConnection();
+ PreparedStatement prest;
+ String userID;
+
+ try {
+ //find out if the itemID belongs to an image
+ String sql = "SELECT image_owner FROM bwLehrpool.m_VLData_imageInfo WHERE GUID_imageID=?;";
+ prest = con.prepareStatement(sql);
+ prest.setString(1, itemID);
+
+ ResultSet rs = prest.executeQuery();
+ while (rs.next()){
+ map.put("userID",rs.getString("image_owner"));
+ }
+
+ //if map is empty, then itemID does not belong to an image -> must be a lecture
+ if(map.isEmpty()==true){
+ //check if itemID belongs to a lecture
+ sql = "SELECT admin_owner FROM bwLehrpool.m_VLData_lecture WHERE lectureID=?;";
+ prest = con.prepareStatement(sql);
+ prest.setString(1, itemID);
+
+ rs = prest.executeQuery();
+ while(rs.next()){
+ map.put("userID", rs.getString("admin_owner"));
+ }
+ }
+
+ //if map is still empty, then the itemID could not be found
+ if(map.isEmpty()==true){
+ log.error("ERROR: getItemOwner could not find the item with the ID '"+itemID+"'.");
+ } else {
+
+ //now that we have the userID for this item, get the user information and put it in the map
+ userID = map.get("userID"); //extract the userID
+ map = getPersonData(userID); //get all the rest of his information
+
+ //return this map with all the infos
+ return map;
+
+ }
+
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+
+ //something went horribly wrong...
+ return null;
+ }//end getItemOwner
+
@@ -1191,7 +1280,7 @@ public class SQL {
//con.commit();
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setLectureData.");
e.printStackTrace();
}
@@ -1229,7 +1318,7 @@ public class SQL {
con.close();
return map;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getImageIDandVersion.");
e.printStackTrace();
}
@@ -1284,7 +1373,7 @@ public class SQL {
con.close();
return map;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getImageData.");
e.printStackTrace();
}
@@ -1437,7 +1526,7 @@ public class SQL {
con.close();
return 0;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to UpdateImageData.");
e.printStackTrace();
}
@@ -1475,7 +1564,7 @@ public class SQL {
return true;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to deleteImage and permissions.");
e.printStackTrace();
}
@@ -1556,7 +1645,7 @@ public class SQL {
log.info("Succeeded to updateLectureData.");
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to updateLectureData.");
e.printStackTrace();
}
@@ -1586,7 +1675,7 @@ public class SQL {
return ret;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to execute method connectedToLecture.");
e.printStackTrace();
}
@@ -1619,7 +1708,7 @@ public class SQL {
con.close();
return true;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to deleteLecture and permissions.");
e.printStackTrace();
}
@@ -1663,7 +1752,7 @@ public class SQL {
return path;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getFile.");
e.printStackTrace();
}
@@ -1698,7 +1787,7 @@ public class SQL {
return map;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getDeleteXMLData.");
e.printStackTrace();
}
@@ -1733,7 +1822,7 @@ public class SQL {
log.info("Succesfully updated image path");
return 0;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to UpdateImagePath.");
e.printStackTrace();
}
@@ -1755,7 +1844,7 @@ public class SQL {
return list;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getAllUniversities.");
e.printStackTrace();
}
@@ -1788,7 +1877,7 @@ public class SQL {
return pkos;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getOSpk.");
e.printStackTrace();
}
@@ -1821,7 +1910,7 @@ public class SQL {
return os;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getOS.");
e.printStackTrace();
}
@@ -1859,7 +1948,7 @@ public class SQL {
con.close();
return map;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getLectureData.");
e.printStackTrace();
}
@@ -1896,7 +1985,7 @@ public class SQL {
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
@@ -1928,7 +2017,7 @@ public class SQL {
return rs.getInt("roleID");
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to getRoleID.");
e.printStackTrace();
}
@@ -1958,7 +2047,7 @@ public class SQL {
con.close();
return id;
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to LectureID.");
e.printStackTrace();
}
@@ -1980,7 +2069,7 @@ public class SQL {
try {
stm = con.createStatement();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
String query = "SELECT userID, Nachname, Vorname, mail FROM m_user WHERE userID NOT IN ('"
@@ -1994,7 +2083,7 @@ public class SQL {
try {
res = stm.executeQuery(query);
} catch (SQLException e1) {
- // TODO Auto-generated catch block
+
e1.printStackTrace();
}
@@ -2008,7 +2097,7 @@ public class SQL {
false, false));
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -2034,7 +2123,7 @@ public class SQL {
try {
stm = con.createStatement();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
try {
@@ -2067,7 +2156,7 @@ public class SQL {
+ imageID
+ "' AND pmi.userID=u.userID ORDER BY u.Nachname ASC;");*/
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
try {
@@ -2108,7 +2197,7 @@ public class SQL {
// System.out.println(res.getString("Nachname")+" "+Boolean.parseBoolean(res.getString("image_read"))+" "+Boolean.parseBoolean(res.getString("image_write"))+" "+Boolean.parseBoolean(res.getString("image_admin")));
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -2150,7 +2239,7 @@ public class SQL {
"FROM bwLehrpool.pm_VLData_lecture pml, bwLehrpool.m_user u WHERE pml.userID!='"+userID+"' AND pml.lectureID='"+lectureID+"' AND pml.userID=u.userID ORDER BY u.Nachname ASC;");
*/
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
try {
@@ -2195,7 +2284,7 @@ public class SQL {
// System.out.println(res.getString("Nachname")+" "+Boolean.parseBoolean(res.getString("image_read"))+" "+Boolean.parseBoolean(res.getString("image_write"))+" "+Boolean.parseBoolean(res.getString("image_admin")));
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return list;
@@ -2251,7 +2340,7 @@ public class SQL {
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setImageRights.");
e.printStackTrace();
}
@@ -2304,7 +2393,7 @@ public class SQL {
log.info("Written additional image rights.");
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
log.info("Failed to write additional image rights.");
}
@@ -2349,7 +2438,7 @@ public class SQL {
log.info("Written lecture rights for " + pk_lecture);
con.close();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
log.info("Failed to setLectureRights.");
e.printStackTrace();
}
@@ -2397,7 +2486,7 @@ public class SQL {
log.info("Written additional lecture rights for '"
+ userID + "'.");
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
log.info("Failed to write additional lecture rights.");
}
@@ -2425,7 +2514,7 @@ public class SQL {
prest.executeUpdate();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
@@ -2437,7 +2526,7 @@ public class SQL {
con.commit();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
}// end deleteAllAdditionalImagePermissions
@@ -2471,7 +2560,7 @@ public class SQL {
con.commit();
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
}// end deleteAllAdditionalImagePermissions
@@ -2504,7 +2593,7 @@ public class SQL {
}
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
@@ -2534,13 +2623,18 @@ public class SQL {
return rs.getString("name") + " " + rs.getString("architecture") + " bit";
} catch (SQLException e) {
- // TODO Auto-generated catch block
+
e.printStackTrace();
}
return null;
}
+
+
+
+
+
}// end class