/** * Autogenerated by Thrift Compiler (0.8.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package ddth.dasp.servlet.thrift.api; import java.util.BitSet; import java.util.Collections; import java.util.EnumMap; import java.util.EnumSet; import java.util.HashMap; import java.util.Map; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; public class DaspJsonApi { public interface Iface { public String callApi(String moduleName, String functionName, String jsonEncodedInput, String authKey) throws org.apache.thrift.TException; } public interface AsyncIface { public void callApi(String moduleName, String functionName, String jsonEncodedInput, String authKey, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.callApi_call> resultHandler) throws org.apache.thrift.TException; } public static class Client extends org.apache.thrift.TServiceClient implements Iface { public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> { public Factory() { } public Client getClient(org.apache.thrift.protocol.TProtocol prot) { return new Client(prot); } public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { return new Client(iprot, oprot); } } public Client(org.apache.thrift.protocol.TProtocol prot) { super(prot, prot); } public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) { super(iprot, oprot); } public String callApi(String moduleName, String functionName, String jsonEncodedInput, String authKey) throws org.apache.thrift.TException { send_callApi(moduleName, functionName, jsonEncodedInput, authKey); return recv_callApi(); } public void send_callApi(String moduleName, String functionName, String jsonEncodedInput, String authKey) throws org.apache.thrift.TException { callApi_args args = new callApi_args(); args.setModuleName(moduleName); args.setFunctionName(functionName); args.setJsonEncodedInput(jsonEncodedInput); args.setAuthKey(authKey); sendBase("callApi", args); } public String recv_callApi() throws org.apache.thrift.TException { callApi_result result = new callApi_result(); receiveBase(result, "callApi"); if (result.isSetSuccess()) { return result.success; } throw new org.apache.thrift.TApplicationException( org.apache.thrift.TApplicationException.MISSING_RESULT, "callApi 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> { private org.apache.thrift.async.TAsyncClientManager clientManager; private org.apache.thrift.protocol.TProtocolFactory protocolFactory; public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient( org.apache.thrift.transport.TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void callApi(String moduleName, String functionName, String jsonEncodedInput, String authKey, org.apache.thrift.async.AsyncMethodCallback<callApi_call> resultHandler) throws org.apache.thrift.TException { checkReady(); callApi_call method_call = new callApi_call(moduleName, functionName, jsonEncodedInput, authKey, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } @SuppressWarnings({ "unchecked", "rawtypes" }) public static class callApi_call extends org.apache.thrift.async.TAsyncMethodCall { private String moduleName; private String functionName; private String jsonEncodedInput; private String authKey; public callApi_call(String moduleName, String functionName, String jsonEncodedInput, String authKey, org.apache.thrift.async.AsyncMethodCallback<callApi_call> 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.moduleName = moduleName; this.functionName = functionName; this.jsonEncodedInput = jsonEncodedInput; this.authKey = authKey; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("callApi", org.apache.thrift.protocol.TMessageType.CALL, 0)); callApi_args args = new callApi_args(); args.setModuleName(moduleName); args.setFunctionName(functionName); args.setJsonEncodedInput(jsonEncodedInput); args.setAuthKey(authKey); 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_callApi(); } } } @SuppressWarnings({ "unchecked", "rawtypes" }) public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> implements org.apache.thrift.TProcessor { public Processor(I iface) { super( iface, getProcessMap(new HashMap<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>())); } protected Processor( I iface, Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { super(iface, getProcessMap(processMap)); } private static <I extends Iface> Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap( Map<String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) { processMap.put("callApi", new callApi()); return processMap; } private static class callApi<I extends Iface> extends org.apache.thrift.ProcessFunction<I, callApi_args> { public callApi() { super("callApi"); } protected callApi_args getEmptyArgsInstance() { return new callApi_args(); } protected callApi_result getResult(I iface, callApi_args args) throws org.apache.thrift.TException { callApi_result result = new callApi_result(); result.success = iface.callApi(args.moduleName, args.functionName, args.jsonEncodedInput, args.authKey); return result; } } } @SuppressWarnings({ "unchecked", "rawtypes" }) public static class callApi_args implements org.apache.thrift.TBase<callApi_args, callApi_args._Fields>, java.io.Serializable, Cloneable { private static final long serialVersionUID = 1L; private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "callApi_args"); private static final org.apache.thrift.protocol.TField MODULE_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField( "moduleName", org.apache.thrift.protocol.TType.STRING, (short) 1); private static final org.apache.thrift.protocol.TField FUNCTION_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField( "functionName", org.apache.thrift.protocol.TType.STRING, (short) 2); private static final org.apache.thrift.protocol.TField JSON_ENCODED_INPUT_FIELD_DESC = new org.apache.thrift.protocol.TField( "jsonEncodedInput", org.apache.thrift.protocol.TType.STRING, (short) 3); private static final org.apache.thrift.protocol.TField AUTH_KEY_FIELD_DESC = new org.apache.thrift.protocol.TField( "authKey", org.apache.thrift.protocol.TType.STRING, (short) 4); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new callApi_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new callApi_argsTupleSchemeFactory()); } public String moduleName; // required public String functionName; // required public String jsonEncodedInput; // required public String authKey; // 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 { MODULE_NAME((short) 1, "moduleName"), FUNCTION_NAME((short) 2, "functionName"), JSON_ENCODED_INPUT( (short) 3, "jsonEncodedInput"), AUTH_KEY((short) 4, "authKey"); 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: // MODULE_NAME return MODULE_NAME; case 2: // FUNCTION_NAME return FUNCTION_NAME; case 3: // JSON_ENCODED_INPUT return JSON_ENCODED_INPUT; case 4: // AUTH_KEY return AUTH_KEY; 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.MODULE_NAME, new org.apache.thrift.meta_data.FieldMetaData( "moduleName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData( org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.FUNCTION_NAME, new org.apache.thrift.meta_data.FieldMetaData( "functionName", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData( org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.JSON_ENCODED_INPUT, new org.apache.thrift.meta_data.FieldMetaData( "jsonEncodedInput", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData( org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.AUTH_KEY, new org.apache.thrift.meta_data.FieldMetaData("authKey", 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(callApi_args.class, metaDataMap); } public callApi_args() { } public callApi_args(String moduleName, String functionName, String jsonEncodedInput, String authKey) { this(); this.moduleName = moduleName; this.functionName = functionName; this.jsonEncodedInput = jsonEncodedInput; this.authKey = authKey; } /** * Performs a deep copy on <i>other</i>. */ public callApi_args(callApi_args other) { if (other.isSetModuleName()) { this.moduleName = other.moduleName; } if (other.isSetFunctionName()) { this.functionName = other.functionName; } if (other.isSetJsonEncodedInput()) { this.jsonEncodedInput = other.jsonEncodedInput; } if (other.isSetAuthKey()) { this.authKey = other.authKey; } } public callApi_args deepCopy() { return new callApi_args(this); } @Override public void clear() { this.moduleName = null; this.functionName = null; this.jsonEncodedInput = null; this.authKey = null; } public String getModuleName() { return this.moduleName; } public callApi_args setModuleName(String moduleName) { this.moduleName = moduleName; return this; } public void unsetModuleName() { this.moduleName = null; } /** * Returns true if field moduleName is set (has been assigned a value) * and false otherwise */ public boolean isSetModuleName() { return this.moduleName != null; } public void setModuleNameIsSet(boolean value) { if (!value) { this.moduleName = null; } } public String getFunctionName() { return this.functionName; } public callApi_args setFunctionName(String functionName) { this.functionName = functionName; return this; } public void unsetFunctionName() { this.functionName = null; } /** * Returns true if field functionName is set (has been assigned a value) * and false otherwise */ public boolean isSetFunctionName() { return this.functionName != null; } public void setFunctionNameIsSet(boolean value) { if (!value) { this.functionName = null; } } public String getJsonEncodedInput() { return this.jsonEncodedInput; } public callApi_args setJsonEncodedInput(String jsonEncodedInput) { this.jsonEncodedInput = jsonEncodedInput; return this; } public void unsetJsonEncodedInput() { this.jsonEncodedInput = null; } /** * Returns true if field jsonEncodedInput is set (has been assigned a * value) and false otherwise */ public boolean isSetJsonEncodedInput() { return this.jsonEncodedInput != null; } public void setJsonEncodedInputIsSet(boolean value) { if (!value) { this.jsonEncodedInput = null; } } public String getAuthKey() { return this.authKey; } public callApi_args setAuthKey(String authKey) { this.authKey = authKey; return this; } public void unsetAuthKey() { this.authKey = null; } /** * Returns true if field authKey is set (has been assigned a value) and * false otherwise */ public boolean isSetAuthKey() { return this.authKey != null; } public void setAuthKeyIsSet(boolean value) { if (!value) { this.authKey = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case MODULE_NAME: if (value == null) { unsetModuleName(); } else { setModuleName((String) value); } break; case FUNCTION_NAME: if (value == null) { unsetFunctionName(); } else { setFunctionName((String) value); } break; case JSON_ENCODED_INPUT: if (value == null) { unsetJsonEncodedInput(); } else { setJsonEncodedInput((String) value); } break; case AUTH_KEY: if (value == null) { unsetAuthKey(); } else { setAuthKey((String) value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case MODULE_NAME: return getModuleName(); case FUNCTION_NAME: return getFunctionName(); case JSON_ENCODED_INPUT: return getJsonEncodedInput(); case AUTH_KEY: return getAuthKey(); } 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 MODULE_NAME: return isSetModuleName(); case FUNCTION_NAME: return isSetFunctionName(); case JSON_ENCODED_INPUT: return isSetJsonEncodedInput(); case AUTH_KEY: return isSetAuthKey(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof callApi_args) return this.equals((callApi_args) that); return false; } public boolean equals(callApi_args that) { if (that == null) return false; boolean this_present_moduleName = true && this.isSetModuleName(); boolean that_present_moduleName = true && that.isSetModuleName(); if (this_present_moduleName || that_present_moduleName) { if (!(this_present_moduleName && that_present_moduleName)) return false; if (!this.moduleName.equals(that.moduleName)) return false; } boolean this_present_functionName = true && this.isSetFunctionName(); boolean that_present_functionName = true && that.isSetFunctionName(); if (this_present_functionName || that_present_functionName) { if (!(this_present_functionName && that_present_functionName)) return false; if (!this.functionName.equals(that.functionName)) return false; } boolean this_present_jsonEncodedInput = true && this.isSetJsonEncodedInput(); boolean that_present_jsonEncodedInput = true && that.isSetJsonEncodedInput(); if (this_present_jsonEncodedInput || that_present_jsonEncodedInput) { if (!(this_present_jsonEncodedInput && that_present_jsonEncodedInput)) return false; if (!this.jsonEncodedInput.equals(that.jsonEncodedInput)) return false; } boolean this_present_authKey = true && this.isSetAuthKey(); boolean that_present_authKey = true && that.isSetAuthKey(); if (this_present_authKey || that_present_authKey) { if (!(this_present_authKey && that_present_authKey)) return false; if (!this.authKey.equals(that.authKey)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(callApi_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; callApi_args typedOther = (callApi_args) other; lastComparison = Boolean.valueOf(isSetModuleName()).compareTo( typedOther.isSetModuleName()); if (lastComparison != 0) { return lastComparison; } if (isSetModuleName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.moduleName, typedOther.moduleName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetFunctionName()).compareTo( typedOther.isSetFunctionName()); if (lastComparison != 0) { return lastComparison; } if (isSetFunctionName()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.functionName, typedOther.functionName); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetJsonEncodedInput()).compareTo( typedOther.isSetJsonEncodedInput()); if (lastComparison != 0) { return lastComparison; } if (isSetJsonEncodedInput()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.jsonEncodedInput, typedOther.jsonEncodedInput); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetAuthKey()).compareTo(typedOther.isSetAuthKey()); if (lastComparison != 0) { return lastComparison; } if (isSetAuthKey()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.authKey, typedOther.authKey); 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("callApi_args("); boolean first = true; sb.append("moduleName:"); if (this.moduleName == null) { sb.append("null"); } else { sb.append(this.moduleName); } first = false; if (!first) sb.append(", "); sb.append("functionName:"); if (this.functionName == null) { sb.append("null"); } else { sb.append(this.functionName); } first = false; if (!first) sb.append(", "); sb.append("jsonEncodedInput:"); if (this.jsonEncodedInput == null) { sb.append("null"); } else { sb.append(this.jsonEncodedInput); } first = false; if (!first) sb.append(", "); sb.append("authKey:"); if (this.authKey == null) { sb.append("null"); } else { sb.append(this.authKey); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields } 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 callApi_argsStandardSchemeFactory implements SchemeFactory { public callApi_argsStandardScheme getScheme() { return new callApi_argsStandardScheme(); } } private static class callApi_argsStandardScheme extends StandardScheme<callApi_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, callApi_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: // MODULE_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.moduleName = iprot.readString(); struct.setModuleNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // FUNCTION_NAME if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.functionName = iprot.readString(); struct.setFunctionNameIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // JSON_ENCODED_INPUT if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.jsonEncodedInput = iprot.readString(); struct.setJsonEncodedInputIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 4: // AUTH_KEY if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.authKey = iprot.readString(); struct.setAuthKeyIsSet(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, callApi_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.moduleName != null) { oprot.writeFieldBegin(MODULE_NAME_FIELD_DESC); oprot.writeString(struct.moduleName); oprot.writeFieldEnd(); } if (struct.functionName != null) { oprot.writeFieldBegin(FUNCTION_NAME_FIELD_DESC); oprot.writeString(struct.functionName); oprot.writeFieldEnd(); } if (struct.jsonEncodedInput != null) { oprot.writeFieldBegin(JSON_ENCODED_INPUT_FIELD_DESC); oprot.writeString(struct.jsonEncodedInput); oprot.writeFieldEnd(); } if (struct.authKey != null) { oprot.writeFieldBegin(AUTH_KEY_FIELD_DESC); oprot.writeString(struct.authKey); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class callApi_argsTupleSchemeFactory implements SchemeFactory { public callApi_argsTupleScheme getScheme() { return new callApi_argsTupleScheme(); } } private static class callApi_argsTupleScheme extends TupleScheme<callApi_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, callApi_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetModuleName()) { optionals.set(0); } if (struct.isSetFunctionName()) { optionals.set(1); } if (struct.isSetJsonEncodedInput()) { optionals.set(2); } if (struct.isSetAuthKey()) { optionals.set(3); } oprot.writeBitSet(optionals, 4); if (struct.isSetModuleName()) { oprot.writeString(struct.moduleName); } if (struct.isSetFunctionName()) { oprot.writeString(struct.functionName); } if (struct.isSetJsonEncodedInput()) { oprot.writeString(struct.jsonEncodedInput); } if (struct.isSetAuthKey()) { oprot.writeString(struct.authKey); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, callApi_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(4); if (incoming.get(0)) { struct.moduleName = iprot.readString(); struct.setModuleNameIsSet(true); } if (incoming.get(1)) { struct.functionName = iprot.readString(); struct.setFunctionNameIsSet(true); } if (incoming.get(2)) { struct.jsonEncodedInput = iprot.readString(); struct.setJsonEncodedInputIsSet(true); } if (incoming.get(3)) { struct.authKey = iprot.readString(); struct.setAuthKeyIsSet(true); } } } } @SuppressWarnings({ "unchecked", "rawtypes" }) public static class callApi_result implements org.apache.thrift.TBase<callApi_result, callApi_result._Fields>, java.io.Serializable, Cloneable { private static final long serialVersionUID = 1L; private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct( "callApi_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 callApi_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new callApi_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(callApi_result.class, metaDataMap); } public callApi_result() { } public callApi_result(String success) { this(); this.success = success; } /** * Performs a deep copy on <i>other</i>. */ public callApi_result(callApi_result other) { if (other.isSetSuccess()) { this.success = other.success; } } public callApi_result deepCopy() { return new callApi_result(this); } @Override public void clear() { this.success = null; } public String getSuccess() { return this.success; } public callApi_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 callApi_result) return this.equals((callApi_result) that); return false; } public boolean equals(callApi_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; } public int compareTo(callApi_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; callApi_result typedOther = (callApi_result) other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { return lastComparison; } if (isSetSuccess()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.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("callApi_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 } 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 callApi_resultStandardSchemeFactory implements SchemeFactory { public callApi_resultStandardScheme getScheme() { return new callApi_resultStandardScheme(); } } private static class callApi_resultStandardScheme extends StandardScheme<callApi_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, callApi_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, callApi_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 callApi_resultTupleSchemeFactory implements SchemeFactory { public callApi_resultTupleScheme getScheme() { return new callApi_resultTupleScheme(); } } private static class callApi_resultTupleScheme extends TupleScheme<callApi_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, callApi_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, callApi_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); } } } } }