/** * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING * @generated */ package org.apache.hadoop.hdfs.notifier; import org.apache.thrift.scheme.IScheme; import org.apache.thrift.scheme.SchemeFactory; import org.apache.thrift.scheme.StandardScheme; import org.apache.thrift.scheme.TupleScheme; import org.apache.thrift.protocol.TTupleProtocol; import org.apache.thrift.protocol.TProtocolException; import org.apache.thrift.EncodingUtils; import org.apache.thrift.TException; import 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 ServerHandler { public interface Iface { public void subscribe(long clientId, NamespaceEvent subscribedEvent, long txId) throws InvalidClientIdException, TransactionIdTooOldException, org.apache.thrift.TException; public void unsubscribe(long clientId, NamespaceEvent subscribedEvent) throws InvalidClientIdException, ClientNotSubscribedException, org.apache.thrift.TException; public void registerClient(String host, int port, long token) throws RampUpException, ClientConnectionException, org.apache.thrift.TException; public void unregisterClient(long clientId) throws InvalidClientIdException, org.apache.thrift.TException; } public interface AsyncIface { public void subscribe(long clientId, NamespaceEvent subscribedEvent, long txId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.subscribe_call> resultHandler) throws org.apache.thrift.TException; public void unsubscribe(long clientId, NamespaceEvent subscribedEvent, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.unsubscribe_call> resultHandler) throws org.apache.thrift.TException; public void registerClient(String host, int port, long token, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.registerClient_call> resultHandler) throws org.apache.thrift.TException; public void unregisterClient(long clientId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.unregisterClient_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 void subscribe(long clientId, NamespaceEvent subscribedEvent, long txId) throws InvalidClientIdException, TransactionIdTooOldException, org.apache.thrift.TException { send_subscribe(clientId, subscribedEvent, txId); recv_subscribe(); } public void send_subscribe(long clientId, NamespaceEvent subscribedEvent, long txId) throws org.apache.thrift.TException { subscribe_args args = new subscribe_args(); args.setClientId(clientId); args.setSubscribedEvent(subscribedEvent); args.setTxId(txId); sendBase("subscribe", args); } public void recv_subscribe() throws InvalidClientIdException, TransactionIdTooOldException, org.apache.thrift.TException { subscribe_result result = new subscribe_result(); receiveBase(result, "subscribe"); if (result.invalidClientId != null) { throw result.invalidClientId; } if (result.transactionIdTooOld != null) { throw result.transactionIdTooOld; } return; } public void unsubscribe(long clientId, NamespaceEvent subscribedEvent) throws InvalidClientIdException, ClientNotSubscribedException, org.apache.thrift.TException { send_unsubscribe(clientId, subscribedEvent); recv_unsubscribe(); } public void send_unsubscribe(long clientId, NamespaceEvent subscribedEvent) throws org.apache.thrift.TException { unsubscribe_args args = new unsubscribe_args(); args.setClientId(clientId); args.setSubscribedEvent(subscribedEvent); sendBase("unsubscribe", args); } public void recv_unsubscribe() throws InvalidClientIdException, ClientNotSubscribedException, org.apache.thrift.TException { unsubscribe_result result = new unsubscribe_result(); receiveBase(result, "unsubscribe"); if (result.invalidClientId != null) { throw result.invalidClientId; } if (result.clientNotSubscribed != null) { throw result.clientNotSubscribed; } return; } public void registerClient(String host, int port, long token) throws RampUpException, ClientConnectionException, org.apache.thrift.TException { send_registerClient(host, port, token); recv_registerClient(); } public void send_registerClient(String host, int port, long token) throws org.apache.thrift.TException { registerClient_args args = new registerClient_args(); args.setHost(host); args.setPort(port); args.setToken(token); sendBase("registerClient", args); } public void recv_registerClient() throws RampUpException, ClientConnectionException, org.apache.thrift.TException { registerClient_result result = new registerClient_result(); receiveBase(result, "registerClient"); if (result.rampUp != null) { throw result.rampUp; } if (result.clientConnection != null) { throw result.clientConnection; } return; } public void unregisterClient(long clientId) throws InvalidClientIdException, org.apache.thrift.TException { send_unregisterClient(clientId); recv_unregisterClient(); } public void send_unregisterClient(long clientId) throws org.apache.thrift.TException { unregisterClient_args args = new unregisterClient_args(); args.setClientId(clientId); sendBase("unregisterClient", args); } public void recv_unregisterClient() throws InvalidClientIdException, org.apache.thrift.TException { unregisterClient_result result = new unregisterClient_result(); receiveBase(result, "unregisterClient"); if (result.invalidClientId != null) { throw result.invalidClientId; } return; } } 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 subscribe(long clientId, NamespaceEvent subscribedEvent, long txId, org.apache.thrift.async.AsyncMethodCallback<subscribe_call> resultHandler) throws org.apache.thrift.TException { checkReady(); subscribe_call method_call = new subscribe_call(clientId, subscribedEvent, txId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class subscribe_call extends org.apache.thrift.async.TAsyncMethodCall { private long clientId; private NamespaceEvent subscribedEvent; private long txId; public subscribe_call(long clientId, NamespaceEvent subscribedEvent, long txId, org.apache.thrift.async.AsyncMethodCallback<subscribe_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.clientId = clientId; this.subscribedEvent = subscribedEvent; this.txId = txId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("subscribe", org.apache.thrift.protocol.TMessageType.CALL, 0)); subscribe_args args = new subscribe_args(); args.setClientId(clientId); args.setSubscribedEvent(subscribedEvent); args.setTxId(txId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws InvalidClientIdException, TransactionIdTooOldException, 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); (new Client(prot)).recv_subscribe(); } } public void unsubscribe(long clientId, NamespaceEvent subscribedEvent, org.apache.thrift.async.AsyncMethodCallback<unsubscribe_call> resultHandler) throws org.apache.thrift.TException { checkReady(); unsubscribe_call method_call = new unsubscribe_call(clientId, subscribedEvent, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class unsubscribe_call extends org.apache.thrift.async.TAsyncMethodCall { private long clientId; private NamespaceEvent subscribedEvent; public unsubscribe_call(long clientId, NamespaceEvent subscribedEvent, org.apache.thrift.async.AsyncMethodCallback<unsubscribe_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.clientId = clientId; this.subscribedEvent = subscribedEvent; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unsubscribe", org.apache.thrift.protocol.TMessageType.CALL, 0)); unsubscribe_args args = new unsubscribe_args(); args.setClientId(clientId); args.setSubscribedEvent(subscribedEvent); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws InvalidClientIdException, ClientNotSubscribedException, 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); (new Client(prot)).recv_unsubscribe(); } } public void registerClient(String host, int port, long token, org.apache.thrift.async.AsyncMethodCallback<registerClient_call> resultHandler) throws org.apache.thrift.TException { checkReady(); registerClient_call method_call = new registerClient_call(host, port, token, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class registerClient_call extends org.apache.thrift.async.TAsyncMethodCall { private String host; private int port; private long token; public registerClient_call(String host, int port, long token, org.apache.thrift.async.AsyncMethodCallback<registerClient_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.host = host; this.port = port; this.token = token; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("registerClient", org.apache.thrift.protocol.TMessageType.CALL, 0)); registerClient_args args = new registerClient_args(); args.setHost(host); args.setPort(port); args.setToken(token); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws RampUpException, ClientConnectionException, 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); (new Client(prot)).recv_registerClient(); } } public void unregisterClient(long clientId, org.apache.thrift.async.AsyncMethodCallback<unregisterClient_call> resultHandler) throws org.apache.thrift.TException { checkReady(); unregisterClient_call method_call = new unregisterClient_call(clientId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } public static class unregisterClient_call extends org.apache.thrift.async.TAsyncMethodCall { private long clientId; public unregisterClient_call(long clientId, org.apache.thrift.async.AsyncMethodCallback<unregisterClient_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.clientId = clientId; } public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unregisterClient", org.apache.thrift.protocol.TMessageType.CALL, 0)); unregisterClient_args args = new unregisterClient_args(); args.setClientId(clientId); args.write(prot); prot.writeMessageEnd(); } public void getResult() throws InvalidClientIdException, 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); (new Client(prot)).recv_unregisterClient(); } } } public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> 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("subscribe", new subscribe()); processMap.put("unsubscribe", new unsubscribe()); processMap.put("registerClient", new registerClient()); processMap.put("unregisterClient", new unregisterClient()); return processMap; } public static class subscribe<I extends Iface> extends org.apache.thrift.ProcessFunction<I, subscribe_args> { public subscribe() { super("subscribe"); } public subscribe_args getEmptyArgsInstance() { return new subscribe_args(); } protected boolean isOneway() { return false; } public subscribe_result getResult(I iface, subscribe_args args) throws org.apache.thrift.TException { subscribe_result result = new subscribe_result(); try { iface.subscribe(args.clientId, args.subscribedEvent, args.txId); } catch (InvalidClientIdException invalidClientId) { result.invalidClientId = invalidClientId; } catch (TransactionIdTooOldException transactionIdTooOld) { result.transactionIdTooOld = transactionIdTooOld; } return result; } } public static class unsubscribe<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unsubscribe_args> { public unsubscribe() { super("unsubscribe"); } public unsubscribe_args getEmptyArgsInstance() { return new unsubscribe_args(); } protected boolean isOneway() { return false; } public unsubscribe_result getResult(I iface, unsubscribe_args args) throws org.apache.thrift.TException { unsubscribe_result result = new unsubscribe_result(); try { iface.unsubscribe(args.clientId, args.subscribedEvent); } catch (InvalidClientIdException invalidClientId) { result.invalidClientId = invalidClientId; } catch (ClientNotSubscribedException clientNotSubscribed) { result.clientNotSubscribed = clientNotSubscribed; } return result; } } public static class registerClient<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerClient_args> { public registerClient() { super("registerClient"); } public registerClient_args getEmptyArgsInstance() { return new registerClient_args(); } protected boolean isOneway() { return false; } public registerClient_result getResult(I iface, registerClient_args args) throws org.apache.thrift.TException { registerClient_result result = new registerClient_result(); try { iface.registerClient(args.host, args.port, args.token); } catch (RampUpException rampUp) { result.rampUp = rampUp; } catch (ClientConnectionException clientConnection) { result.clientConnection = clientConnection; } return result; } } public static class unregisterClient<I extends Iface> extends org.apache.thrift.ProcessFunction<I, unregisterClient_args> { public unregisterClient() { super("unregisterClient"); } public unregisterClient_args getEmptyArgsInstance() { return new unregisterClient_args(); } protected boolean isOneway() { return false; } public unregisterClient_result getResult(I iface, unregisterClient_args args) throws org.apache.thrift.TException { unregisterClient_result result = new unregisterClient_result(); try { iface.unregisterClient(args.clientId); } catch (InvalidClientIdException invalidClientId) { result.invalidClientId = invalidClientId; } return result; } } } public static class subscribe_args implements org.apache.thrift.TBase<subscribe_args, subscribe_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subscribe_args"); private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField SUBSCRIBED_EVENT_FIELD_DESC = new org.apache.thrift.protocol.TField("subscribedEvent", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField TX_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("txId", org.apache.thrift.protocol.TType.I64, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new subscribe_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new subscribe_argsTupleSchemeFactory()); } public long clientId; // required public NamespaceEvent subscribedEvent; // required public long txId; // 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 { CLIENT_ID((short)1, "clientId"), SUBSCRIBED_EVENT((short)2, "subscribedEvent"), TX_ID((short)3, "txId"); 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: // CLIENT_ID return CLIENT_ID; case 2: // SUBSCRIBED_EVENT return SUBSCRIBED_EVENT; case 3: // TX_ID return TX_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 assignments private static final int __CLIENTID_ISSET_ID = 0; private static final int __TXID_ISSET_ID = 1; private byte __isset_bitfield = 0; 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.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.SUBSCRIBED_EVENT, new org.apache.thrift.meta_data.FieldMetaData("subscribedEvent", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NamespaceEvent.class))); tmpMap.put(_Fields.TX_ID, new org.apache.thrift.meta_data.FieldMetaData("txId", 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(subscribe_args.class, metaDataMap); } public subscribe_args() { } public subscribe_args( long clientId, NamespaceEvent subscribedEvent, long txId) { this(); this.clientId = clientId; setClientIdIsSet(true); this.subscribedEvent = subscribedEvent; this.txId = txId; setTxIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public subscribe_args(subscribe_args other) { __isset_bitfield = other.__isset_bitfield; this.clientId = other.clientId; if (other.isSetSubscribedEvent()) { this.subscribedEvent = new NamespaceEvent(other.subscribedEvent); } this.txId = other.txId; } public subscribe_args deepCopy() { return new subscribe_args(this); } @Override public void clear() { setClientIdIsSet(false); this.clientId = 0; this.subscribedEvent = null; setTxIdIsSet(false); this.txId = 0; } public long getClientId() { return this.clientId; } public subscribe_args setClientId(long clientId) { this.clientId = clientId; setClientIdIsSet(true); return this; } public void unsetClientId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CLIENTID_ISSET_ID); } /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ public boolean isSetClientId() { return EncodingUtils.testBit(__isset_bitfield, __CLIENTID_ISSET_ID); } public void setClientIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CLIENTID_ISSET_ID, value); } public NamespaceEvent getSubscribedEvent() { return this.subscribedEvent; } public subscribe_args setSubscribedEvent(NamespaceEvent subscribedEvent) { this.subscribedEvent = subscribedEvent; return this; } public void unsetSubscribedEvent() { this.subscribedEvent = null; } /** Returns true if field subscribedEvent is set (has been assigned a value) and false otherwise */ public boolean isSetSubscribedEvent() { return this.subscribedEvent != null; } public void setSubscribedEventIsSet(boolean value) { if (!value) { this.subscribedEvent = null; } } public long getTxId() { return this.txId; } public subscribe_args setTxId(long txId) { this.txId = txId; setTxIdIsSet(true); return this; } public void unsetTxId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TXID_ISSET_ID); } /** Returns true if field txId is set (has been assigned a value) and false otherwise */ public boolean isSetTxId() { return EncodingUtils.testBit(__isset_bitfield, __TXID_ISSET_ID); } public void setTxIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TXID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case CLIENT_ID: if (value == null) { unsetClientId(); } else { setClientId((Long)value); } break; case SUBSCRIBED_EVENT: if (value == null) { unsetSubscribedEvent(); } else { setSubscribedEvent((NamespaceEvent)value); } break; case TX_ID: if (value == null) { unsetTxId(); } else { setTxId((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case CLIENT_ID: return Long.valueOf(getClientId()); case SUBSCRIBED_EVENT: return getSubscribedEvent(); case TX_ID: return Long.valueOf(getTxId()); } 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 CLIENT_ID: return isSetClientId(); case SUBSCRIBED_EVENT: return isSetSubscribedEvent(); case TX_ID: return isSetTxId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof subscribe_args) return this.equals((subscribe_args)that); return false; } public boolean equals(subscribe_args that) { if (that == null) return false; boolean this_present_clientId = true; boolean that_present_clientId = true; if (this_present_clientId || that_present_clientId) { if (!(this_present_clientId && that_present_clientId)) return false; if (this.clientId != that.clientId) return false; } boolean this_present_subscribedEvent = true && this.isSetSubscribedEvent(); boolean that_present_subscribedEvent = true && that.isSetSubscribedEvent(); if (this_present_subscribedEvent || that_present_subscribedEvent) { if (!(this_present_subscribedEvent && that_present_subscribedEvent)) return false; if (!this.subscribedEvent.equals(that.subscribedEvent)) return false; } boolean this_present_txId = true; boolean that_present_txId = true; if (this_present_txId || that_present_txId) { if (!(this_present_txId && that_present_txId)) return false; if (this.txId != that.txId) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(subscribe_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; subscribe_args typedOther = (subscribe_args)other; lastComparison = Boolean.valueOf(isSetClientId()).compareTo(typedOther.isSetClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, typedOther.clientId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSubscribedEvent()).compareTo(typedOther.isSetSubscribedEvent()); if (lastComparison != 0) { return lastComparison; } if (isSetSubscribedEvent()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subscribedEvent, typedOther.subscribedEvent); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTxId()).compareTo(typedOther.isSetTxId()); if (lastComparison != 0) { return lastComparison; } if (isSetTxId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.txId, typedOther.txId); 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("subscribe_args("); boolean first = true; sb.append("clientId:"); sb.append(this.clientId); first = false; if (!first) sb.append(", "); sb.append("subscribedEvent:"); if (this.subscribedEvent == null) { sb.append("null"); } else { sb.append(this.subscribedEvent); } first = false; if (!first) sb.append(", "); sb.append("txId:"); sb.append(this.txId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (subscribedEvent != null) { subscribedEvent.validate(); } } 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_bitfield = 0; 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 subscribe_argsStandardSchemeFactory implements SchemeFactory { public subscribe_argsStandardScheme getScheme() { return new subscribe_argsStandardScheme(); } } private static class subscribe_argsStandardScheme extends StandardScheme<subscribe_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, subscribe_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: // CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // SUBSCRIBED_EVENT if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.subscribedEvent = new NamespaceEvent(); struct.subscribedEvent.read(iprot); struct.setSubscribedEventIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // TX_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.txId = iprot.readI64(); struct.setTxIdIsSet(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, subscribe_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); oprot.writeI64(struct.clientId); oprot.writeFieldEnd(); if (struct.subscribedEvent != null) { oprot.writeFieldBegin(SUBSCRIBED_EVENT_FIELD_DESC); struct.subscribedEvent.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldBegin(TX_ID_FIELD_DESC); oprot.writeI64(struct.txId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class subscribe_argsTupleSchemeFactory implements SchemeFactory { public subscribe_argsTupleScheme getScheme() { return new subscribe_argsTupleScheme(); } } private static class subscribe_argsTupleScheme extends TupleScheme<subscribe_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, subscribe_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetClientId()) { optionals.set(0); } if (struct.isSetSubscribedEvent()) { optionals.set(1); } if (struct.isSetTxId()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetClientId()) { oprot.writeI64(struct.clientId); } if (struct.isSetSubscribedEvent()) { struct.subscribedEvent.write(oprot); } if (struct.isSetTxId()) { oprot.writeI64(struct.txId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, subscribe_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(true); } if (incoming.get(1)) { struct.subscribedEvent = new NamespaceEvent(); struct.subscribedEvent.read(iprot); struct.setSubscribedEventIsSet(true); } if (incoming.get(2)) { struct.txId = iprot.readI64(); struct.setTxIdIsSet(true); } } } } public static class subscribe_result implements org.apache.thrift.TBase<subscribe_result, subscribe_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("subscribe_result"); private static final org.apache.thrift.protocol.TField INVALID_CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidClientId", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField TRANSACTION_ID_TOO_OLD_FIELD_DESC = new org.apache.thrift.protocol.TField("transactionIdTooOld", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new subscribe_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new subscribe_resultTupleSchemeFactory()); } public InvalidClientIdException invalidClientId; // required public TransactionIdTooOldException transactionIdTooOld; // 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 { INVALID_CLIENT_ID((short)1, "invalidClientId"), TRANSACTION_ID_TOO_OLD((short)2, "transactionIdTooOld"); 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: // INVALID_CLIENT_ID return INVALID_CLIENT_ID; case 2: // TRANSACTION_ID_TOO_OLD return TRANSACTION_ID_TOO_OLD; 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.INVALID_CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("invalidClientId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.TRANSACTION_ID_TOO_OLD, new org.apache.thrift.meta_data.FieldMetaData("transactionIdTooOld", 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(subscribe_result.class, metaDataMap); } public subscribe_result() { } public subscribe_result( InvalidClientIdException invalidClientId, TransactionIdTooOldException transactionIdTooOld) { this(); this.invalidClientId = invalidClientId; this.transactionIdTooOld = transactionIdTooOld; } /** * Performs a deep copy on <i>other</i>. */ public subscribe_result(subscribe_result other) { if (other.isSetInvalidClientId()) { this.invalidClientId = new InvalidClientIdException(other.invalidClientId); } if (other.isSetTransactionIdTooOld()) { this.transactionIdTooOld = new TransactionIdTooOldException(other.transactionIdTooOld); } } public subscribe_result deepCopy() { return new subscribe_result(this); } @Override public void clear() { this.invalidClientId = null; this.transactionIdTooOld = null; } public InvalidClientIdException getInvalidClientId() { return this.invalidClientId; } public subscribe_result setInvalidClientId(InvalidClientIdException invalidClientId) { this.invalidClientId = invalidClientId; return this; } public void unsetInvalidClientId() { this.invalidClientId = null; } /** Returns true if field invalidClientId is set (has been assigned a value) and false otherwise */ public boolean isSetInvalidClientId() { return this.invalidClientId != null; } public void setInvalidClientIdIsSet(boolean value) { if (!value) { this.invalidClientId = null; } } public TransactionIdTooOldException getTransactionIdTooOld() { return this.transactionIdTooOld; } public subscribe_result setTransactionIdTooOld(TransactionIdTooOldException transactionIdTooOld) { this.transactionIdTooOld = transactionIdTooOld; return this; } public void unsetTransactionIdTooOld() { this.transactionIdTooOld = null; } /** Returns true if field transactionIdTooOld is set (has been assigned a value) and false otherwise */ public boolean isSetTransactionIdTooOld() { return this.transactionIdTooOld != null; } public void setTransactionIdTooOldIsSet(boolean value) { if (!value) { this.transactionIdTooOld = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case INVALID_CLIENT_ID: if (value == null) { unsetInvalidClientId(); } else { setInvalidClientId((InvalidClientIdException)value); } break; case TRANSACTION_ID_TOO_OLD: if (value == null) { unsetTransactionIdTooOld(); } else { setTransactionIdTooOld((TransactionIdTooOldException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case INVALID_CLIENT_ID: return getInvalidClientId(); case TRANSACTION_ID_TOO_OLD: return getTransactionIdTooOld(); } 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 INVALID_CLIENT_ID: return isSetInvalidClientId(); case TRANSACTION_ID_TOO_OLD: return isSetTransactionIdTooOld(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof subscribe_result) return this.equals((subscribe_result)that); return false; } public boolean equals(subscribe_result that) { if (that == null) return false; boolean this_present_invalidClientId = true && this.isSetInvalidClientId(); boolean that_present_invalidClientId = true && that.isSetInvalidClientId(); if (this_present_invalidClientId || that_present_invalidClientId) { if (!(this_present_invalidClientId && that_present_invalidClientId)) return false; if (!this.invalidClientId.equals(that.invalidClientId)) return false; } boolean this_present_transactionIdTooOld = true && this.isSetTransactionIdTooOld(); boolean that_present_transactionIdTooOld = true && that.isSetTransactionIdTooOld(); if (this_present_transactionIdTooOld || that_present_transactionIdTooOld) { if (!(this_present_transactionIdTooOld && that_present_transactionIdTooOld)) return false; if (!this.transactionIdTooOld.equals(that.transactionIdTooOld)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(subscribe_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; subscribe_result typedOther = (subscribe_result)other; lastComparison = Boolean.valueOf(isSetInvalidClientId()).compareTo(typedOther.isSetInvalidClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetInvalidClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidClientId, typedOther.invalidClientId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetTransactionIdTooOld()).compareTo(typedOther.isSetTransactionIdTooOld()); if (lastComparison != 0) { return lastComparison; } if (isSetTransactionIdTooOld()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactionIdTooOld, typedOther.transactionIdTooOld); 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("subscribe_result("); boolean first = true; sb.append("invalidClientId:"); if (this.invalidClientId == null) { sb.append("null"); } else { sb.append(this.invalidClientId); } first = false; if (!first) sb.append(", "); sb.append("transactionIdTooOld:"); if (this.transactionIdTooOld == null) { sb.append("null"); } else { sb.append(this.transactionIdTooOld); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class subscribe_resultStandardSchemeFactory implements SchemeFactory { public subscribe_resultStandardScheme getScheme() { return new subscribe_resultStandardScheme(); } } private static class subscribe_resultStandardScheme extends StandardScheme<subscribe_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, subscribe_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 1: // INVALID_CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // TRANSACTION_ID_TOO_OLD if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.transactionIdTooOld = new TransactionIdTooOldException(); struct.transactionIdTooOld.read(iprot); struct.setTransactionIdTooOldIsSet(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, subscribe_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.invalidClientId != null) { oprot.writeFieldBegin(INVALID_CLIENT_ID_FIELD_DESC); struct.invalidClientId.write(oprot); oprot.writeFieldEnd(); } if (struct.transactionIdTooOld != null) { oprot.writeFieldBegin(TRANSACTION_ID_TOO_OLD_FIELD_DESC); struct.transactionIdTooOld.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class subscribe_resultTupleSchemeFactory implements SchemeFactory { public subscribe_resultTupleScheme getScheme() { return new subscribe_resultTupleScheme(); } } private static class subscribe_resultTupleScheme extends TupleScheme<subscribe_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, subscribe_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetInvalidClientId()) { optionals.set(0); } if (struct.isSetTransactionIdTooOld()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetInvalidClientId()) { struct.invalidClientId.write(oprot); } if (struct.isSetTransactionIdTooOld()) { struct.transactionIdTooOld.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, subscribe_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(true); } if (incoming.get(1)) { struct.transactionIdTooOld = new TransactionIdTooOldException(); struct.transactionIdTooOld.read(iprot); struct.setTransactionIdTooOldIsSet(true); } } } } public static class unsubscribe_args implements org.apache.thrift.TBase<unsubscribe_args, unsubscribe_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unsubscribe_args"); private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.I64, (short)1); private static final org.apache.thrift.protocol.TField SUBSCRIBED_EVENT_FIELD_DESC = new org.apache.thrift.protocol.TField("subscribedEvent", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unsubscribe_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new unsubscribe_argsTupleSchemeFactory()); } public long clientId; // required public NamespaceEvent subscribedEvent; // 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 { CLIENT_ID((short)1, "clientId"), SUBSCRIBED_EVENT((short)2, "subscribedEvent"); 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: // CLIENT_ID return CLIENT_ID; case 2: // SUBSCRIBED_EVENT return SUBSCRIBED_EVENT; 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 private static final int __CLIENTID_ISSET_ID = 0; private byte __isset_bitfield = 0; 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.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); tmpMap.put(_Fields.SUBSCRIBED_EVENT, new org.apache.thrift.meta_data.FieldMetaData("subscribedEvent", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NamespaceEvent.class))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(unsubscribe_args.class, metaDataMap); } public unsubscribe_args() { } public unsubscribe_args( long clientId, NamespaceEvent subscribedEvent) { this(); this.clientId = clientId; setClientIdIsSet(true); this.subscribedEvent = subscribedEvent; } /** * Performs a deep copy on <i>other</i>. */ public unsubscribe_args(unsubscribe_args other) { __isset_bitfield = other.__isset_bitfield; this.clientId = other.clientId; if (other.isSetSubscribedEvent()) { this.subscribedEvent = new NamespaceEvent(other.subscribedEvent); } } public unsubscribe_args deepCopy() { return new unsubscribe_args(this); } @Override public void clear() { setClientIdIsSet(false); this.clientId = 0; this.subscribedEvent = null; } public long getClientId() { return this.clientId; } public unsubscribe_args setClientId(long clientId) { this.clientId = clientId; setClientIdIsSet(true); return this; } public void unsetClientId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CLIENTID_ISSET_ID); } /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ public boolean isSetClientId() { return EncodingUtils.testBit(__isset_bitfield, __CLIENTID_ISSET_ID); } public void setClientIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CLIENTID_ISSET_ID, value); } public NamespaceEvent getSubscribedEvent() { return this.subscribedEvent; } public unsubscribe_args setSubscribedEvent(NamespaceEvent subscribedEvent) { this.subscribedEvent = subscribedEvent; return this; } public void unsetSubscribedEvent() { this.subscribedEvent = null; } /** Returns true if field subscribedEvent is set (has been assigned a value) and false otherwise */ public boolean isSetSubscribedEvent() { return this.subscribedEvent != null; } public void setSubscribedEventIsSet(boolean value) { if (!value) { this.subscribedEvent = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case CLIENT_ID: if (value == null) { unsetClientId(); } else { setClientId((Long)value); } break; case SUBSCRIBED_EVENT: if (value == null) { unsetSubscribedEvent(); } else { setSubscribedEvent((NamespaceEvent)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case CLIENT_ID: return Long.valueOf(getClientId()); case SUBSCRIBED_EVENT: return getSubscribedEvent(); } 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 CLIENT_ID: return isSetClientId(); case SUBSCRIBED_EVENT: return isSetSubscribedEvent(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unsubscribe_args) return this.equals((unsubscribe_args)that); return false; } public boolean equals(unsubscribe_args that) { if (that == null) return false; boolean this_present_clientId = true; boolean that_present_clientId = true; if (this_present_clientId || that_present_clientId) { if (!(this_present_clientId && that_present_clientId)) return false; if (this.clientId != that.clientId) return false; } boolean this_present_subscribedEvent = true && this.isSetSubscribedEvent(); boolean that_present_subscribedEvent = true && that.isSetSubscribedEvent(); if (this_present_subscribedEvent || that_present_subscribedEvent) { if (!(this_present_subscribedEvent && that_present_subscribedEvent)) return false; if (!this.subscribedEvent.equals(that.subscribedEvent)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(unsubscribe_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; unsubscribe_args typedOther = (unsubscribe_args)other; lastComparison = Boolean.valueOf(isSetClientId()).compareTo(typedOther.isSetClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, typedOther.clientId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetSubscribedEvent()).compareTo(typedOther.isSetSubscribedEvent()); if (lastComparison != 0) { return lastComparison; } if (isSetSubscribedEvent()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.subscribedEvent, typedOther.subscribedEvent); 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("unsubscribe_args("); boolean first = true; sb.append("clientId:"); sb.append(this.clientId); first = false; if (!first) sb.append(", "); sb.append("subscribedEvent:"); if (this.subscribedEvent == null) { sb.append("null"); } else { sb.append(this.subscribedEvent); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity if (subscribedEvent != null) { subscribedEvent.validate(); } } 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_bitfield = 0; 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 unsubscribe_argsStandardSchemeFactory implements SchemeFactory { public unsubscribe_argsStandardScheme getScheme() { return new unsubscribe_argsStandardScheme(); } } private static class unsubscribe_argsStandardScheme extends StandardScheme<unsubscribe_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, unsubscribe_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: // CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // SUBSCRIBED_EVENT if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.subscribedEvent = new NamespaceEvent(); struct.subscribedEvent.read(iprot); struct.setSubscribedEventIsSet(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, unsubscribe_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); oprot.writeI64(struct.clientId); oprot.writeFieldEnd(); if (struct.subscribedEvent != null) { oprot.writeFieldBegin(SUBSCRIBED_EVENT_FIELD_DESC); struct.subscribedEvent.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unsubscribe_argsTupleSchemeFactory implements SchemeFactory { public unsubscribe_argsTupleScheme getScheme() { return new unsubscribe_argsTupleScheme(); } } private static class unsubscribe_argsTupleScheme extends TupleScheme<unsubscribe_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unsubscribe_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetClientId()) { optionals.set(0); } if (struct.isSetSubscribedEvent()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetClientId()) { oprot.writeI64(struct.clientId); } if (struct.isSetSubscribedEvent()) { struct.subscribedEvent.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unsubscribe_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(true); } if (incoming.get(1)) { struct.subscribedEvent = new NamespaceEvent(); struct.subscribedEvent.read(iprot); struct.setSubscribedEventIsSet(true); } } } } public static class unsubscribe_result implements org.apache.thrift.TBase<unsubscribe_result, unsubscribe_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unsubscribe_result"); private static final org.apache.thrift.protocol.TField INVALID_CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidClientId", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField CLIENT_NOT_SUBSCRIBED_FIELD_DESC = new org.apache.thrift.protocol.TField("clientNotSubscribed", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unsubscribe_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new unsubscribe_resultTupleSchemeFactory()); } public InvalidClientIdException invalidClientId; // required public ClientNotSubscribedException clientNotSubscribed; // 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 { INVALID_CLIENT_ID((short)1, "invalidClientId"), CLIENT_NOT_SUBSCRIBED((short)2, "clientNotSubscribed"); 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: // INVALID_CLIENT_ID return INVALID_CLIENT_ID; case 2: // CLIENT_NOT_SUBSCRIBED return CLIENT_NOT_SUBSCRIBED; 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.INVALID_CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("invalidClientId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.CLIENT_NOT_SUBSCRIBED, new org.apache.thrift.meta_data.FieldMetaData("clientNotSubscribed", 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(unsubscribe_result.class, metaDataMap); } public unsubscribe_result() { } public unsubscribe_result( InvalidClientIdException invalidClientId, ClientNotSubscribedException clientNotSubscribed) { this(); this.invalidClientId = invalidClientId; this.clientNotSubscribed = clientNotSubscribed; } /** * Performs a deep copy on <i>other</i>. */ public unsubscribe_result(unsubscribe_result other) { if (other.isSetInvalidClientId()) { this.invalidClientId = new InvalidClientIdException(other.invalidClientId); } if (other.isSetClientNotSubscribed()) { this.clientNotSubscribed = new ClientNotSubscribedException(other.clientNotSubscribed); } } public unsubscribe_result deepCopy() { return new unsubscribe_result(this); } @Override public void clear() { this.invalidClientId = null; this.clientNotSubscribed = null; } public InvalidClientIdException getInvalidClientId() { return this.invalidClientId; } public unsubscribe_result setInvalidClientId(InvalidClientIdException invalidClientId) { this.invalidClientId = invalidClientId; return this; } public void unsetInvalidClientId() { this.invalidClientId = null; } /** Returns true if field invalidClientId is set (has been assigned a value) and false otherwise */ public boolean isSetInvalidClientId() { return this.invalidClientId != null; } public void setInvalidClientIdIsSet(boolean value) { if (!value) { this.invalidClientId = null; } } public ClientNotSubscribedException getClientNotSubscribed() { return this.clientNotSubscribed; } public unsubscribe_result setClientNotSubscribed(ClientNotSubscribedException clientNotSubscribed) { this.clientNotSubscribed = clientNotSubscribed; return this; } public void unsetClientNotSubscribed() { this.clientNotSubscribed = null; } /** Returns true if field clientNotSubscribed is set (has been assigned a value) and false otherwise */ public boolean isSetClientNotSubscribed() { return this.clientNotSubscribed != null; } public void setClientNotSubscribedIsSet(boolean value) { if (!value) { this.clientNotSubscribed = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case INVALID_CLIENT_ID: if (value == null) { unsetInvalidClientId(); } else { setInvalidClientId((InvalidClientIdException)value); } break; case CLIENT_NOT_SUBSCRIBED: if (value == null) { unsetClientNotSubscribed(); } else { setClientNotSubscribed((ClientNotSubscribedException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case INVALID_CLIENT_ID: return getInvalidClientId(); case CLIENT_NOT_SUBSCRIBED: return getClientNotSubscribed(); } 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 INVALID_CLIENT_ID: return isSetInvalidClientId(); case CLIENT_NOT_SUBSCRIBED: return isSetClientNotSubscribed(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unsubscribe_result) return this.equals((unsubscribe_result)that); return false; } public boolean equals(unsubscribe_result that) { if (that == null) return false; boolean this_present_invalidClientId = true && this.isSetInvalidClientId(); boolean that_present_invalidClientId = true && that.isSetInvalidClientId(); if (this_present_invalidClientId || that_present_invalidClientId) { if (!(this_present_invalidClientId && that_present_invalidClientId)) return false; if (!this.invalidClientId.equals(that.invalidClientId)) return false; } boolean this_present_clientNotSubscribed = true && this.isSetClientNotSubscribed(); boolean that_present_clientNotSubscribed = true && that.isSetClientNotSubscribed(); if (this_present_clientNotSubscribed || that_present_clientNotSubscribed) { if (!(this_present_clientNotSubscribed && that_present_clientNotSubscribed)) return false; if (!this.clientNotSubscribed.equals(that.clientNotSubscribed)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(unsubscribe_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; unsubscribe_result typedOther = (unsubscribe_result)other; lastComparison = Boolean.valueOf(isSetInvalidClientId()).compareTo(typedOther.isSetInvalidClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetInvalidClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidClientId, typedOther.invalidClientId); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetClientNotSubscribed()).compareTo(typedOther.isSetClientNotSubscribed()); if (lastComparison != 0) { return lastComparison; } if (isSetClientNotSubscribed()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientNotSubscribed, typedOther.clientNotSubscribed); 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("unsubscribe_result("); boolean first = true; sb.append("invalidClientId:"); if (this.invalidClientId == null) { sb.append("null"); } else { sb.append(this.invalidClientId); } first = false; if (!first) sb.append(", "); sb.append("clientNotSubscribed:"); if (this.clientNotSubscribed == null) { sb.append("null"); } else { sb.append(this.clientNotSubscribed); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class unsubscribe_resultStandardSchemeFactory implements SchemeFactory { public unsubscribe_resultStandardScheme getScheme() { return new unsubscribe_resultStandardScheme(); } } private static class unsubscribe_resultStandardScheme extends StandardScheme<unsubscribe_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, unsubscribe_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 1: // INVALID_CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CLIENT_NOT_SUBSCRIBED if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.clientNotSubscribed = new ClientNotSubscribedException(); struct.clientNotSubscribed.read(iprot); struct.setClientNotSubscribedIsSet(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, unsubscribe_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.invalidClientId != null) { oprot.writeFieldBegin(INVALID_CLIENT_ID_FIELD_DESC); struct.invalidClientId.write(oprot); oprot.writeFieldEnd(); } if (struct.clientNotSubscribed != null) { oprot.writeFieldBegin(CLIENT_NOT_SUBSCRIBED_FIELD_DESC); struct.clientNotSubscribed.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unsubscribe_resultTupleSchemeFactory implements SchemeFactory { public unsubscribe_resultTupleScheme getScheme() { return new unsubscribe_resultTupleScheme(); } } private static class unsubscribe_resultTupleScheme extends TupleScheme<unsubscribe_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unsubscribe_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetInvalidClientId()) { optionals.set(0); } if (struct.isSetClientNotSubscribed()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetInvalidClientId()) { struct.invalidClientId.write(oprot); } if (struct.isSetClientNotSubscribed()) { struct.clientNotSubscribed.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unsubscribe_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(true); } if (incoming.get(1)) { struct.clientNotSubscribed = new ClientNotSubscribedException(); struct.clientNotSubscribed.read(iprot); struct.setClientNotSubscribedIsSet(true); } } } } public static class registerClient_args implements org.apache.thrift.TBase<registerClient_args, registerClient_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerClient_args"); private static final org.apache.thrift.protocol.TField HOST_FIELD_DESC = new org.apache.thrift.protocol.TField("host", org.apache.thrift.protocol.TType.STRING, (short)1); private static final org.apache.thrift.protocol.TField PORT_FIELD_DESC = new org.apache.thrift.protocol.TField("port", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("token", org.apache.thrift.protocol.TType.I64, (short)3); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new registerClient_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new registerClient_argsTupleSchemeFactory()); } public String host; // required public int port; // required public long token; // 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 { HOST((short)1, "host"), PORT((short)2, "port"), TOKEN((short)3, "token"); 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: // HOST return HOST; case 2: // PORT return PORT; case 3: // TOKEN return TOKEN; 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 private static final int __PORT_ISSET_ID = 0; private static final int __TOKEN_ISSET_ID = 1; private byte __isset_bitfield = 0; 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.HOST, new org.apache.thrift.meta_data.FieldMetaData("host", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); tmpMap.put(_Fields.PORT, new org.apache.thrift.meta_data.FieldMetaData("port", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); tmpMap.put(_Fields.TOKEN, new org.apache.thrift.meta_data.FieldMetaData("token", 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(registerClient_args.class, metaDataMap); } public registerClient_args() { } public registerClient_args( String host, int port, long token) { this(); this.host = host; this.port = port; setPortIsSet(true); this.token = token; setTokenIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public registerClient_args(registerClient_args other) { __isset_bitfield = other.__isset_bitfield; if (other.isSetHost()) { this.host = other.host; } this.port = other.port; this.token = other.token; } public registerClient_args deepCopy() { return new registerClient_args(this); } @Override public void clear() { this.host = null; setPortIsSet(false); this.port = 0; setTokenIsSet(false); this.token = 0; } public String getHost() { return this.host; } public registerClient_args setHost(String host) { this.host = host; return this; } public void unsetHost() { this.host = null; } /** Returns true if field host is set (has been assigned a value) and false otherwise */ public boolean isSetHost() { return this.host != null; } public void setHostIsSet(boolean value) { if (!value) { this.host = null; } } public int getPort() { return this.port; } public registerClient_args setPort(int port) { this.port = port; setPortIsSet(true); return this; } public void unsetPort() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __PORT_ISSET_ID); } /** Returns true if field port is set (has been assigned a value) and false otherwise */ public boolean isSetPort() { return EncodingUtils.testBit(__isset_bitfield, __PORT_ISSET_ID); } public void setPortIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __PORT_ISSET_ID, value); } public long getToken() { return this.token; } public registerClient_args setToken(long token) { this.token = token; setTokenIsSet(true); return this; } public void unsetToken() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOKEN_ISSET_ID); } /** Returns true if field token is set (has been assigned a value) and false otherwise */ public boolean isSetToken() { return EncodingUtils.testBit(__isset_bitfield, __TOKEN_ISSET_ID); } public void setTokenIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOKEN_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case HOST: if (value == null) { unsetHost(); } else { setHost((String)value); } break; case PORT: if (value == null) { unsetPort(); } else { setPort((Integer)value); } break; case TOKEN: if (value == null) { unsetToken(); } else { setToken((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case HOST: return getHost(); case PORT: return Integer.valueOf(getPort()); case TOKEN: return Long.valueOf(getToken()); } 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 HOST: return isSetHost(); case PORT: return isSetPort(); case TOKEN: return isSetToken(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof registerClient_args) return this.equals((registerClient_args)that); return false; } public boolean equals(registerClient_args that) { if (that == null) return false; boolean this_present_host = true && this.isSetHost(); boolean that_present_host = true && that.isSetHost(); if (this_present_host || that_present_host) { if (!(this_present_host && that_present_host)) return false; if (!this.host.equals(that.host)) return false; } boolean this_present_port = true; boolean that_present_port = true; if (this_present_port || that_present_port) { if (!(this_present_port && that_present_port)) return false; if (this.port != that.port) return false; } boolean this_present_token = true; boolean that_present_token = true; if (this_present_token || that_present_token) { if (!(this_present_token && that_present_token)) return false; if (this.token != that.token) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(registerClient_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; registerClient_args typedOther = (registerClient_args)other; lastComparison = Boolean.valueOf(isSetHost()).compareTo(typedOther.isSetHost()); if (lastComparison != 0) { return lastComparison; } if (isSetHost()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.host, typedOther.host); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetPort()).compareTo(typedOther.isSetPort()); if (lastComparison != 0) { return lastComparison; } if (isSetPort()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.port, typedOther.port); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetToken()).compareTo(typedOther.isSetToken()); if (lastComparison != 0) { return lastComparison; } if (isSetToken()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.token, typedOther.token); 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("registerClient_args("); boolean first = true; sb.append("host:"); if (this.host == null) { sb.append("null"); } else { sb.append(this.host); } first = false; if (!first) sb.append(", "); sb.append("port:"); sb.append(this.port); first = false; if (!first) sb.append(", "); sb.append("token:"); sb.append(this.token); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; 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 registerClient_argsStandardSchemeFactory implements SchemeFactory { public registerClient_argsStandardScheme getScheme() { return new registerClient_argsStandardScheme(); } } private static class registerClient_argsStandardScheme extends StandardScheme<registerClient_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, registerClient_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: // HOST if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { struct.host = iprot.readString(); struct.setHostIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // PORT if (schemeField.type == org.apache.thrift.protocol.TType.I32) { struct.port = iprot.readI32(); struct.setPortIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 3: // TOKEN if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.token = iprot.readI64(); struct.setTokenIsSet(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, registerClient_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.host != null) { oprot.writeFieldBegin(HOST_FIELD_DESC); oprot.writeString(struct.host); oprot.writeFieldEnd(); } oprot.writeFieldBegin(PORT_FIELD_DESC); oprot.writeI32(struct.port); oprot.writeFieldEnd(); oprot.writeFieldBegin(TOKEN_FIELD_DESC); oprot.writeI64(struct.token); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class registerClient_argsTupleSchemeFactory implements SchemeFactory { public registerClient_argsTupleScheme getScheme() { return new registerClient_argsTupleScheme(); } } private static class registerClient_argsTupleScheme extends TupleScheme<registerClient_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, registerClient_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetHost()) { optionals.set(0); } if (struct.isSetPort()) { optionals.set(1); } if (struct.isSetToken()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetHost()) { oprot.writeString(struct.host); } if (struct.isSetPort()) { oprot.writeI32(struct.port); } if (struct.isSetToken()) { oprot.writeI64(struct.token); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, registerClient_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.host = iprot.readString(); struct.setHostIsSet(true); } if (incoming.get(1)) { struct.port = iprot.readI32(); struct.setPortIsSet(true); } if (incoming.get(2)) { struct.token = iprot.readI64(); struct.setTokenIsSet(true); } } } } public static class registerClient_result implements org.apache.thrift.TBase<registerClient_result, registerClient_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerClient_result"); private static final org.apache.thrift.protocol.TField RAMP_UP_FIELD_DESC = new org.apache.thrift.protocol.TField("rampUp", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField CLIENT_CONNECTION_FIELD_DESC = new org.apache.thrift.protocol.TField("clientConnection", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new registerClient_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new registerClient_resultTupleSchemeFactory()); } public RampUpException rampUp; // required public ClientConnectionException clientConnection; // 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 { RAMP_UP((short)1, "rampUp"), CLIENT_CONNECTION((short)2, "clientConnection"); 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: // RAMP_UP return RAMP_UP; case 2: // CLIENT_CONNECTION return CLIENT_CONNECTION; 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.RAMP_UP, new org.apache.thrift.meta_data.FieldMetaData("rampUp", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); tmpMap.put(_Fields.CLIENT_CONNECTION, new org.apache.thrift.meta_data.FieldMetaData("clientConnection", 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(registerClient_result.class, metaDataMap); } public registerClient_result() { } public registerClient_result( RampUpException rampUp, ClientConnectionException clientConnection) { this(); this.rampUp = rampUp; this.clientConnection = clientConnection; } /** * Performs a deep copy on <i>other</i>. */ public registerClient_result(registerClient_result other) { if (other.isSetRampUp()) { this.rampUp = new RampUpException(other.rampUp); } if (other.isSetClientConnection()) { this.clientConnection = new ClientConnectionException(other.clientConnection); } } public registerClient_result deepCopy() { return new registerClient_result(this); } @Override public void clear() { this.rampUp = null; this.clientConnection = null; } public RampUpException getRampUp() { return this.rampUp; } public registerClient_result setRampUp(RampUpException rampUp) { this.rampUp = rampUp; return this; } public void unsetRampUp() { this.rampUp = null; } /** Returns true if field rampUp is set (has been assigned a value) and false otherwise */ public boolean isSetRampUp() { return this.rampUp != null; } public void setRampUpIsSet(boolean value) { if (!value) { this.rampUp = null; } } public ClientConnectionException getClientConnection() { return this.clientConnection; } public registerClient_result setClientConnection(ClientConnectionException clientConnection) { this.clientConnection = clientConnection; return this; } public void unsetClientConnection() { this.clientConnection = null; } /** Returns true if field clientConnection is set (has been assigned a value) and false otherwise */ public boolean isSetClientConnection() { return this.clientConnection != null; } public void setClientConnectionIsSet(boolean value) { if (!value) { this.clientConnection = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case RAMP_UP: if (value == null) { unsetRampUp(); } else { setRampUp((RampUpException)value); } break; case CLIENT_CONNECTION: if (value == null) { unsetClientConnection(); } else { setClientConnection((ClientConnectionException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case RAMP_UP: return getRampUp(); case CLIENT_CONNECTION: return getClientConnection(); } 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 RAMP_UP: return isSetRampUp(); case CLIENT_CONNECTION: return isSetClientConnection(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof registerClient_result) return this.equals((registerClient_result)that); return false; } public boolean equals(registerClient_result that) { if (that == null) return false; boolean this_present_rampUp = true && this.isSetRampUp(); boolean that_present_rampUp = true && that.isSetRampUp(); if (this_present_rampUp || that_present_rampUp) { if (!(this_present_rampUp && that_present_rampUp)) return false; if (!this.rampUp.equals(that.rampUp)) return false; } boolean this_present_clientConnection = true && this.isSetClientConnection(); boolean that_present_clientConnection = true && that.isSetClientConnection(); if (this_present_clientConnection || that_present_clientConnection) { if (!(this_present_clientConnection && that_present_clientConnection)) return false; if (!this.clientConnection.equals(that.clientConnection)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(registerClient_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; registerClient_result typedOther = (registerClient_result)other; lastComparison = Boolean.valueOf(isSetRampUp()).compareTo(typedOther.isSetRampUp()); if (lastComparison != 0) { return lastComparison; } if (isSetRampUp()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rampUp, typedOther.rampUp); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetClientConnection()).compareTo(typedOther.isSetClientConnection()); if (lastComparison != 0) { return lastComparison; } if (isSetClientConnection()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientConnection, typedOther.clientConnection); 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("registerClient_result("); boolean first = true; sb.append("rampUp:"); if (this.rampUp == null) { sb.append("null"); } else { sb.append(this.rampUp); } first = false; if (!first) sb.append(", "); sb.append("clientConnection:"); if (this.clientConnection == null) { sb.append("null"); } else { sb.append(this.clientConnection); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class registerClient_resultStandardSchemeFactory implements SchemeFactory { public registerClient_resultStandardScheme getScheme() { return new registerClient_resultStandardScheme(); } } private static class registerClient_resultStandardScheme extends StandardScheme<registerClient_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, registerClient_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 1: // RAMP_UP if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.rampUp = new RampUpException(); struct.rampUp.read(iprot); struct.setRampUpIsSet(true); } else { org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; case 2: // CLIENT_CONNECTION if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.clientConnection = new ClientConnectionException(); struct.clientConnection.read(iprot); struct.setClientConnectionIsSet(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, registerClient_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.rampUp != null) { oprot.writeFieldBegin(RAMP_UP_FIELD_DESC); struct.rampUp.write(oprot); oprot.writeFieldEnd(); } if (struct.clientConnection != null) { oprot.writeFieldBegin(CLIENT_CONNECTION_FIELD_DESC); struct.clientConnection.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class registerClient_resultTupleSchemeFactory implements SchemeFactory { public registerClient_resultTupleScheme getScheme() { return new registerClient_resultTupleScheme(); } } private static class registerClient_resultTupleScheme extends TupleScheme<registerClient_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, registerClient_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRampUp()) { optionals.set(0); } if (struct.isSetClientConnection()) { optionals.set(1); } oprot.writeBitSet(optionals, 2); if (struct.isSetRampUp()) { struct.rampUp.write(oprot); } if (struct.isSetClientConnection()) { struct.clientConnection.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, registerClient_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.rampUp = new RampUpException(); struct.rampUp.read(iprot); struct.setRampUpIsSet(true); } if (incoming.get(1)) { struct.clientConnection = new ClientConnectionException(); struct.clientConnection.read(iprot); struct.setClientConnectionIsSet(true); } } } } public static class unregisterClient_args implements org.apache.thrift.TBase<unregisterClient_args, unregisterClient_args._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unregisterClient_args"); private static final org.apache.thrift.protocol.TField CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("clientId", org.apache.thrift.protocol.TType.I64, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unregisterClient_argsStandardSchemeFactory()); schemes.put(TupleScheme.class, new unregisterClient_argsTupleSchemeFactory()); } public long clientId; // 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 { CLIENT_ID((short)1, "clientId"); 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: // CLIENT_ID return CLIENT_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 assignments private static final int __CLIENTID_ISSET_ID = 0; private byte __isset_bitfield = 0; 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.CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("clientId", 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(unregisterClient_args.class, metaDataMap); } public unregisterClient_args() { } public unregisterClient_args( long clientId) { this(); this.clientId = clientId; setClientIdIsSet(true); } /** * Performs a deep copy on <i>other</i>. */ public unregisterClient_args(unregisterClient_args other) { __isset_bitfield = other.__isset_bitfield; this.clientId = other.clientId; } public unregisterClient_args deepCopy() { return new unregisterClient_args(this); } @Override public void clear() { setClientIdIsSet(false); this.clientId = 0; } public long getClientId() { return this.clientId; } public unregisterClient_args setClientId(long clientId) { this.clientId = clientId; setClientIdIsSet(true); return this; } public void unsetClientId() { __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CLIENTID_ISSET_ID); } /** Returns true if field clientId is set (has been assigned a value) and false otherwise */ public boolean isSetClientId() { return EncodingUtils.testBit(__isset_bitfield, __CLIENTID_ISSET_ID); } public void setClientIdIsSet(boolean value) { __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CLIENTID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { switch (field) { case CLIENT_ID: if (value == null) { unsetClientId(); } else { setClientId((Long)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case CLIENT_ID: return Long.valueOf(getClientId()); } 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 CLIENT_ID: return isSetClientId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unregisterClient_args) return this.equals((unregisterClient_args)that); return false; } public boolean equals(unregisterClient_args that) { if (that == null) return false; boolean this_present_clientId = true; boolean that_present_clientId = true; if (this_present_clientId || that_present_clientId) { if (!(this_present_clientId && that_present_clientId)) return false; if (this.clientId != that.clientId) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(unregisterClient_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; unregisterClient_args typedOther = (unregisterClient_args)other; lastComparison = Boolean.valueOf(isSetClientId()).compareTo(typedOther.isSetClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.clientId, typedOther.clientId); 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("unregisterClient_args("); boolean first = true; sb.append("clientId:"); sb.append(this.clientId); first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; 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 unregisterClient_argsStandardSchemeFactory implements SchemeFactory { public unregisterClient_argsStandardScheme getScheme() { return new unregisterClient_argsStandardScheme(); } } private static class unregisterClient_argsStandardScheme extends StandardScheme<unregisterClient_args> { public void read(org.apache.thrift.protocol.TProtocol iprot, unregisterClient_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: // CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.I64) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(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, unregisterClient_args struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(CLIENT_ID_FIELD_DESC); oprot.writeI64(struct.clientId); oprot.writeFieldEnd(); oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unregisterClient_argsTupleSchemeFactory implements SchemeFactory { public unregisterClient_argsTupleScheme getScheme() { return new unregisterClient_argsTupleScheme(); } } private static class unregisterClient_argsTupleScheme extends TupleScheme<unregisterClient_args> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unregisterClient_args struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetClientId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetClientId()) { oprot.writeI64(struct.clientId); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unregisterClient_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.clientId = iprot.readI64(); struct.setClientIdIsSet(true); } } } } public static class unregisterClient_result implements org.apache.thrift.TBase<unregisterClient_result, unregisterClient_result._Fields>, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unregisterClient_result"); private static final org.apache.thrift.protocol.TField INVALID_CLIENT_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidClientId", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>(); static { schemes.put(StandardScheme.class, new unregisterClient_resultStandardSchemeFactory()); schemes.put(TupleScheme.class, new unregisterClient_resultTupleSchemeFactory()); } public InvalidClientIdException invalidClientId; // 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 { INVALID_CLIENT_ID((short)1, "invalidClientId"); 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: // INVALID_CLIENT_ID return INVALID_CLIENT_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 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.INVALID_CLIENT_ID, new org.apache.thrift.meta_data.FieldMetaData("invalidClientId", 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(unregisterClient_result.class, metaDataMap); } public unregisterClient_result() { } public unregisterClient_result( InvalidClientIdException invalidClientId) { this(); this.invalidClientId = invalidClientId; } /** * Performs a deep copy on <i>other</i>. */ public unregisterClient_result(unregisterClient_result other) { if (other.isSetInvalidClientId()) { this.invalidClientId = new InvalidClientIdException(other.invalidClientId); } } public unregisterClient_result deepCopy() { return new unregisterClient_result(this); } @Override public void clear() { this.invalidClientId = null; } public InvalidClientIdException getInvalidClientId() { return this.invalidClientId; } public unregisterClient_result setInvalidClientId(InvalidClientIdException invalidClientId) { this.invalidClientId = invalidClientId; return this; } public void unsetInvalidClientId() { this.invalidClientId = null; } /** Returns true if field invalidClientId is set (has been assigned a value) and false otherwise */ public boolean isSetInvalidClientId() { return this.invalidClientId != null; } public void setInvalidClientIdIsSet(boolean value) { if (!value) { this.invalidClientId = null; } } public void setFieldValue(_Fields field, Object value) { switch (field) { case INVALID_CLIENT_ID: if (value == null) { unsetInvalidClientId(); } else { setInvalidClientId((InvalidClientIdException)value); } break; } } public Object getFieldValue(_Fields field) { switch (field) { case INVALID_CLIENT_ID: return getInvalidClientId(); } 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 INVALID_CLIENT_ID: return isSetInvalidClientId(); } throw new IllegalStateException(); } @Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof unregisterClient_result) return this.equals((unregisterClient_result)that); return false; } public boolean equals(unregisterClient_result that) { if (that == null) return false; boolean this_present_invalidClientId = true && this.isSetInvalidClientId(); boolean that_present_invalidClientId = true && that.isSetInvalidClientId(); if (this_present_invalidClientId || that_present_invalidClientId) { if (!(this_present_invalidClientId && that_present_invalidClientId)) return false; if (!this.invalidClientId.equals(that.invalidClientId)) return false; } return true; } @Override public int hashCode() { return 0; } public int compareTo(unregisterClient_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; unregisterClient_result typedOther = (unregisterClient_result)other; lastComparison = Boolean.valueOf(isSetInvalidClientId()).compareTo(typedOther.isSetInvalidClientId()); if (lastComparison != 0) { return lastComparison; } if (isSetInvalidClientId()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidClientId, typedOther.invalidClientId); 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("unregisterClient_result("); boolean first = true; sb.append("invalidClientId:"); if (this.invalidClientId == null) { sb.append("null"); } else { sb.append(this.invalidClientId); } first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { try { write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } private static class unregisterClient_resultStandardSchemeFactory implements SchemeFactory { public unregisterClient_resultStandardScheme getScheme() { return new unregisterClient_resultStandardScheme(); } } private static class unregisterClient_resultStandardScheme extends StandardScheme<unregisterClient_result> { public void read(org.apache.thrift.protocol.TProtocol iprot, unregisterClient_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 1: // INVALID_CLIENT_ID if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(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, unregisterClient_result struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.invalidClientId != null) { oprot.writeFieldBegin(INVALID_CLIENT_ID_FIELD_DESC); struct.invalidClientId.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); } } private static class unregisterClient_resultTupleSchemeFactory implements SchemeFactory { public unregisterClient_resultTupleScheme getScheme() { return new unregisterClient_resultTupleScheme(); } } private static class unregisterClient_resultTupleScheme extends TupleScheme<unregisterClient_result> { @Override public void write(org.apache.thrift.protocol.TProtocol prot, unregisterClient_result struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetInvalidClientId()) { optionals.set(0); } oprot.writeBitSet(optionals, 1); if (struct.isSetInvalidClientId()) { struct.invalidClientId.write(oprot); } } @Override public void read(org.apache.thrift.protocol.TProtocol prot, unregisterClient_result struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.invalidClientId = new InvalidClientIdException(); struct.invalidClientId.read(iprot); struct.setInvalidClientIdIsSet(true); } } } } }