diff options
| author | Nino Breuer | 2014-11-17 19:37:42 +0100 |
|---|---|---|
| committer | Nino Breuer | 2014-11-17 19:37:42 +0100 |
| commit | 862f7f7fbea471e27375b3f8c6ccaca3b6ec8722 (patch) | |
| tree | 0c67da9fdb08b77ee5e8810c65b6cf0fd946aa6b /dozentenmodulserver/src/main/java/server | |
| parent | • changed regular statements to prepared statements to prevent sql injections (diff) | |
| download | tutor-module-862f7f7fbea471e27375b3f8c6ccaca3b6ec8722.tar.gz tutor-module-862f7f7fbea471e27375b3f8c6ccaca3b6ec8722.tar.xz tutor-module-862f7f7fbea471e27375b3f8c6ccaca3b6ec8722.zip | |
• fixed bug where the os name was not set to the correct value while editing an image
Diffstat (limited to 'dozentenmodulserver/src/main/java/server')
| -rw-r--r-- | dozentenmodulserver/src/main/java/server/ServerHandler.java | 5 | ||||
| -rw-r--r-- | dozentenmodulserver/src/main/java/server/generated/Server.java | 840 |
2 files changed, 845 insertions, 0 deletions
diff --git a/dozentenmodulserver/src/main/java/server/ServerHandler.java b/dozentenmodulserver/src/main/java/server/ServerHandler.java index 9800b8bc..79d10415 100644 --- a/dozentenmodulserver/src/main/java/server/ServerHandler.java +++ b/dozentenmodulserver/src/main/java/server/ServerHandler.java @@ -673,5 +673,10 @@ public class ServerHandler implements Server.Iface { return sql.getAdditionalImageContacts(imageID); } + @Override + public String getOsNameForGuestOs(String guestOS) throws TException { + return sql.getOsNameForGuestOs(guestOS); + } + }// end class diff --git a/dozentenmodulserver/src/main/java/server/generated/Server.java b/dozentenmodulserver/src/main/java/server/generated/Server.java index 81d3daae..fc1e7dae 100644 --- a/dozentenmodulserver/src/main/java/server/generated/Server.java +++ b/dozentenmodulserver/src/main/java/server/generated/Server.java @@ -118,6 +118,8 @@ public class Server { public void deleteAllAdditionalLecturePermissions(String lectureID, String userID) throws org.apache.thrift.TException; + public String getOsNameForGuestOs(String guestOS) throws org.apache.thrift.TException; + } public interface AsyncIface { @@ -204,6 +206,8 @@ public class Server { public void deleteAllAdditionalLecturePermissions(String lectureID, String userID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getOsNameForGuestOs(String guestOS, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + } public static class Client extends org.apache.thrift.TServiceClient implements Iface { @@ -1255,6 +1259,29 @@ public class Server { return; } + public String getOsNameForGuestOs(String guestOS) throws org.apache.thrift.TException + { + send_getOsNameForGuestOs(guestOS); + return recv_getOsNameForGuestOs(); + } + + public void send_getOsNameForGuestOs(String guestOS) throws org.apache.thrift.TException + { + getOsNameForGuestOs_args args = new getOsNameForGuestOs_args(); + args.setGuestOS(guestOS); + sendBase("getOsNameForGuestOs", args); + } + + public String recv_getOsNameForGuestOs() throws org.apache.thrift.TException + { + getOsNameForGuestOs_result result = new getOsNameForGuestOs_result(); + receiveBase(result, "getOsNameForGuestOs"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getOsNameForGuestOs 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> { @@ -2870,6 +2897,38 @@ public class Server { } } + public void getOsNameForGuestOs(String guestOS, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + getOsNameForGuestOs_call method_call = new getOsNameForGuestOs_call(guestOS, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class getOsNameForGuestOs_call extends org.apache.thrift.async.TAsyncMethodCall { + private String guestOS; + public getOsNameForGuestOs_call(String guestOS, 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.guestOS = guestOS; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getOsNameForGuestOs", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getOsNameForGuestOs_args args = new getOsNameForGuestOs_args(); + args.setGuestOS(guestOS); + args.write(prot); + prot.writeMessageEnd(); + } + + public 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_getOsNameForGuestOs(); + } + } + } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { @@ -2924,6 +2983,7 @@ public class Server { processMap.put("getPermissionForUserAndLecture", new getPermissionForUserAndLecture()); processMap.put("deleteAllAdditionalImagePermissions", new deleteAllAdditionalImagePermissions()); processMap.put("deleteAllAdditionalLecturePermissions", new deleteAllAdditionalLecturePermissions()); + processMap.put("getOsNameForGuestOs", new getOsNameForGuestOs()); return processMap; } @@ -3763,6 +3823,26 @@ public class Server { } } + public static class getOsNameForGuestOs<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getOsNameForGuestOs_args> { + public getOsNameForGuestOs() { + super("getOsNameForGuestOs"); + } + + public getOsNameForGuestOs_args getEmptyArgsInstance() { + return new getOsNameForGuestOs_args(); + } + + protected boolean isOneway() { + return false; + } + + public getOsNameForGuestOs_result getResult(I iface, getOsNameForGuestOs_args args) throws org.apache.thrift.TException { + getOsNameForGuestOs_result result = new getOsNameForGuestOs_result(); + result.success = iface.getOsNameForGuestOs(args.guestOS); + return result; + } + } + } public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> { @@ -3817,6 +3897,7 @@ public class Server { processMap.put("getPermissionForUserAndLecture", new getPermissionForUserAndLecture()); processMap.put("deleteAllAdditionalImagePermissions", new deleteAllAdditionalImagePermissions()); processMap.put("deleteAllAdditionalLecturePermissions", new deleteAllAdditionalLecturePermissions()); + processMap.put("getOsNameForGuestOs", new getOsNameForGuestOs()); return processMap; } @@ -5924,6 +6005,57 @@ public class Server { } } + public static class getOsNameForGuestOs<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getOsNameForGuestOs_args, String> { + public getOsNameForGuestOs() { + super("getOsNameForGuestOs"); + } + + public getOsNameForGuestOs_args getEmptyArgsInstance() { + return new getOsNameForGuestOs_args(); + } + + public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) { + final org.apache.thrift.AsyncProcessFunction fcall = this; + return new AsyncMethodCallback<String>() { + public void onComplete(String o) { + getOsNameForGuestOs_result result = new getOsNameForGuestOs_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; + getOsNameForGuestOs_result result = new getOsNameForGuestOs_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, getOsNameForGuestOs_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException { + iface.getOsNameForGuestOs(args.guestOS,resultHandler); + } + } + } public static class getFtpUser_args implements org.apache.thrift.TBase<getFtpUser_args, getFtpUser_args._Fields>, java.io.Serializable, Cloneable, Comparable<getFtpUser_args> { @@ -45035,4 +45167,712 @@ public class Server { } + public static class getOsNameForGuestOs_args implements org.apache.thrift.TBase<getOsNameForGuestOs_args, getOsNameForGuestOs_args._Fields>, java.io.Serializable, Cloneable, Comparable<getOsNameForGuestOs_args> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOsNameForGuestOs_args"); + + private static final org.apache.thrift.protocol.TField GUEST_OS_FIELD_DESC = new org.apache.thrift.protocol.TField("guestOS", 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 getOsNameForGuestOs_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getOsNameForGuestOs_argsTupleSchemeFactory()); + } + + public String guestOS; // 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 { + GUEST_OS((short)1, "guestOS"); + + 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: // GUEST_OS + return GUEST_OS; + 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.GUEST_OS, new org.apache.thrift.meta_data.FieldMetaData("guestOS", 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(getOsNameForGuestOs_args.class, metaDataMap); + } + + public getOsNameForGuestOs_args() { + } + + public getOsNameForGuestOs_args( + String guestOS) + { + this(); + this.guestOS = guestOS; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getOsNameForGuestOs_args(getOsNameForGuestOs_args other) { + if (other.isSetGuestOS()) { + this.guestOS = other.guestOS; + } + } + + public getOsNameForGuestOs_args deepCopy() { + return new getOsNameForGuestOs_args(this); + } + + @Override + public void clear() { + this.guestOS = null; + } + + public String getGuestOS() { + return this.guestOS; + } + + public getOsNameForGuestOs_args setGuestOS(String guestOS) { + this.guestOS = guestOS; + return this; + } + + public void unsetGuestOS() { + this.guestOS = null; + } + + /** Returns true if field guestOS is set (has been assigned a value) and false otherwise */ + public boolean isSetGuestOS() { + return this.guestOS != null; + } + + public void setGuestOSIsSet(boolean value) { + if (!value) { + this.guestOS = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case GUEST_OS: + if (value == null) { + unsetGuestOS(); + } else { + setGuestOS((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case GUEST_OS: + return getGuestOS(); + + } + 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 GUEST_OS: + return isSetGuestOS(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof getOsNameForGuestOs_args) + return this.equals((getOsNameForGuestOs_args)that); + return false; + } + + public boolean equals(getOsNameForGuestOs_args that) { + if (that == null) + return false; + + boolean this_present_guestOS = true && this.isSetGuestOS(); + boolean that_present_guestOS = true && that.isSetGuestOS(); + if (this_present_guestOS || that_present_guestOS) { + if (!(this_present_guestOS && that_present_guestOS)) + return false; + if (!this.guestOS.equals(that.guestOS)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + @Override + public int compareTo(getOsNameForGuestOs_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + + lastComparison = Boolean.valueOf(isSetGuestOS()).compareTo(other.isSetGuestOS()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetGuestOS()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.guestOS, other.guestOS); + 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("getOsNameForGuestOs_args("); + boolean first = true; + + sb.append("guestOS:"); + if (this.guestOS == null) { + sb.append("null"); + } else { + sb.append(this.guestOS); + } + 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 getOsNameForGuestOs_argsStandardSchemeFactory implements SchemeFactory { + public getOsNameForGuestOs_argsStandardScheme getScheme() { + return new getOsNameForGuestOs_argsStandardScheme(); + } + } + + private static class getOsNameForGuestOs_argsStandardScheme extends StandardScheme<getOsNameForGuestOs_args> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getOsNameForGuestOs_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: // GUEST_OS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.guestOS = iprot.readString(); + struct.setGuestOSIsSet(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, getOsNameForGuestOs_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.guestOS != null) { + oprot.writeFieldBegin(GUEST_OS_FIELD_DESC); + oprot.writeString(struct.guestOS); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getOsNameForGuestOs_argsTupleSchemeFactory implements SchemeFactory { + public getOsNameForGuestOs_argsTupleScheme getScheme() { + return new getOsNameForGuestOs_argsTupleScheme(); + } + } + + private static class getOsNameForGuestOs_argsTupleScheme extends TupleScheme<getOsNameForGuestOs_args> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getOsNameForGuestOs_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetGuestOS()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetGuestOS()) { + oprot.writeString(struct.guestOS); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getOsNameForGuestOs_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.guestOS = iprot.readString(); + struct.setGuestOSIsSet(true); + } + } + } + + } + + public static class getOsNameForGuestOs_result implements org.apache.thrift.TBase<getOsNameForGuestOs_result, getOsNameForGuestOs_result._Fields>, java.io.Serializable, Cloneable, Comparable<getOsNameForGuestOs_result> { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getOsNameForGuestOs_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + + private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getOsNameForGuestOs_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getOsNameForGuestOs_resultTupleSchemeFactory()); + } + + public 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.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getOsNameForGuestOs_result.class, metaDataMap); + } + + public getOsNameForGuestOs_result() { + } + + public getOsNameForGuestOs_result( + String success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on <i>other</i>. + */ + public getOsNameForGuestOs_result(getOsNameForGuestOs_result other) { + if (other.isSetSuccess()) { + this.success = other.success; + } + } + + public getOsNameForGuestOs_result deepCopy() { + return new getOsNameForGuestOs_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public String getSuccess() { + return this.success; + } + + public getOsNameForGuestOs_result setSuccess(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((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 getOsNameForGuestOs_result) + return this.equals((getOsNameForGuestOs_result)that); + return false; + } + + public boolean equals(getOsNameForGuestOs_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(getOsNameForGuestOs_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("getOsNameForGuestOs_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 getOsNameForGuestOs_resultStandardSchemeFactory implements SchemeFactory { + public getOsNameForGuestOs_resultStandardScheme getScheme() { + return new getOsNameForGuestOs_resultStandardScheme(); + } + } + + private static class getOsNameForGuestOs_resultStandardScheme extends StandardScheme<getOsNameForGuestOs_result> { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getOsNameForGuestOs_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.STRING) { + struct.success = iprot.readString(); + 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, getOsNameForGuestOs_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getOsNameForGuestOs_resultTupleSchemeFactory implements SchemeFactory { + public getOsNameForGuestOs_resultTupleScheme getScheme() { + return new getOsNameForGuestOs_resultTupleScheme(); + } + } + + private static class getOsNameForGuestOs_resultTupleScheme extends TupleScheme<getOsNameForGuestOs_result> { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getOsNameForGuestOs_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.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getOsNameForGuestOs_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + + } + } |
