Rev 3893 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*** Autogenerated by Thrift Compiler (0.7.0)** DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING*/package in.shop2020.content;import java.util.List;import java.util.ArrayList;import java.util.Map;import java.util.HashMap;import java.util.EnumMap;import java.util.Set;import java.util.HashSet;import java.util.EnumSet;import java.util.Collections;import java.util.BitSet;import java.nio.ByteBuffer;import java.util.Arrays;import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class ContentService {public interface Iface extends in.shop2020.generic.GenericService.Iface {/*** Push the content of the given entity to production** @param entityId*/public boolean pushContentToProduction(long entityId) throws ContentServiceException, org.apache.thrift.TException;}public interface AsyncIface extends in.shop2020.generic.GenericService .AsyncIface {public void pushContentToProduction(long entityId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.pushContentToProduction_call> resultHandler) throws org.apache.thrift.TException;}public static class Client extends in.shop2020.generic.GenericService.Client 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 boolean pushContentToProduction(long entityId) throws ContentServiceException, org.apache.thrift.TException{send_pushContentToProduction(entityId);return recv_pushContentToProduction();}public void send_pushContentToProduction(long entityId) throws org.apache.thrift.TException{pushContentToProduction_args args = new pushContentToProduction_args();args.setEntityId(entityId);sendBase("pushContentToProduction", args);}public boolean recv_pushContentToProduction() throws ContentServiceException, org.apache.thrift.TException{pushContentToProduction_result result = new pushContentToProduction_result();receiveBase(result, "pushContentToProduction");if (result.isSetSuccess()) {return result.success;}if (result.cse != null) {throw result.cse;}throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "pushContentToProduction failed: unknown result");}}public static class AsyncClient extends in.shop2020.generic.GenericService.AsyncClient 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 pushContentToProduction(long entityId, org.apache.thrift.async.AsyncMethodCallback<pushContentToProduction_call> resultHandler) throws org.apache.thrift.TException {checkReady();pushContentToProduction_call method_call = new pushContentToProduction_call(entityId, resultHandler, this, ___protocolFactory, ___transport);this.___currentMethod = method_call;___manager.call(method_call);}public static class pushContentToProduction_call extends org.apache.thrift.async.TAsyncMethodCall {private long entityId;public pushContentToProduction_call(long entityId, org.apache.thrift.async.AsyncMethodCallback<pushContentToProduction_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.entityId = entityId;}public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("pushContentToProduction", org.apache.thrift.protocol.TMessageType.CALL, 0));pushContentToProduction_args args = new pushContentToProduction_args();args.setEntityId(entityId);args.write(prot);prot.writeMessageEnd();}public boolean getResult() throws ContentServiceException, 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_pushContentToProduction();}}}public static class Processor<I extends Iface> extends in.shop2020.generic.GenericService.Processor implements org.apache.thrift.TProcessor {private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());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("pushContentToProduction", new pushContentToProduction());return processMap;}private static class pushContentToProduction<I extends Iface> extends org.apache.thrift.ProcessFunction<I, pushContentToProduction_args> {public pushContentToProduction() {super("pushContentToProduction");}protected pushContentToProduction_args getEmptyArgsInstance() {return new pushContentToProduction_args();}protected pushContentToProduction_result getResult(I iface, pushContentToProduction_args args) throws org.apache.thrift.TException {pushContentToProduction_result result = new pushContentToProduction_result();try {result.success = iface.pushContentToProduction(args.entityId);result.setSuccessIsSet(true);} catch (ContentServiceException cse) {result.cse = cse;}return result;}}}public static class pushContentToProduction_args implements org.apache.thrift.TBase<pushContentToProduction_args, pushContentToProduction_args._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pushContentToProduction_args");private static final org.apache.thrift.protocol.TField ENTITY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("entityId", org.apache.thrift.protocol.TType.I64, (short)1);private long entityId; // 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 {ENTITY_ID((short)1, "entityId");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: // ENTITY_IDreturn ENTITY_ID;default:return null;}}/*** Find the _Fields constant that matches fieldId, throwing an exception* if it is not found.*/public static _Fields findByThriftIdOrThrow(int fieldId) {_Fields fields = findByThriftId(fieldId);if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");return fields;}/*** Find the _Fields constant that matches name, or null if its not found.*/public static _Fields findByName(String name) {return byName.get(name);}private final short _thriftId;private final String _fieldName;_Fields(short thriftId, String fieldName) {_thriftId = thriftId;_fieldName = fieldName;}public short getThriftFieldId() {return _thriftId;}public String getFieldName() {return _fieldName;}}// isset id assignmentsprivate static final int __ENTITYID_ISSET_ID = 0;private BitSet __isset_bit_vector = new BitSet(1);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.ENTITY_ID, new org.apache.thrift.meta_data.FieldMetaData("entityId", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pushContentToProduction_args.class, metaDataMap);}public pushContentToProduction_args() {}public pushContentToProduction_args(long entityId){this();this.entityId = entityId;setEntityIdIsSet(true);}/*** Performs a deep copy on <i>other</i>.*/public pushContentToProduction_args(pushContentToProduction_args other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.entityId = other.entityId;}public pushContentToProduction_args deepCopy() {return new pushContentToProduction_args(this);}@Overridepublic void clear() {setEntityIdIsSet(false);this.entityId = 0;}public long getEntityId() {return this.entityId;}public void setEntityId(long entityId) {this.entityId = entityId;setEntityIdIsSet(true);}public void unsetEntityId() {__isset_bit_vector.clear(__ENTITYID_ISSET_ID);}/** Returns true if field entityId is set (has been assigned a value) and false otherwise */public boolean isSetEntityId() {return __isset_bit_vector.get(__ENTITYID_ISSET_ID);}public void setEntityIdIsSet(boolean value) {__isset_bit_vector.set(__ENTITYID_ISSET_ID, value);}public void setFieldValue(_Fields field, Object value) {switch (field) {case ENTITY_ID:if (value == null) {unsetEntityId();} else {setEntityId((Long)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case ENTITY_ID:return Long.valueOf(getEntityId());}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 ENTITY_ID:return isSetEntityId();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof pushContentToProduction_args)return this.equals((pushContentToProduction_args)that);return false;}public boolean equals(pushContentToProduction_args that) {if (that == null)return false;boolean this_present_entityId = true;boolean that_present_entityId = true;if (this_present_entityId || that_present_entityId) {if (!(this_present_entityId && that_present_entityId))return false;if (this.entityId != that.entityId)return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(pushContentToProduction_args other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;pushContentToProduction_args typedOther = (pushContentToProduction_args)other;lastComparison = Boolean.valueOf(isSetEntityId()).compareTo(typedOther.isSetEntityId());if (lastComparison != 0) {return lastComparison;}if (isSetEntityId()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.entityId, typedOther.entityId);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 {org.apache.thrift.protocol.TField field;iprot.readStructBegin();while (true){field = iprot.readFieldBegin();if (field.type == org.apache.thrift.protocol.TType.STOP) {break;}switch (field.id) {case 1: // ENTITY_IDif (field.type == org.apache.thrift.protocol.TType.I64) {this.entityId = iprot.readI64();setEntityIdIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;default:org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}iprot.readFieldEnd();}iprot.readStructEnd();validate();}public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {validate();oprot.writeStructBegin(STRUCT_DESC);oprot.writeFieldBegin(ENTITY_ID_FIELD_DESC);oprot.writeI64(this.entityId);oprot.writeFieldEnd();oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("pushContentToProduction_args(");boolean first = true;sb.append("entityId:");sb.append(this.entityId);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 {// it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor.__isset_bit_vector = new BitSet(1);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);}}}public static class pushContentToProduction_result implements org.apache.thrift.TBase<pushContentToProduction_result, pushContentToProduction_result._Fields>, java.io.Serializable, Cloneable {private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("pushContentToProduction_result");private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);private static final org.apache.thrift.protocol.TField CSE_FIELD_DESC = new org.apache.thrift.protocol.TField("cse", org.apache.thrift.protocol.TType.STRUCT, (short)1);private boolean success; // requiredprivate ContentServiceException cse; // 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"),CSE((short)1, "cse");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: // SUCCESSreturn SUCCESS;case 1: // CSEreturn CSE;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 assignmentsprivate static final int __SUCCESS_ISSET_ID = 0;private BitSet __isset_bit_vector = new BitSet(1);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.BOOL)));tmpMap.put(_Fields.CSE, new org.apache.thrift.meta_data.FieldMetaData("cse", org.apache.thrift.TFieldRequirementType.DEFAULT,new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT)));metaDataMap = Collections.unmodifiableMap(tmpMap);org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(pushContentToProduction_result.class, metaDataMap);}public pushContentToProduction_result() {}public pushContentToProduction_result(boolean success,ContentServiceException cse){this();this.success = success;setSuccessIsSet(true);this.cse = cse;}/*** Performs a deep copy on <i>other</i>.*/public pushContentToProduction_result(pushContentToProduction_result other) {__isset_bit_vector.clear();__isset_bit_vector.or(other.__isset_bit_vector);this.success = other.success;if (other.isSetCse()) {this.cse = new ContentServiceException(other.cse);}}public pushContentToProduction_result deepCopy() {return new pushContentToProduction_result(this);}@Overridepublic void clear() {setSuccessIsSet(false);this.success = false;this.cse = null;}public boolean isSuccess() {return this.success;}public void setSuccess(boolean success) {this.success = success;setSuccessIsSet(true);}public void unsetSuccess() {__isset_bit_vector.clear(__SUCCESS_ISSET_ID);}/** Returns true if field success is set (has been assigned a value) and false otherwise */public boolean isSetSuccess() {return __isset_bit_vector.get(__SUCCESS_ISSET_ID);}public void setSuccessIsSet(boolean value) {__isset_bit_vector.set(__SUCCESS_ISSET_ID, value);}public ContentServiceException getCse() {return this.cse;}public void setCse(ContentServiceException cse) {this.cse = cse;}public void unsetCse() {this.cse = null;}/** Returns true if field cse is set (has been assigned a value) and false otherwise */public boolean isSetCse() {return this.cse != null;}public void setCseIsSet(boolean value) {if (!value) {this.cse = null;}}public void setFieldValue(_Fields field, Object value) {switch (field) {case SUCCESS:if (value == null) {unsetSuccess();} else {setSuccess((Boolean)value);}break;case CSE:if (value == null) {unsetCse();} else {setCse((ContentServiceException)value);}break;}}public Object getFieldValue(_Fields field) {switch (field) {case SUCCESS:return Boolean.valueOf(isSuccess());case CSE:return getCse();}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();case CSE:return isSetCse();}throw new IllegalStateException();}@Overridepublic boolean equals(Object that) {if (that == null)return false;if (that instanceof pushContentToProduction_result)return this.equals((pushContentToProduction_result)that);return false;}public boolean equals(pushContentToProduction_result that) {if (that == null)return false;boolean this_present_success = true;boolean that_present_success = true;if (this_present_success || that_present_success) {if (!(this_present_success && that_present_success))return false;if (this.success != that.success)return false;}boolean this_present_cse = true && this.isSetCse();boolean that_present_cse = true && that.isSetCse();if (this_present_cse || that_present_cse) {if (!(this_present_cse && that_present_cse))return false;if (!this.cse.equals(that.cse))return false;}return true;}@Overridepublic int hashCode() {return 0;}public int compareTo(pushContentToProduction_result other) {if (!getClass().equals(other.getClass())) {return getClass().getName().compareTo(other.getClass().getName());}int lastComparison = 0;pushContentToProduction_result typedOther = (pushContentToProduction_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;}}lastComparison = Boolean.valueOf(isSetCse()).compareTo(typedOther.isSetCse());if (lastComparison != 0) {return lastComparison;}if (isSetCse()) {lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cse, typedOther.cse);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 {org.apache.thrift.protocol.TField field;iprot.readStructBegin();while (true){field = iprot.readFieldBegin();if (field.type == org.apache.thrift.protocol.TType.STOP) {break;}switch (field.id) {case 0: // SUCCESSif (field.type == org.apache.thrift.protocol.TType.BOOL) {this.success = iprot.readBool();setSuccessIsSet(true);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;case 1: // CSEif (field.type == org.apache.thrift.protocol.TType.STRUCT) {this.cse = new ContentServiceException();this.cse.read(iprot);} else {org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}break;default:org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);}iprot.readFieldEnd();}iprot.readStructEnd();validate();}public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {oprot.writeStructBegin(STRUCT_DESC);if (this.isSetSuccess()) {oprot.writeFieldBegin(SUCCESS_FIELD_DESC);oprot.writeBool(this.success);oprot.writeFieldEnd();} else if (this.isSetCse()) {oprot.writeFieldBegin(CSE_FIELD_DESC);this.cse.write(oprot);oprot.writeFieldEnd();}oprot.writeFieldStop();oprot.writeStructEnd();}@Overridepublic String toString() {StringBuilder sb = new StringBuilder("pushContentToProduction_result(");boolean first = true;sb.append("success:");sb.append(this.success);first = false;if (!first) sb.append(", ");sb.append("cse:");if (this.cse == null) {sb.append("null");} else {sb.append(this.cse);}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);}}}}