/** * Autogenerated by Thrift * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING */ package com.flaptor.indextank.rpc; 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; import org.apache.thrift.*; import org.apache.thrift.async.*; import org.apache.thrift.meta_data.*; import org.apache.thrift.transport.*; import org.apache.thrift.protocol.*; @SuppressWarnings("all") public class DeployManager { public interface Iface { public void service_deploys() throws NebuException, TException; public void delete_index(String index_code) throws NebuException, TException; public void redeploy_index(String index_code) throws NebuException, TException; } public interface AsyncIface { public void service_deploys(AsyncMethodCallback<AsyncClient.service_deploys_call> resultHandler) throws TException; public void delete_index(String index_code, AsyncMethodCallback<AsyncClient.delete_index_call> resultHandler) throws TException; public void redeploy_index(String index_code, AsyncMethodCallback<AsyncClient.redeploy_index_call> resultHandler) throws TException; } public static class Client implements TServiceClient, Iface { public static class Factory implements TServiceClientFactory<Client> { public Factory() {} public Client getClient(TProtocol prot) { return new Client(prot); } public Client getClient(TProtocol iprot, TProtocol oprot) { return new Client(iprot, oprot); } } public Client(TProtocol prot) { this(prot, prot); } public Client(TProtocol iprot, TProtocol oprot) { iprot_ = iprot; oprot_ = oprot; } protected TProtocol iprot_; protected TProtocol oprot_; protected int seqid_; public TProtocol getInputProtocol() { return this.iprot_; } public TProtocol getOutputProtocol() { return this.oprot_; } public void service_deploys() throws NebuException, TException { send_service_deploys(); recv_service_deploys(); } public void send_service_deploys() throws TException { oprot_.writeMessageBegin(new TMessage("service_deploys", TMessageType.CALL, ++seqid_)); service_deploys_args args = new service_deploys_args(); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_service_deploys() throws NebuException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "service_deploys failed: out of sequence response"); } service_deploys_result result = new service_deploys_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ne != null) { throw result.ne; } return; } public void delete_index(String index_code) throws NebuException, TException { send_delete_index(index_code); recv_delete_index(); } public void send_delete_index(String index_code) throws TException { oprot_.writeMessageBegin(new TMessage("delete_index", TMessageType.CALL, ++seqid_)); delete_index_args args = new delete_index_args(); args.set_index_code(index_code); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_delete_index() throws NebuException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "delete_index failed: out of sequence response"); } delete_index_result result = new delete_index_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ne != null) { throw result.ne; } return; } public void redeploy_index(String index_code) throws NebuException, TException { send_redeploy_index(index_code); recv_redeploy_index(); } public void send_redeploy_index(String index_code) throws TException { oprot_.writeMessageBegin(new TMessage("redeploy_index", TMessageType.CALL, ++seqid_)); redeploy_index_args args = new redeploy_index_args(); args.set_index_code(index_code); args.write(oprot_); oprot_.writeMessageEnd(); oprot_.getTransport().flush(); } public void recv_redeploy_index() throws NebuException, TException { TMessage msg = iprot_.readMessageBegin(); if (msg.type == TMessageType.EXCEPTION) { TApplicationException x = TApplicationException.read(iprot_); iprot_.readMessageEnd(); throw x; } if (msg.seqid != seqid_) { throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, "redeploy_index failed: out of sequence response"); } redeploy_index_result result = new redeploy_index_result(); result.read(iprot_); iprot_.readMessageEnd(); if (result.ne != null) { throw result.ne; } return; } } public static class AsyncClient extends TAsyncClient implements AsyncIface { public static class Factory implements TAsyncClientFactory<AsyncClient> { private TAsyncClientManager clientManager; private TProtocolFactory protocolFactory; public Factory(TAsyncClientManager clientManager, TProtocolFactory protocolFactory) { this.clientManager = clientManager; this.protocolFactory = protocolFactory; } public AsyncClient getAsyncClient(TNonblockingTransport transport) { return new AsyncClient(protocolFactory, clientManager, transport); } } public AsyncClient(TProtocolFactory protocolFactory, TAsyncClientManager clientManager, TNonblockingTransport transport) { super(protocolFactory, clientManager, transport); } public void service_deploys(AsyncMethodCallback<service_deploys_call> resultHandler) throws TException { checkReady(); service_deploys_call method_call = new service_deploys_call(resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class service_deploys_call extends TAsyncMethodCall { public service_deploys_call(AsyncMethodCallback<service_deploys_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("service_deploys", TMessageType.CALL, 0)); service_deploys_args args = new service_deploys_args(); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws NebuException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_service_deploys(); } } public void delete_index(String index_code, AsyncMethodCallback<delete_index_call> resultHandler) throws TException { checkReady(); delete_index_call method_call = new delete_index_call(index_code, resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class delete_index_call extends TAsyncMethodCall { private String index_code; public delete_index_call(String index_code, AsyncMethodCallback<delete_index_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); this.index_code = index_code; } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("delete_index", TMessageType.CALL, 0)); delete_index_args args = new delete_index_args(); args.set_index_code(index_code); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws NebuException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_delete_index(); } } public void redeploy_index(String index_code, AsyncMethodCallback<redeploy_index_call> resultHandler) throws TException { checkReady(); redeploy_index_call method_call = new redeploy_index_call(index_code, resultHandler, this, protocolFactory, transport); manager.call(method_call); } public static class redeploy_index_call extends TAsyncMethodCall { private String index_code; public redeploy_index_call(String index_code, AsyncMethodCallback<redeploy_index_call> resultHandler, TAsyncClient client, TProtocolFactory protocolFactory, TNonblockingTransport transport) throws TException { super(client, protocolFactory, transport, resultHandler, false); this.index_code = index_code; } public void write_args(TProtocol prot) throws TException { prot.writeMessageBegin(new TMessage("redeploy_index", TMessageType.CALL, 0)); redeploy_index_args args = new redeploy_index_args(); args.set_index_code(index_code); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws NebuException, TException { if (getState() != State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } TMemoryInputTransport memoryTransport = new TMemoryInputTransport(getFrameBuffer().array()); TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); (new Client(prot)).recv_redeploy_index(); } } } public static class Processor implements TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(Iface iface) { iface_ = iface; processMap_.put("service_deploys", new service_deploys()); processMap_.put("delete_index", new delete_index()); processMap_.put("redeploy_index", new redeploy_index()); } protected static interface ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException; } private Iface iface_; protected final HashMap<String,ProcessFunction> processMap_ = new HashMap<String,ProcessFunction>(); public boolean process(TProtocol iprot, TProtocol oprot) throws TException { TMessage msg = iprot.readMessageBegin(); ProcessFunction fn = processMap_.get(msg.name); if (fn == null) { TProtocolUtil.skip(iprot, TType.STRUCT); iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, "Invalid method name: '"+msg.name+"'"); oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return true; } fn.process(msg.seqid, iprot, oprot); return true; } private class service_deploys implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { service_deploys_args args = new service_deploys_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("service_deploys", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); service_deploys_result result = new service_deploys_result(); try { iface_.service_deploys(); } catch (NebuException ne) { result.ne = ne; } catch (Throwable th) { LOGGER.error("Internal error processing service_deploys", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing service_deploys"); oprot.writeMessageBegin(new TMessage("service_deploys", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("service_deploys", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class delete_index implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { delete_index_args args = new delete_index_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("delete_index", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); delete_index_result result = new delete_index_result(); try { iface_.delete_index(args.index_code); } catch (NebuException ne) { result.ne = ne; } catch (Throwable th) { LOGGER.error("Internal error processing delete_index", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing delete_index"); oprot.writeMessageBegin(new TMessage("delete_index", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("delete_index", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } private class redeploy_index implements ProcessFunction { public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException { redeploy_index_args args = new redeploy_index_args(); try { args.read(iprot); } catch (TProtocolException e) { iprot.readMessageEnd(); TApplicationException x = new TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage()); oprot.writeMessageBegin(new TMessage("redeploy_index", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } iprot.readMessageEnd(); redeploy_index_result result = new redeploy_index_result(); try { iface_.redeploy_index(args.index_code); } catch (NebuException ne) { result.ne = ne; } catch (Throwable th) { LOGGER.error("Internal error processing redeploy_index", th); TApplicationException x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "Internal error processing redeploy_index"); oprot.writeMessageBegin(new TMessage("redeploy_index", TMessageType.EXCEPTION, seqid)); x.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); return; } oprot.writeMessageBegin(new TMessage("redeploy_index", TMessageType.REPLY, seqid)); result.write(oprot); oprot.writeMessageEnd(); oprot.getTransport().flush(); } } } public static class service_deploys_args implements TBase<service_deploys_args, service_deploys_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("service_deploys_args"); /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(service_deploys_args.class, metaDataMap); } public service_deploys_args() { } /** * Performs a deep copy on <i>other</i>. */ public service_deploys_args(service_deploys_args other) { } public service_deploys_args deepCopy() { return new service_deploys_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 asigned 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 service_deploys_args) return this.equals((service_deploys_args)that); return false; } public boolean equals(service_deploys_args that) { if (that == null) return false; return true; } @Override public int hashCode() { return 0; } public int compareTo(service_deploys_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; service_deploys_args typedOther = (service_deploys_args)other; return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("service_deploys_args("); boolean first = true; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class service_deploys_result implements TBase<service_deploys_result, service_deploys_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("service_deploys_result"); private static final TField NE_FIELD_DESC = new TField("ne", TType.STRUCT, (short)1); private NebuException ne; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { NE((short)1, "ne"); 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: // NE return NE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NE, new FieldMetaData("ne", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(service_deploys_result.class, metaDataMap); } public service_deploys_result() { } public service_deploys_result( NebuException ne) { this(); this.ne = ne; } /** * Performs a deep copy on <i>other</i>. */ public service_deploys_result(service_deploys_result other) { if (other.is_set_ne()) { this.ne = new NebuException(other.ne); } } public service_deploys_result deepCopy() { return new service_deploys_result(this); } @Override public void clear() { this.ne = null; } public NebuException get_ne() { return this.ne; } public service_deploys_result set_ne(NebuException ne) { this.ne = ne; return this; } public void unset_ne() { this.ne = null; } /** Returns true if field ne is set (has been asigned a value) and false otherwise */ public boolean is_set_ne() { return this.ne != null; } public void set_ne_isSet(boolean value) { if (!value) { this.ne = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case NE: if (value == null) { unset_ne(); } else { set_ne((NebuException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case NE: return get_ne(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NE: return is_set_ne(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof service_deploys_result) return this.equals((service_deploys_result)that); return false; } public boolean equals(service_deploys_result that) { if (that == null) return false; boolean this_present_ne = true && this.is_set_ne(); boolean that_present_ne = true && that.is_set_ne(); if (this_present_ne || that_present_ne) { if (!(this_present_ne && that_present_ne)) return false; if (!this.ne.equals(that.ne)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(service_deploys_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; service_deploys_result typedOther = (service_deploys_result)other; lastComparison = Boolean.valueOf(is_set_ne()).compareTo(typedOther.is_set_ne()); if (lastComparison != 0) { return lastComparison; } if (is_set_ne()) { lastComparison = TBaseHelper.compareTo(this.ne, typedOther.ne); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // NE if (field.type == TType.STRUCT) { this.ne = new NebuException(); this.ne.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_ne()) { oprot.writeFieldBegin(NE_FIELD_DESC); this.ne.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("service_deploys_result("); boolean first = true; sb.append("ne:"); if (this.ne == null) { sb.append("null"); } else { sb.append(this.ne); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class delete_index_args implements TBase<delete_index_args, delete_index_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("delete_index_args"); private static final TField INDEX_CODE_FIELD_DESC = new TField("index_code", TType.STRING, (short)1); private String index_code; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { INDEX_CODE((short)1, "index_code"); 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: // INDEX_CODE return INDEX_CODE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.INDEX_CODE, new FieldMetaData("index_code", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(delete_index_args.class, metaDataMap); } public delete_index_args() { } public delete_index_args( String index_code) { this(); this.index_code = index_code; } /** * Performs a deep copy on <i>other</i>. */ public delete_index_args(delete_index_args other) { if (other.is_set_index_code()) { this.index_code = other.index_code; } } public delete_index_args deepCopy() { return new delete_index_args(this); } @Override public void clear() { this.index_code = null; } public String get_index_code() { return this.index_code; } public delete_index_args set_index_code(String index_code) { this.index_code = index_code; return this; } public void unset_index_code() { this.index_code = null; } /** Returns true if field index_code is set (has been asigned a value) and false otherwise */ public boolean is_set_index_code() { return this.index_code != null; } public void set_index_code_isSet(boolean value) { if (!value) { this.index_code = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case INDEX_CODE: if (value == null) { unset_index_code(); } else { set_index_code((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case INDEX_CODE: return get_index_code(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case INDEX_CODE: return is_set_index_code(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof delete_index_args) return this.equals((delete_index_args)that); return false; } public boolean equals(delete_index_args that) { if (that == null) return false; boolean this_present_index_code = true && this.is_set_index_code(); boolean that_present_index_code = true && that.is_set_index_code(); if (this_present_index_code || that_present_index_code) { if (!(this_present_index_code && that_present_index_code)) return false; if (!this.index_code.equals(that.index_code)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(delete_index_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; delete_index_args typedOther = (delete_index_args)other; lastComparison = Boolean.valueOf(is_set_index_code()).compareTo(typedOther.is_set_index_code()); if (lastComparison != 0) { return lastComparison; } if (is_set_index_code()) { lastComparison = TBaseHelper.compareTo(this.index_code, typedOther.index_code); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // INDEX_CODE if (field.type == TType.STRING) { this.index_code = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.index_code != null) { oprot.writeFieldBegin(INDEX_CODE_FIELD_DESC); oprot.writeString(this.index_code); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("delete_index_args("); boolean first = true; sb.append("index_code:"); if (this.index_code == null) { sb.append("null"); } else { sb.append(this.index_code); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class delete_index_result implements TBase<delete_index_result, delete_index_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("delete_index_result"); private static final TField NE_FIELD_DESC = new TField("ne", TType.STRUCT, (short)1); private NebuException ne; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { NE((short)1, "ne"); 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: // NE return NE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NE, new FieldMetaData("ne", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(delete_index_result.class, metaDataMap); } public delete_index_result() { } public delete_index_result( NebuException ne) { this(); this.ne = ne; } /** * Performs a deep copy on <i>other</i>. */ public delete_index_result(delete_index_result other) { if (other.is_set_ne()) { this.ne = new NebuException(other.ne); } } public delete_index_result deepCopy() { return new delete_index_result(this); } @Override public void clear() { this.ne = null; } public NebuException get_ne() { return this.ne; } public delete_index_result set_ne(NebuException ne) { this.ne = ne; return this; } public void unset_ne() { this.ne = null; } /** Returns true if field ne is set (has been asigned a value) and false otherwise */ public boolean is_set_ne() { return this.ne != null; } public void set_ne_isSet(boolean value) { if (!value) { this.ne = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case NE: if (value == null) { unset_ne(); } else { set_ne((NebuException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case NE: return get_ne(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NE: return is_set_ne(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof delete_index_result) return this.equals((delete_index_result)that); return false; } public boolean equals(delete_index_result that) { if (that == null) return false; boolean this_present_ne = true && this.is_set_ne(); boolean that_present_ne = true && that.is_set_ne(); if (this_present_ne || that_present_ne) { if (!(this_present_ne && that_present_ne)) return false; if (!this.ne.equals(that.ne)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(delete_index_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; delete_index_result typedOther = (delete_index_result)other; lastComparison = Boolean.valueOf(is_set_ne()).compareTo(typedOther.is_set_ne()); if (lastComparison != 0) { return lastComparison; } if (is_set_ne()) { lastComparison = TBaseHelper.compareTo(this.ne, typedOther.ne); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // NE if (field.type == TType.STRUCT) { this.ne = new NebuException(); this.ne.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_ne()) { oprot.writeFieldBegin(NE_FIELD_DESC); this.ne.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("delete_index_result("); boolean first = true; sb.append("ne:"); if (this.ne == null) { sb.append("null"); } else { sb.append(this.ne); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class redeploy_index_args implements TBase<redeploy_index_args, redeploy_index_args._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("redeploy_index_args"); private static final TField INDEX_CODE_FIELD_DESC = new TField("index_code", TType.STRING, (short)1); private String index_code; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { INDEX_CODE((short)1, "index_code"); 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: // INDEX_CODE return INDEX_CODE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.INDEX_CODE, new FieldMetaData("index_code", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRING))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(redeploy_index_args.class, metaDataMap); } public redeploy_index_args() { } public redeploy_index_args( String index_code) { this(); this.index_code = index_code; } /** * Performs a deep copy on <i>other</i>. */ public redeploy_index_args(redeploy_index_args other) { if (other.is_set_index_code()) { this.index_code = other.index_code; } } public redeploy_index_args deepCopy() { return new redeploy_index_args(this); } @Override public void clear() { this.index_code = null; } public String get_index_code() { return this.index_code; } public redeploy_index_args set_index_code(String index_code) { this.index_code = index_code; return this; } public void unset_index_code() { this.index_code = null; } /** Returns true if field index_code is set (has been asigned a value) and false otherwise */ public boolean is_set_index_code() { return this.index_code != null; } public void set_index_code_isSet(boolean value) { if (!value) { this.index_code = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case INDEX_CODE: if (value == null) { unset_index_code(); } else { set_index_code((String)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case INDEX_CODE: return get_index_code(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case INDEX_CODE: return is_set_index_code(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof redeploy_index_args) return this.equals((redeploy_index_args)that); return false; } public boolean equals(redeploy_index_args that) { if (that == null) return false; boolean this_present_index_code = true && this.is_set_index_code(); boolean that_present_index_code = true && that.is_set_index_code(); if (this_present_index_code || that_present_index_code) { if (!(this_present_index_code && that_present_index_code)) return false; if (!this.index_code.equals(that.index_code)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(redeploy_index_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; redeploy_index_args typedOther = (redeploy_index_args)other; lastComparison = Boolean.valueOf(is_set_index_code()).compareTo(typedOther.is_set_index_code()); if (lastComparison != 0) { return lastComparison; } if (is_set_index_code()) { lastComparison = TBaseHelper.compareTo(this.index_code, typedOther.index_code); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // INDEX_CODE if (field.type == TType.STRING) { this.index_code = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { validate(); oprot.writeStructBegin(STRUCT_DESC); if (this.index_code != null) { oprot.writeFieldBegin(INDEX_CODE_FIELD_DESC); oprot.writeString(this.index_code); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("redeploy_index_args("); boolean first = true; sb.append("index_code:"); if (this.index_code == null) { sb.append("null"); } else { sb.append(this.index_code); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } public static class redeploy_index_result implements TBase<redeploy_index_result, redeploy_index_result._Fields>, java.io.Serializable, Cloneable { private static final TStruct STRUCT_DESC = new TStruct("redeploy_index_result"); private static final TField NE_FIELD_DESC = new TField("ne", TType.STRUCT, (short)1); private NebuException ne; /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements TFieldIdEnum { NE((short)1, "ne"); 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: // NE return NE; 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, FieldMetaData> metaDataMap; static { Map<_Fields, FieldMetaData> tmpMap = new EnumMap<_Fields, FieldMetaData>(_Fields.class); tmpMap.put(_Fields.NE, new FieldMetaData("ne", TFieldRequirementType.DEFAULT, new FieldValueMetaData(TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); FieldMetaData.addStructMetaDataMap(redeploy_index_result.class, metaDataMap); } public redeploy_index_result() { } public redeploy_index_result( NebuException ne) { this(); this.ne = ne; } /** * Performs a deep copy on <i>other</i>. */ public redeploy_index_result(redeploy_index_result other) { if (other.is_set_ne()) { this.ne = new NebuException(other.ne); } } public redeploy_index_result deepCopy() { return new redeploy_index_result(this); } @Override public void clear() { this.ne = null; } public NebuException get_ne() { return this.ne; } public redeploy_index_result set_ne(NebuException ne) { this.ne = ne; return this; } public void unset_ne() { this.ne = null; } /** Returns true if field ne is set (has been asigned a value) and false otherwise */ public boolean is_set_ne() { return this.ne != null; } public void set_ne_isSet(boolean value) { if (!value) { this.ne = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case NE: if (value == null) { unset_ne(); } else { set_ne((NebuException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case NE: return get_ne(); } throw new IllegalStateException(); } /** Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case NE: return is_set_ne(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof redeploy_index_result) return this.equals((redeploy_index_result)that); return false; } public boolean equals(redeploy_index_result that) { if (that == null) return false; boolean this_present_ne = true && this.is_set_ne(); boolean that_present_ne = true && that.is_set_ne(); if (this_present_ne || that_present_ne) { if (!(this_present_ne && that_present_ne)) return false; if (!this.ne.equals(that.ne)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(redeploy_index_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; redeploy_index_result typedOther = (redeploy_index_result)other; lastComparison = Boolean.valueOf(is_set_ne()).compareTo(typedOther.is_set_ne()); if (lastComparison != 0) { return lastComparison; } if (is_set_ne()) { lastComparison = TBaseHelper.compareTo(this.ne, typedOther.ne); if (lastComparison != 0) { return lastComparison; } } return 0; } public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } public void read(TProtocol iprot) throws TException { TField field; iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // NE if (field.type == TType.STRUCT) { this.ne = new NebuException(); this.ne.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); } public void write(TProtocol oprot) throws TException { oprot.writeStructBegin(STRUCT_DESC); if (this.is_set_ne()) { oprot.writeFieldBegin(NE_FIELD_DESC); this.ne.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } @Override public String toString() { StringBuilder sb = new StringBuilder("redeploy_index_result("); boolean first = true; sb.append("ne:"); if (this.ne == null) { sb.append("null"); } else { sb.append(this.ne); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws TException { // check for required fields } } }