diff options
| author | Michael Wilson | 2014-10-07 14:01:52 +0200 |
|---|---|---|
| committer | Michael Wilson | 2014-10-07 14:01:52 +0200 |
| commit | af03c88129755f57fff3389bb35c5840c0e9751f (patch) | |
| tree | 238181e97734aea2ad8df4f7c6c5ca88e203bbd3 /dozentenmodulserver/src/main/java/server | |
| parent | -Volltextsuche vorbereitet, Funktion wird noch angepasst (diff) | |
| download | tutor-module-af03c88129755f57fff3389bb35c5840c0e9751f.tar.gz tutor-module-af03c88129755f57fff3389bb35c5840c0e9751f.tar.xz tutor-module-af03c88129755f57fff3389bb35c5840c0e9751f.zip | |
-Verwaltung von Rechten ist nun in der PermissionCreateImage_GUI.java möglich
Diffstat (limited to 'dozentenmodulserver/src/main/java/server')
3 files changed, 1377 insertions, 0 deletions
diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java index da00dfe4..30fd5237 100644 --- a/dozentenmodulserver/src/main/java/server/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -24,6 +24,7 @@ import server.generated.User; import server.generated.Image; import server.generated.Lecture; import server.generated.Server; +import server.generated.Person; import com.mysql.jdbc.StringUtils; @@ -547,5 +548,11 @@ public class ServerHandler implements Server.Iface { return true; } + @Override + public List<Person> getAllOGUsers() throws TException { + return sql.getAllOGUsers(); + //return null; + } + } diff --git a/dozentenmodulserver/src/main/java/server/generated/Person.java b/dozentenmodulserver/src/main/java/server/generated/Person.java new file mode 100644 index 00000000..19084ac9 --- /dev/null +++ b/dozentenmodulserver/src/main/java/server/generated/Person.java @@ -0,0 +1,588 @@ +/** + * Autogenerated by Thrift Compiler (0.9.1) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package server.generated; + +import org.apache.thrift.scheme.IScheme; +import org.apache.thrift.scheme.SchemeFactory; +import org.apache.thrift.scheme.StandardScheme; + +import org.apache.thrift.scheme.TupleScheme; +import org.apache.thrift.protocol.TTupleProtocol; +import org.apache.thrift.protocol.TProtocolException; +import org.apache.thrift.EncodingUtils; +import org.apache.thrift.TException; +import org.apache.thrift.async.AsyncMethodCallback; +import org.apache.thrift.server.AbstractNonblockingServer.*; +import java.util.List; +import java.util.ArrayList; +import java.util.Map; +import java.util.HashMap; +import java.util.EnumMap; +import java.util.Set; +import java.util.HashSet; +import java.util.EnumSet; +import java.util.Collections; +import java.util.BitSet; +import java.nio.ByteBuffer; +import java.util.Arrays; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class Person implements org.apache.thrift.TBase<Person, Person._Fields>, java.io.Serializable, Cloneable, Comparable<Person> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("Person"); + + private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userID", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final org.apache.thrift.protocol.TField NACHNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Nachname", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final org.apache.thrift.protocol.TField VORNAME_FIELD_DESC = new org.apache.thrift.protocol.TField("Vorname", org.apache.thrift.protocol.TType.STRING, (short)3); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new PersonStandardSchemeFactory()); + schemes.put(TupleScheme.class, new PersonTupleSchemeFactory()); + } + + public String userID; // required + public String Nachname; // required + public String Vorname; // 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_ID((short)1, "userID"), + NACHNAME((short)2, "Nachname"), + VORNAME((short)3, "Vorname"); + + private static final Map<String, _Fields> byName = new HashMap<String, _Fields>(); + + static { + for (_Fields field : EnumSet.allOf(_Fields.class)) { + byName.put(field.getFieldName(), field); + } + } + + /** + * Find the _Fields constant that matches fieldId, or null if its not found. + */ + public static _Fields findByThriftId(int fieldId) { + switch(fieldId) { + case 1: // USER_ID + return USER_ID; + case 2: // NACHNAME + return NACHNAME; + case 3: // VORNAME + return VORNAME; + 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_ID, new org.apache.thrift.meta_data.FieldMetaData("userID", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.NACHNAME, new org.apache.thrift.meta_data.FieldMetaData("Nachname", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.VORNAME, new org.apache.thrift.meta_data.FieldMetaData("Vorname", 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(Person.class, metaDataMap); + } + + public Person() { + } + + public Person( + String userID, + String Nachname, + String Vorname) + { + this(); + this.userID = userID; + this.Nachname = Nachname; + this.Vorname = Vorname; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public Person(Person other) { + if (other.isSetUserID()) { + this.userID = other.userID; + } + if (other.isSetNachname()) { + this.Nachname = other.Nachname; + } + if (other.isSetVorname()) { + this.Vorname = other.Vorname; + } + } + + public Person deepCopy() { + return new Person(this); + } + + @Override + public void clear() { + this.userID = null; + this.Nachname = null; + this.Vorname = null; + } + + public String getUserID() { + return this.userID; + } + + public Person setUserID(String userID) { + this.userID = userID; + return this; + } + + public void unsetUserID() { + this.userID = null; + } + + /** Returns true if field userID is set (has been assigned a value) and false otherwise */ + public boolean isSetUserID() { + return this.userID != null; + } + + public void setUserIDIsSet(boolean value) { + if (!value) { + this.userID = null; + } + } + + public String getNachname() { + return this.Nachname; + } + + public Person setNachname(String Nachname) { + this.Nachname = Nachname; + return this; + } + + public void unsetNachname() { + this.Nachname = null; + } + + /** Returns true if field Nachname is set (has been assigned a value) and false otherwise */ + public boolean isSetNachname() { + return this.Nachname != null; + } + + public void setNachnameIsSet(boolean value) { + if (!value) { + this.Nachname = null; + } + } + + public String getVorname() { + return this.Vorname; + } + + public Person setVorname(String Vorname) { + this.Vorname = Vorname; + return this; + } + + public void unsetVorname() { + this.Vorname = null; + } + + /** Returns true if field Vorname is set (has been assigned a value) and false otherwise */ + public boolean isSetVorname() { + return this.Vorname != null; + } + + public void setVornameIsSet(boolean value) { + if (!value) { + this.Vorname = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case USER_ID: + if (value == null) { + unsetUserID(); + } else { + setUserID((String)value); + } + break; + + case NACHNAME: + if (value == null) { + unsetNachname(); + } else { + setNachname((String)value); + } + break; + + case VORNAME: + if (value == null) { + unsetVorname(); + } else { + setVorname((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case USER_ID: + return getUserID(); + + case NACHNAME: + return getNachname(); + + case VORNAME: + return getVorname(); + + } + 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_ID: + return isSetUserID(); + case NACHNAME: + return isSetNachname(); + case VORNAME: + return isSetVorname(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof Person) + return this.equals((Person)that); + return false; + } + + public boolean equals(Person that) { + if (that == null) + return false; + + boolean this_present_userID = true && this.isSetUserID(); + boolean that_present_userID = true && that.isSetUserID(); + if (this_present_userID || that_present_userID) { + if (!(this_present_userID && that_present_userID)) + return false; + if (!this.userID.equals(that.userID)) + return false; + } + + boolean this_present_Nachname = true && this.isSetNachname(); + boolean that_present_Nachname = true && that.isSetNachname(); + if (this_present_Nachname || that_present_Nachname) { + if (!(this_present_Nachname && that_present_Nachname)) + return false; + if (!this.Nachname.equals(that.Nachname)) + return false; + } + + boolean this_present_Vorname = true && this.isSetVorname(); + boolean that_present_Vorname = true && that.isSetVorname(); + if (this_present_Vorname || that_present_Vorname) { + if (!(this_present_Vorname && that_present_Vorname)) + return false; + if (!this.Vorname.equals(that.Vorname)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(Person other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetUserID()).compareTo(other.isSetUserID()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetUserID()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userID, other.userID); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetNachname()).compareTo(other.isSetNachname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetNachname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Nachname, other.Nachname); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetVorname()).compareTo(other.isSetVorname()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetVorname()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.Vorname, other.Vorname); + 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("Person("); + boolean first = true; + + sb.append("userID:"); + if (this.userID == null) { + sb.append("null"); + } else { + sb.append(this.userID); + } + first = false; + if (!first) sb.append(", "); + sb.append("Nachname:"); + if (this.Nachname == null) { + sb.append("null"); + } else { + sb.append(this.Nachname); + } + first = false; + if (!first) sb.append(", "); + sb.append("Vorname:"); + if (this.Vorname == null) { + sb.append("null"); + } else { + sb.append(this.Vorname); + } + 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 PersonStandardSchemeFactory implements SchemeFactory { + public PersonStandardScheme getScheme() { + return new PersonStandardScheme(); + } + } + + private static class PersonStandardScheme extends StandardScheme<Person> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Person 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_ID + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.userID = iprot.readString(); + struct.setUserIDIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NACHNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Nachname = iprot.readString(); + struct.setNachnameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // VORNAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.Vorname = iprot.readString(); + struct.setVornameIsSet(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, Person struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.userID != null) { + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeString(struct.userID); + oprot.writeFieldEnd(); + } + if (struct.Nachname != null) { + oprot.writeFieldBegin(NACHNAME_FIELD_DESC); + oprot.writeString(struct.Nachname); + oprot.writeFieldEnd(); + } + if (struct.Vorname != null) { + oprot.writeFieldBegin(VORNAME_FIELD_DESC); + oprot.writeString(struct.Vorname); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class PersonTupleSchemeFactory implements SchemeFactory { + public PersonTupleScheme getScheme() { + return new PersonTupleScheme(); + } + } + + private static class PersonTupleScheme extends TupleScheme<Person> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Person struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserID()) { + optionals.set(0); + } + if (struct.isSetNachname()) { + optionals.set(1); + } + if (struct.isSetVorname()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetUserID()) { + oprot.writeString(struct.userID); + } + if (struct.isSetNachname()) { + oprot.writeString(struct.Nachname); + } + if (struct.isSetVorname()) { + oprot.writeString(struct.Vorname); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Person struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.userID = iprot.readString(); + struct.setUserIDIsSet(true); + } + if (incoming.get(1)) { + struct.Nachname = iprot.readString(); + struct.setNachnameIsSet(true); + } + if (incoming.get(2)) { + struct.Vorname = iprot.readString(); + struct.setVornameIsSet(true); + } + } + } + +} + diff --git a/dozentenmodulserver/src/main/java/server/generated/Server.java b/dozentenmodulserver/src/main/java/server/generated/Server.java index 0a7d99c5..60f3faae 100644 --- a/dozentenmodulserver/src/main/java/server/generated/Server.java +++ b/dozentenmodulserver/src/main/java/server/generated/Server.java @@ -82,6 +82,8 @@ public class Server { public boolean writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role) throws org.apache.thrift.TException; + public List<Person> getAllOGUsers() throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -132,6 +134,8 @@ public class Server { public void writeLectureRights(String lecturename, String username, String lastName, String firstName, String mail, String university, String role, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getAllOGUsers(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -761,6 +765,28 @@ public class Server { throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "writeLectureRights failed: unknown result"); } + public List<Person> getAllOGUsers() throws org.apache.thrift.TException + { + send_getAllOGUsers(); + return recv_getAllOGUsers(); + } + + public void send_getAllOGUsers() throws org.apache.thrift.TException + { + getAllOGUsers_args args = new getAllOGUsers_args(); + sendBase("getAllOGUsers", args); + } + + public List<Person> recv_getAllOGUsers() throws org.apache.thrift.TException + { + getAllOGUsers_result result = new getAllOGUsers_result(); + receiveBase(result, "getAllOGUsers"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getAllOGUsers failed: unknown result"); + } + } public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface { public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> { @@ -1749,6 +1775,35 @@ public class Server { } } + public void getAllOGUsers(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getAllOGUsers_call method_call = new getAllOGUsers_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getAllOGUsers_call extends org.apache.thrift.async.TAsyncMethodCall { + public getAllOGUsers_call(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); + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getAllOGUsers", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getAllOGUsers_args args = new getAllOGUsers_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List<Person> 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_getAllOGUsers(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -1785,6 +1840,7 @@ public class Server { processMap.put("createUser", new createUser()); processMap.put("writeImageRights", new writeImageRights()); processMap.put("writeLectureRights", new writeLectureRights()); + processMap.put("getAllOGUsers", new getAllOGUsers()); return processMap; } @@ -2262,6 +2318,26 @@ public class Server { } } + public static class getAllOGUsers<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getAllOGUsers_args> { + public getAllOGUsers() { + super("getAllOGUsers"); + } + + public getAllOGUsers_args getEmptyArgsInstance() { + return new getAllOGUsers_args(); + } + + protected boolean isOneway() { + return false; + } + + public getAllOGUsers_result getResult(I iface, getAllOGUsers_args args) throws org.apache.thrift.TException { + getAllOGUsers_result result = new getAllOGUsers_result(); + result.success = iface.getAllOGUsers(); + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -2298,6 +2374,7 @@ public class Server { processMap.put("createUser", new createUser()); processMap.put("writeImageRights", new writeImageRights()); processMap.put("writeLectureRights", new writeLectureRights()); + processMap.put("getAllOGUsers", new getAllOGUsers()); return processMap; } @@ -3488,6 +3565,57 @@ public class Server { } } + public static class getAllOGUsers<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getAllOGUsers_args, List<Person>> { + public getAllOGUsers() { + super("getAllOGUsers"); + } + + public getAllOGUsers_args getEmptyArgsInstance() { + return new getAllOGUsers_args(); + } + + public AsyncMethodCallback<List<Person>> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<List<Person>>() { + public void onComplete(List<Person> o) { + getAllOGUsers_result result = new getAllOGUsers_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; + getAllOGUsers_result result = new getAllOGUsers_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, getAllOGUsers_args args, org.apache.thrift.async.AsyncMethodCallback<List<Person>> resultHandler) throws TException { + iface.getAllOGUsers(resultHandler); + } + } + } public static class getFtpUser_args implements org.apache.thrift.TBase<getFtpUser_args, getFtpUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFtpUser_args> { @@ -27821,4 +27949,658 @@ public class Server { } + public static class getAllOGUsers_args implements org.apache.thrift.TBase<getAllOGUsers_args, getAllOGUsers_args._Fields>, java.io.Serializable, Cloneable, Comparable<getAllOGUsers_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOGUsers_args"); + + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllOGUsers_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllOGUsers_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOGUsers_args.class, metaDataMap); + } + + public getAllOGUsers_args() { + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllOGUsers_args(getAllOGUsers_args other) { + } + + public getAllOGUsers_args deepCopy() { + return new getAllOGUsers_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getAllOGUsers_args) + return this.equals((getAllOGUsers_args)that); + return false; + } + + public boolean equals(getAllOGUsers_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getAllOGUsers_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + 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("getAllOGUsers_args("); + boolean first = true; + + 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 getAllOGUsers_argsStandardSchemeFactory implements SchemeFactory { + public getAllOGUsers_argsStandardScheme getScheme() { + return new getAllOGUsers_argsStandardScheme(); + } + } + + private static class getAllOGUsers_argsStandardScheme extends StandardScheme<getAllOGUsers_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOGUsers_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) { + 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, getAllOGUsers_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllOGUsers_argsTupleSchemeFactory implements SchemeFactory { + public getAllOGUsers_argsTupleScheme getScheme() { + return new getAllOGUsers_argsTupleScheme(); + } + } + + private static class getAllOGUsers_argsTupleScheme extends TupleScheme<getAllOGUsers_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllOGUsers_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllOGUsers_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class getAllOGUsers_result implements org.apache.thrift.TBase<getAllOGUsers_result, getAllOGUsers_result._Fields>, java.io.Serializable, Cloneable, Comparable<getAllOGUsers_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getAllOGUsers_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getAllOGUsers_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getAllOGUsers_resultTupleSchemeFactory()); + } + + public List<Person> 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.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, Person.class)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getAllOGUsers_result.class, metaDataMap); + } + + public getAllOGUsers_result() { + } + + public getAllOGUsers_result( + List<Person> success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getAllOGUsers_result(getAllOGUsers_result other) { + if (other.isSetSuccess()) { + List<Person> __this__success = new ArrayList<Person>(other.success.size()); + for (Person other_element : other.success) { + __this__success.add(new Person(other_element)); + } + this.success = __this__success; + } + } + + public getAllOGUsers_result deepCopy() { + return new getAllOGUsers_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator<Person> getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(Person elem) { + if (this.success == null) { + this.success = new ArrayList<Person>(); + } + this.success.add(elem); + } + + public List<Person> getSuccess() { + return this.success; + } + + public getAllOGUsers_result setSuccess(List<Person> 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((List<Person>)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 getAllOGUsers_result) + return this.equals((getAllOGUsers_result)that); + return false; + } + + public boolean equals(getAllOGUsers_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(getAllOGUsers_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("getAllOGUsers_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 getAllOGUsers_resultStandardSchemeFactory implements SchemeFactory { + public getAllOGUsers_resultStandardScheme getScheme() { + return new getAllOGUsers_resultStandardScheme(); + } + } + + private static class getAllOGUsers_resultStandardScheme extends StandardScheme<getAllOGUsers_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getAllOGUsers_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.LIST) { + { + org.apache.thrift.protocol.TList _list62 = iprot.readListBegin(); + struct.success = new ArrayList<Person>(_list62.size); + for (int _i63 = 0; _i63 < _list62.size; ++_i63) + { + Person _elem64; + _elem64 = new Person(); + _elem64.read(iprot); + struct.success.add(_elem64); + } + iprot.readListEnd(); + } + 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, getAllOGUsers_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (Person _iter65 : struct.success) + { + _iter65.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getAllOGUsers_resultTupleSchemeFactory implements SchemeFactory { + public getAllOGUsers_resultTupleScheme getScheme() { + return new getAllOGUsers_resultTupleScheme(); + } + } + + private static class getAllOGUsers_resultTupleScheme extends TupleScheme<getAllOGUsers_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getAllOGUsers_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 (Person _iter66 : struct.success) + { + _iter66.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getAllOGUsers_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list67 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList<Person>(_list67.size); + for (int _i68 = 0; _i68 < _list67.size; ++_i68) + { + Person _elem69; + _elem69 = new Person(); + _elem69.read(iprot); + struct.success.add(_elem69); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + } |
