/**
* 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 ClientHandler {
public interface Iface {
public void handleNotification(NamespaceNotification notification, String serverId) throws InvalidServerIdException, org.apache.thrift.TException;
public void heartbeat(String serverId) throws InvalidServerIdException, org.apache.thrift.TException;
public void registerServer(long clientId, String serverId, long token) throws InvalidTokenException, org.apache.thrift.TException;
}
public interface AsyncIface {
public void handleNotification(NamespaceNotification notification, String serverId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.handleNotification_call> resultHandler) throws org.apache.thrift.TException;
public void heartbeat(String serverId, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.heartbeat_call> resultHandler) throws org.apache.thrift.TException;
public void registerServer(long clientId, String serverId, long token, org.apache.thrift.async.AsyncMethodCallback<AsyncClient.registerServer_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 handleNotification(NamespaceNotification notification, String serverId) throws InvalidServerIdException, org.apache.thrift.TException
{
send_handleNotification(notification, serverId);
recv_handleNotification();
}
public void send_handleNotification(NamespaceNotification notification, String serverId) throws org.apache.thrift.TException
{
handleNotification_args args = new handleNotification_args();
args.setNotification(notification);
args.setServerId(serverId);
sendBase("handleNotification", args);
}
public void recv_handleNotification() throws InvalidServerIdException, org.apache.thrift.TException
{
handleNotification_result result = new handleNotification_result();
receiveBase(result, "handleNotification");
if (result.invalidServerId != null) {
throw result.invalidServerId;
}
return;
}
public void heartbeat(String serverId) throws InvalidServerIdException, org.apache.thrift.TException
{
send_heartbeat(serverId);
recv_heartbeat();
}
public void send_heartbeat(String serverId) throws org.apache.thrift.TException
{
heartbeat_args args = new heartbeat_args();
args.setServerId(serverId);
sendBase("heartbeat", args);
}
public void recv_heartbeat() throws InvalidServerIdException, org.apache.thrift.TException
{
heartbeat_result result = new heartbeat_result();
receiveBase(result, "heartbeat");
if (result.invalidServerId != null) {
throw result.invalidServerId;
}
return;
}
public void registerServer(long clientId, String serverId, long token) throws InvalidTokenException, org.apache.thrift.TException
{
send_registerServer(clientId, serverId, token);
recv_registerServer();
}
public void send_registerServer(long clientId, String serverId, long token) throws org.apache.thrift.TException
{
registerServer_args args = new registerServer_args();
args.setClientId(clientId);
args.setServerId(serverId);
args.setToken(token);
sendBase("registerServer", args);
}
public void recv_registerServer() throws InvalidTokenException, org.apache.thrift.TException
{
registerServer_result result = new registerServer_result();
receiveBase(result, "registerServer");
if (result.invalidToken != null) {
throw result.invalidToken;
}
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 handleNotification(NamespaceNotification notification, String serverId, org.apache.thrift.async.AsyncMethodCallback<handleNotification_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
handleNotification_call method_call = new handleNotification_call(notification, serverId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class handleNotification_call extends org.apache.thrift.async.TAsyncMethodCall {
private NamespaceNotification notification;
private String serverId;
public handleNotification_call(NamespaceNotification notification, String serverId, org.apache.thrift.async.AsyncMethodCallback<handleNotification_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.notification = notification;
this.serverId = serverId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("handleNotification", org.apache.thrift.protocol.TMessageType.CALL, 0));
handleNotification_args args = new handleNotification_args();
args.setNotification(notification);
args.setServerId(serverId);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws InvalidServerIdException, 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_handleNotification();
}
}
public void heartbeat(String serverId, org.apache.thrift.async.AsyncMethodCallback<heartbeat_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
heartbeat_call method_call = new heartbeat_call(serverId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class heartbeat_call extends org.apache.thrift.async.TAsyncMethodCall {
private String serverId;
public heartbeat_call(String serverId, org.apache.thrift.async.AsyncMethodCallback<heartbeat_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.serverId = serverId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("heartbeat", org.apache.thrift.protocol.TMessageType.CALL, 0));
heartbeat_args args = new heartbeat_args();
args.setServerId(serverId);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws InvalidServerIdException, 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_heartbeat();
}
}
public void registerServer(long clientId, String serverId, long token, org.apache.thrift.async.AsyncMethodCallback<registerServer_call> resultHandler) throws org.apache.thrift.TException {
checkReady();
registerServer_call method_call = new registerServer_call(clientId, serverId, token, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class registerServer_call extends org.apache.thrift.async.TAsyncMethodCall {
private long clientId;
private String serverId;
private long token;
public registerServer_call(long clientId, String serverId, long token, org.apache.thrift.async.AsyncMethodCallback<registerServer_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.serverId = serverId;
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("registerServer", org.apache.thrift.protocol.TMessageType.CALL, 0));
registerServer_args args = new registerServer_args();
args.setClientId(clientId);
args.setServerId(serverId);
args.setToken(token);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws InvalidTokenException, 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_registerServer();
}
}
}
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("handleNotification", new handleNotification());
processMap.put("heartbeat", new heartbeat());
processMap.put("registerServer", new registerServer());
return processMap;
}
public static class handleNotification<I extends Iface> extends org.apache.thrift.ProcessFunction<I, handleNotification_args> {
public handleNotification() {
super("handleNotification");
}
public handleNotification_args getEmptyArgsInstance() {
return new handleNotification_args();
}
protected boolean isOneway() {
return false;
}
public handleNotification_result getResult(I iface, handleNotification_args args) throws org.apache.thrift.TException {
handleNotification_result result = new handleNotification_result();
try {
iface.handleNotification(args.notification, args.serverId);
} catch (InvalidServerIdException invalidServerId) {
result.invalidServerId = invalidServerId;
}
return result;
}
}
public static class heartbeat<I extends Iface> extends org.apache.thrift.ProcessFunction<I, heartbeat_args> {
public heartbeat() {
super("heartbeat");
}
public heartbeat_args getEmptyArgsInstance() {
return new heartbeat_args();
}
protected boolean isOneway() {
return false;
}
public heartbeat_result getResult(I iface, heartbeat_args args) throws org.apache.thrift.TException {
heartbeat_result result = new heartbeat_result();
try {
iface.heartbeat(args.serverId);
} catch (InvalidServerIdException invalidServerId) {
result.invalidServerId = invalidServerId;
}
return result;
}
}
public static class registerServer<I extends Iface> extends org.apache.thrift.ProcessFunction<I, registerServer_args> {
public registerServer() {
super("registerServer");
}
public registerServer_args getEmptyArgsInstance() {
return new registerServer_args();
}
protected boolean isOneway() {
return false;
}
public registerServer_result getResult(I iface, registerServer_args args) throws org.apache.thrift.TException {
registerServer_result result = new registerServer_result();
try {
iface.registerServer(args.clientId, args.serverId, args.token);
} catch (InvalidTokenException invalidToken) {
result.invalidToken = invalidToken;
}
return result;
}
}
}
public static class handleNotification_args implements org.apache.thrift.TBase<handleNotification_args, handleNotification_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("handleNotification_args");
private static final org.apache.thrift.protocol.TField NOTIFICATION_FIELD_DESC = new org.apache.thrift.protocol.TField("notification", org.apache.thrift.protocol.TType.STRUCT, (short)1);
private static final org.apache.thrift.protocol.TField SERVER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverId", org.apache.thrift.protocol.TType.STRING, (short)2);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new handleNotification_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new handleNotification_argsTupleSchemeFactory());
}
public NamespaceNotification notification; // required
public String serverId; // 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 {
NOTIFICATION((short)1, "notification"),
SERVER_ID((short)2, "serverId");
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: // NOTIFICATION
return NOTIFICATION;
case 2: // SERVER_ID
return SERVER_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.NOTIFICATION, new org.apache.thrift.meta_data.FieldMetaData("notification", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, NamespaceNotification.class)));
tmpMap.put(_Fields.SERVER_ID, new org.apache.thrift.meta_data.FieldMetaData("serverId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(handleNotification_args.class, metaDataMap);
}
public handleNotification_args() {
}
public handleNotification_args(
NamespaceNotification notification,
String serverId)
{
this();
this.notification = notification;
this.serverId = serverId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public handleNotification_args(handleNotification_args other) {
if (other.isSetNotification()) {
this.notification = new NamespaceNotification(other.notification);
}
if (other.isSetServerId()) {
this.serverId = other.serverId;
}
}
public handleNotification_args deepCopy() {
return new handleNotification_args(this);
}
@Override
public void clear() {
this.notification = null;
this.serverId = null;
}
public NamespaceNotification getNotification() {
return this.notification;
}
public handleNotification_args setNotification(NamespaceNotification notification) {
this.notification = notification;
return this;
}
public void unsetNotification() {
this.notification = null;
}
/** Returns true if field notification is set (has been assigned a value) and false otherwise */
public boolean isSetNotification() {
return this.notification != null;
}
public void setNotificationIsSet(boolean value) {
if (!value) {
this.notification = null;
}
}
public String getServerId() {
return this.serverId;
}
public handleNotification_args setServerId(String serverId) {
this.serverId = serverId;
return this;
}
public void unsetServerId() {
this.serverId = null;
}
/** Returns true if field serverId is set (has been assigned a value) and false otherwise */
public boolean isSetServerId() {
return this.serverId != null;
}
public void setServerIdIsSet(boolean value) {
if (!value) {
this.serverId = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case NOTIFICATION:
if (value == null) {
unsetNotification();
} else {
setNotification((NamespaceNotification)value);
}
break;
case SERVER_ID:
if (value == null) {
unsetServerId();
} else {
setServerId((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case NOTIFICATION:
return getNotification();
case SERVER_ID:
return getServerId();
}
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 NOTIFICATION:
return isSetNotification();
case SERVER_ID:
return isSetServerId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof handleNotification_args)
return this.equals((handleNotification_args)that);
return false;
}
public boolean equals(handleNotification_args that) {
if (that == null)
return false;
boolean this_present_notification = true && this.isSetNotification();
boolean that_present_notification = true && that.isSetNotification();
if (this_present_notification || that_present_notification) {
if (!(this_present_notification && that_present_notification))
return false;
if (!this.notification.equals(that.notification))
return false;
}
boolean this_present_serverId = true && this.isSetServerId();
boolean that_present_serverId = true && that.isSetServerId();
if (this_present_serverId || that_present_serverId) {
if (!(this_present_serverId && that_present_serverId))
return false;
if (!this.serverId.equals(that.serverId))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(handleNotification_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
handleNotification_args typedOther = (handleNotification_args)other;
lastComparison = Boolean.valueOf(isSetNotification()).compareTo(typedOther.isSetNotification());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetNotification()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.notification, typedOther.notification);
if (lastComparison != 0) {
return lastComparison;
}
}
lastComparison = Boolean.valueOf(isSetServerId()).compareTo(typedOther.isSetServerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverId, typedOther.serverId);
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("handleNotification_args(");
boolean first = true;
sb.append("notification:");
if (this.notification == null) {
sb.append("null");
} else {
sb.append(this.notification);
}
first = false;
if (!first) sb.append(", ");
sb.append("serverId:");
if (this.serverId == null) {
sb.append("null");
} else {
sb.append(this.serverId);
}
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 (notification != null) {
notification.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 {
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 handleNotification_argsStandardSchemeFactory implements SchemeFactory {
public handleNotification_argsStandardScheme getScheme() {
return new handleNotification_argsStandardScheme();
}
}
private static class handleNotification_argsStandardScheme extends StandardScheme<handleNotification_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, handleNotification_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: // NOTIFICATION
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.notification = new NamespaceNotification();
struct.notification.read(iprot);
struct.setNotificationIsSet(true);
} else {
org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
}
break;
case 2: // SERVER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.serverId = iprot.readString();
struct.setServerIdIsSet(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, handleNotification_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.notification != null) {
oprot.writeFieldBegin(NOTIFICATION_FIELD_DESC);
struct.notification.write(oprot);
oprot.writeFieldEnd();
}
if (struct.serverId != null) {
oprot.writeFieldBegin(SERVER_ID_FIELD_DESC);
oprot.writeString(struct.serverId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class handleNotification_argsTupleSchemeFactory implements SchemeFactory {
public handleNotification_argsTupleScheme getScheme() {
return new handleNotification_argsTupleScheme();
}
}
private static class handleNotification_argsTupleScheme extends TupleScheme<handleNotification_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, handleNotification_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetNotification()) {
optionals.set(0);
}
if (struct.isSetServerId()) {
optionals.set(1);
}
oprot.writeBitSet(optionals, 2);
if (struct.isSetNotification()) {
struct.notification.write(oprot);
}
if (struct.isSetServerId()) {
oprot.writeString(struct.serverId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, handleNotification_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(2);
if (incoming.get(0)) {
struct.notification = new NamespaceNotification();
struct.notification.read(iprot);
struct.setNotificationIsSet(true);
}
if (incoming.get(1)) {
struct.serverId = iprot.readString();
struct.setServerIdIsSet(true);
}
}
}
}
public static class handleNotification_result implements org.apache.thrift.TBase<handleNotification_result, handleNotification_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("handleNotification_result");
private static final org.apache.thrift.protocol.TField INVALID_SERVER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidServerId", 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 handleNotification_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new handleNotification_resultTupleSchemeFactory());
}
public InvalidServerIdException invalidServerId; // 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_SERVER_ID((short)1, "invalidServerId");
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_SERVER_ID
return INVALID_SERVER_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_SERVER_ID, new org.apache.thrift.meta_data.FieldMetaData("invalidServerId", 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(handleNotification_result.class, metaDataMap);
}
public handleNotification_result() {
}
public handleNotification_result(
InvalidServerIdException invalidServerId)
{
this();
this.invalidServerId = invalidServerId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public handleNotification_result(handleNotification_result other) {
if (other.isSetInvalidServerId()) {
this.invalidServerId = new InvalidServerIdException(other.invalidServerId);
}
}
public handleNotification_result deepCopy() {
return new handleNotification_result(this);
}
@Override
public void clear() {
this.invalidServerId = null;
}
public InvalidServerIdException getInvalidServerId() {
return this.invalidServerId;
}
public handleNotification_result setInvalidServerId(InvalidServerIdException invalidServerId) {
this.invalidServerId = invalidServerId;
return this;
}
public void unsetInvalidServerId() {
this.invalidServerId = null;
}
/** Returns true if field invalidServerId is set (has been assigned a value) and false otherwise */
public boolean isSetInvalidServerId() {
return this.invalidServerId != null;
}
public void setInvalidServerIdIsSet(boolean value) {
if (!value) {
this.invalidServerId = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case INVALID_SERVER_ID:
if (value == null) {
unsetInvalidServerId();
} else {
setInvalidServerId((InvalidServerIdException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case INVALID_SERVER_ID:
return getInvalidServerId();
}
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_SERVER_ID:
return isSetInvalidServerId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof handleNotification_result)
return this.equals((handleNotification_result)that);
return false;
}
public boolean equals(handleNotification_result that) {
if (that == null)
return false;
boolean this_present_invalidServerId = true && this.isSetInvalidServerId();
boolean that_present_invalidServerId = true && that.isSetInvalidServerId();
if (this_present_invalidServerId || that_present_invalidServerId) {
if (!(this_present_invalidServerId && that_present_invalidServerId))
return false;
if (!this.invalidServerId.equals(that.invalidServerId))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(handleNotification_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
handleNotification_result typedOther = (handleNotification_result)other;
lastComparison = Boolean.valueOf(isSetInvalidServerId()).compareTo(typedOther.isSetInvalidServerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInvalidServerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidServerId, typedOther.invalidServerId);
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("handleNotification_result(");
boolean first = true;
sb.append("invalidServerId:");
if (this.invalidServerId == null) {
sb.append("null");
} else {
sb.append(this.invalidServerId);
}
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 handleNotification_resultStandardSchemeFactory implements SchemeFactory {
public handleNotification_resultStandardScheme getScheme() {
return new handleNotification_resultStandardScheme();
}
}
private static class handleNotification_resultStandardScheme extends StandardScheme<handleNotification_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, handleNotification_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_SERVER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.invalidServerId = new InvalidServerIdException();
struct.invalidServerId.read(iprot);
struct.setInvalidServerIdIsSet(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, handleNotification_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.invalidServerId != null) {
oprot.writeFieldBegin(INVALID_SERVER_ID_FIELD_DESC);
struct.invalidServerId.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class handleNotification_resultTupleSchemeFactory implements SchemeFactory {
public handleNotification_resultTupleScheme getScheme() {
return new handleNotification_resultTupleScheme();
}
}
private static class handleNotification_resultTupleScheme extends TupleScheme<handleNotification_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, handleNotification_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetInvalidServerId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetInvalidServerId()) {
struct.invalidServerId.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, handleNotification_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.invalidServerId = new InvalidServerIdException();
struct.invalidServerId.read(iprot);
struct.setInvalidServerIdIsSet(true);
}
}
}
}
public static class heartbeat_args implements org.apache.thrift.TBase<heartbeat_args, heartbeat_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("heartbeat_args");
private static final org.apache.thrift.protocol.TField SERVER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverId", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new heartbeat_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new heartbeat_argsTupleSchemeFactory());
}
public String serverId; // 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 {
SERVER_ID((short)1, "serverId");
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: // SERVER_ID
return SERVER_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.SERVER_ID, new org.apache.thrift.meta_data.FieldMetaData("serverId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(heartbeat_args.class, metaDataMap);
}
public heartbeat_args() {
}
public heartbeat_args(
String serverId)
{
this();
this.serverId = serverId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public heartbeat_args(heartbeat_args other) {
if (other.isSetServerId()) {
this.serverId = other.serverId;
}
}
public heartbeat_args deepCopy() {
return new heartbeat_args(this);
}
@Override
public void clear() {
this.serverId = null;
}
public String getServerId() {
return this.serverId;
}
public heartbeat_args setServerId(String serverId) {
this.serverId = serverId;
return this;
}
public void unsetServerId() {
this.serverId = null;
}
/** Returns true if field serverId is set (has been assigned a value) and false otherwise */
public boolean isSetServerId() {
return this.serverId != null;
}
public void setServerIdIsSet(boolean value) {
if (!value) {
this.serverId = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case SERVER_ID:
if (value == null) {
unsetServerId();
} else {
setServerId((String)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case SERVER_ID:
return getServerId();
}
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 SERVER_ID:
return isSetServerId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof heartbeat_args)
return this.equals((heartbeat_args)that);
return false;
}
public boolean equals(heartbeat_args that) {
if (that == null)
return false;
boolean this_present_serverId = true && this.isSetServerId();
boolean that_present_serverId = true && that.isSetServerId();
if (this_present_serverId || that_present_serverId) {
if (!(this_present_serverId && that_present_serverId))
return false;
if (!this.serverId.equals(that.serverId))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(heartbeat_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
heartbeat_args typedOther = (heartbeat_args)other;
lastComparison = Boolean.valueOf(isSetServerId()).compareTo(typedOther.isSetServerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverId, typedOther.serverId);
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("heartbeat_args(");
boolean first = true;
sb.append("serverId:");
if (this.serverId == null) {
sb.append("null");
} else {
sb.append(this.serverId);
}
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 heartbeat_argsStandardSchemeFactory implements SchemeFactory {
public heartbeat_argsStandardScheme getScheme() {
return new heartbeat_argsStandardScheme();
}
}
private static class heartbeat_argsStandardScheme extends StandardScheme<heartbeat_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, heartbeat_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: // SERVER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.serverId = iprot.readString();
struct.setServerIdIsSet(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, heartbeat_args struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.serverId != null) {
oprot.writeFieldBegin(SERVER_ID_FIELD_DESC);
oprot.writeString(struct.serverId);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class heartbeat_argsTupleSchemeFactory implements SchemeFactory {
public heartbeat_argsTupleScheme getScheme() {
return new heartbeat_argsTupleScheme();
}
}
private static class heartbeat_argsTupleScheme extends TupleScheme<heartbeat_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, heartbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetServerId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetServerId()) {
oprot.writeString(struct.serverId);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, heartbeat_args struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.serverId = iprot.readString();
struct.setServerIdIsSet(true);
}
}
}
}
public static class heartbeat_result implements org.apache.thrift.TBase<heartbeat_result, heartbeat_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("heartbeat_result");
private static final org.apache.thrift.protocol.TField INVALID_SERVER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidServerId", 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 heartbeat_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new heartbeat_resultTupleSchemeFactory());
}
public InvalidServerIdException invalidServerId; // 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_SERVER_ID((short)1, "invalidServerId");
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_SERVER_ID
return INVALID_SERVER_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_SERVER_ID, new org.apache.thrift.meta_data.FieldMetaData("invalidServerId", 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(heartbeat_result.class, metaDataMap);
}
public heartbeat_result() {
}
public heartbeat_result(
InvalidServerIdException invalidServerId)
{
this();
this.invalidServerId = invalidServerId;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public heartbeat_result(heartbeat_result other) {
if (other.isSetInvalidServerId()) {
this.invalidServerId = new InvalidServerIdException(other.invalidServerId);
}
}
public heartbeat_result deepCopy() {
return new heartbeat_result(this);
}
@Override
public void clear() {
this.invalidServerId = null;
}
public InvalidServerIdException getInvalidServerId() {
return this.invalidServerId;
}
public heartbeat_result setInvalidServerId(InvalidServerIdException invalidServerId) {
this.invalidServerId = invalidServerId;
return this;
}
public void unsetInvalidServerId() {
this.invalidServerId = null;
}
/** Returns true if field invalidServerId is set (has been assigned a value) and false otherwise */
public boolean isSetInvalidServerId() {
return this.invalidServerId != null;
}
public void setInvalidServerIdIsSet(boolean value) {
if (!value) {
this.invalidServerId = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case INVALID_SERVER_ID:
if (value == null) {
unsetInvalidServerId();
} else {
setInvalidServerId((InvalidServerIdException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case INVALID_SERVER_ID:
return getInvalidServerId();
}
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_SERVER_ID:
return isSetInvalidServerId();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof heartbeat_result)
return this.equals((heartbeat_result)that);
return false;
}
public boolean equals(heartbeat_result that) {
if (that == null)
return false;
boolean this_present_invalidServerId = true && this.isSetInvalidServerId();
boolean that_present_invalidServerId = true && that.isSetInvalidServerId();
if (this_present_invalidServerId || that_present_invalidServerId) {
if (!(this_present_invalidServerId && that_present_invalidServerId))
return false;
if (!this.invalidServerId.equals(that.invalidServerId))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(heartbeat_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
heartbeat_result typedOther = (heartbeat_result)other;
lastComparison = Boolean.valueOf(isSetInvalidServerId()).compareTo(typedOther.isSetInvalidServerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInvalidServerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidServerId, typedOther.invalidServerId);
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("heartbeat_result(");
boolean first = true;
sb.append("invalidServerId:");
if (this.invalidServerId == null) {
sb.append("null");
} else {
sb.append(this.invalidServerId);
}
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 heartbeat_resultStandardSchemeFactory implements SchemeFactory {
public heartbeat_resultStandardScheme getScheme() {
return new heartbeat_resultStandardScheme();
}
}
private static class heartbeat_resultStandardScheme extends StandardScheme<heartbeat_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, heartbeat_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_SERVER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.invalidServerId = new InvalidServerIdException();
struct.invalidServerId.read(iprot);
struct.setInvalidServerIdIsSet(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, heartbeat_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.invalidServerId != null) {
oprot.writeFieldBegin(INVALID_SERVER_ID_FIELD_DESC);
struct.invalidServerId.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class heartbeat_resultTupleSchemeFactory implements SchemeFactory {
public heartbeat_resultTupleScheme getScheme() {
return new heartbeat_resultTupleScheme();
}
}
private static class heartbeat_resultTupleScheme extends TupleScheme<heartbeat_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, heartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetInvalidServerId()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetInvalidServerId()) {
struct.invalidServerId.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, heartbeat_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.invalidServerId = new InvalidServerIdException();
struct.invalidServerId.read(iprot);
struct.setInvalidServerIdIsSet(true);
}
}
}
}
public static class registerServer_args implements org.apache.thrift.TBase<registerServer_args, registerServer_args._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerServer_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 SERVER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("serverId", org.apache.thrift.protocol.TType.STRING, (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 registerServer_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerServer_argsTupleSchemeFactory());
}
public long clientId; // required
public String serverId; // 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 {
CLIENT_ID((short)1, "clientId"),
SERVER_ID((short)2, "serverId"),
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: // CLIENT_ID
return CLIENT_ID;
case 2: // SERVER_ID
return SERVER_ID;
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 __CLIENTID_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.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.SERVER_ID, new org.apache.thrift.meta_data.FieldMetaData("serverId", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
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(registerServer_args.class, metaDataMap);
}
public registerServer_args() {
}
public registerServer_args(
long clientId,
String serverId,
long token)
{
this();
this.clientId = clientId;
setClientIdIsSet(true);
this.serverId = serverId;
this.token = token;
setTokenIsSet(true);
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerServer_args(registerServer_args other) {
__isset_bitfield = other.__isset_bitfield;
this.clientId = other.clientId;
if (other.isSetServerId()) {
this.serverId = other.serverId;
}
this.token = other.token;
}
public registerServer_args deepCopy() {
return new registerServer_args(this);
}
@Override
public void clear() {
setClientIdIsSet(false);
this.clientId = 0;
this.serverId = null;
setTokenIsSet(false);
this.token = 0;
}
public long getClientId() {
return this.clientId;
}
public registerServer_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 String getServerId() {
return this.serverId;
}
public registerServer_args setServerId(String serverId) {
this.serverId = serverId;
return this;
}
public void unsetServerId() {
this.serverId = null;
}
/** Returns true if field serverId is set (has been assigned a value) and false otherwise */
public boolean isSetServerId() {
return this.serverId != null;
}
public void setServerIdIsSet(boolean value) {
if (!value) {
this.serverId = null;
}
}
public long getToken() {
return this.token;
}
public registerServer_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 CLIENT_ID:
if (value == null) {
unsetClientId();
} else {
setClientId((Long)value);
}
break;
case SERVER_ID:
if (value == null) {
unsetServerId();
} else {
setServerId((String)value);
}
break;
case TOKEN:
if (value == null) {
unsetToken();
} else {
setToken((Long)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case CLIENT_ID:
return Long.valueOf(getClientId());
case SERVER_ID:
return getServerId();
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 CLIENT_ID:
return isSetClientId();
case SERVER_ID:
return isSetServerId();
case TOKEN:
return isSetToken();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof registerServer_args)
return this.equals((registerServer_args)that);
return false;
}
public boolean equals(registerServer_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_serverId = true && this.isSetServerId();
boolean that_present_serverId = true && that.isSetServerId();
if (this_present_serverId || that_present_serverId) {
if (!(this_present_serverId && that_present_serverId))
return false;
if (!this.serverId.equals(that.serverId))
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(registerServer_args other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
registerServer_args typedOther = (registerServer_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(isSetServerId()).compareTo(typedOther.isSetServerId());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetServerId()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.serverId, typedOther.serverId);
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("registerServer_args(");
boolean first = true;
sb.append("clientId:");
sb.append(this.clientId);
first = false;
if (!first) sb.append(", ");
sb.append("serverId:");
if (this.serverId == null) {
sb.append("null");
} else {
sb.append(this.serverId);
}
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 registerServer_argsStandardSchemeFactory implements SchemeFactory {
public registerServer_argsStandardScheme getScheme() {
return new registerServer_argsStandardScheme();
}
}
private static class registerServer_argsStandardScheme extends StandardScheme<registerServer_args> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerServer_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: // SERVER_ID
if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
struct.serverId = iprot.readString();
struct.setServerIdIsSet(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, registerServer_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.serverId != null) {
oprot.writeFieldBegin(SERVER_ID_FIELD_DESC);
oprot.writeString(struct.serverId);
oprot.writeFieldEnd();
}
oprot.writeFieldBegin(TOKEN_FIELD_DESC);
oprot.writeI64(struct.token);
oprot.writeFieldEnd();
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class registerServer_argsTupleSchemeFactory implements SchemeFactory {
public registerServer_argsTupleScheme getScheme() {
return new registerServer_argsTupleScheme();
}
}
private static class registerServer_argsTupleScheme extends TupleScheme<registerServer_args> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerServer_args struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetClientId()) {
optionals.set(0);
}
if (struct.isSetServerId()) {
optionals.set(1);
}
if (struct.isSetToken()) {
optionals.set(2);
}
oprot.writeBitSet(optionals, 3);
if (struct.isSetClientId()) {
oprot.writeI64(struct.clientId);
}
if (struct.isSetServerId()) {
oprot.writeString(struct.serverId);
}
if (struct.isSetToken()) {
oprot.writeI64(struct.token);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, registerServer_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.serverId = iprot.readString();
struct.setServerIdIsSet(true);
}
if (incoming.get(2)) {
struct.token = iprot.readI64();
struct.setTokenIsSet(true);
}
}
}
}
public static class registerServer_result implements org.apache.thrift.TBase<registerServer_result, registerServer_result._Fields>, java.io.Serializable, Cloneable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("registerServer_result");
private static final org.apache.thrift.protocol.TField INVALID_TOKEN_FIELD_DESC = new org.apache.thrift.protocol.TField("invalidToken", 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 registerServer_resultStandardSchemeFactory());
schemes.put(TupleScheme.class, new registerServer_resultTupleSchemeFactory());
}
public InvalidTokenException invalidToken; // 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_TOKEN((short)1, "invalidToken");
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_TOKEN
return INVALID_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
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_TOKEN, new org.apache.thrift.meta_data.FieldMetaData("invalidToken", 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(registerServer_result.class, metaDataMap);
}
public registerServer_result() {
}
public registerServer_result(
InvalidTokenException invalidToken)
{
this();
this.invalidToken = invalidToken;
}
/**
* Performs a deep copy on <i>other</i>.
*/
public registerServer_result(registerServer_result other) {
if (other.isSetInvalidToken()) {
this.invalidToken = new InvalidTokenException(other.invalidToken);
}
}
public registerServer_result deepCopy() {
return new registerServer_result(this);
}
@Override
public void clear() {
this.invalidToken = null;
}
public InvalidTokenException getInvalidToken() {
return this.invalidToken;
}
public registerServer_result setInvalidToken(InvalidTokenException invalidToken) {
this.invalidToken = invalidToken;
return this;
}
public void unsetInvalidToken() {
this.invalidToken = null;
}
/** Returns true if field invalidToken is set (has been assigned a value) and false otherwise */
public boolean isSetInvalidToken() {
return this.invalidToken != null;
}
public void setInvalidTokenIsSet(boolean value) {
if (!value) {
this.invalidToken = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case INVALID_TOKEN:
if (value == null) {
unsetInvalidToken();
} else {
setInvalidToken((InvalidTokenException)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case INVALID_TOKEN:
return getInvalidToken();
}
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_TOKEN:
return isSetInvalidToken();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof registerServer_result)
return this.equals((registerServer_result)that);
return false;
}
public boolean equals(registerServer_result that) {
if (that == null)
return false;
boolean this_present_invalidToken = true && this.isSetInvalidToken();
boolean that_present_invalidToken = true && that.isSetInvalidToken();
if (this_present_invalidToken || that_present_invalidToken) {
if (!(this_present_invalidToken && that_present_invalidToken))
return false;
if (!this.invalidToken.equals(that.invalidToken))
return false;
}
return true;
}
@Override
public int hashCode() {
return 0;
}
public int compareTo(registerServer_result other) {
if (!getClass().equals(other.getClass())) {
return getClass().getName().compareTo(other.getClass().getName());
}
int lastComparison = 0;
registerServer_result typedOther = (registerServer_result)other;
lastComparison = Boolean.valueOf(isSetInvalidToken()).compareTo(typedOther.isSetInvalidToken());
if (lastComparison != 0) {
return lastComparison;
}
if (isSetInvalidToken()) {
lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.invalidToken, typedOther.invalidToken);
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("registerServer_result(");
boolean first = true;
sb.append("invalidToken:");
if (this.invalidToken == null) {
sb.append("null");
} else {
sb.append(this.invalidToken);
}
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 registerServer_resultStandardSchemeFactory implements SchemeFactory {
public registerServer_resultStandardScheme getScheme() {
return new registerServer_resultStandardScheme();
}
}
private static class registerServer_resultStandardScheme extends StandardScheme<registerServer_result> {
public void read(org.apache.thrift.protocol.TProtocol iprot, registerServer_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_TOKEN
if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
struct.invalidToken = new InvalidTokenException();
struct.invalidToken.read(iprot);
struct.setInvalidTokenIsSet(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, registerServer_result struct) throws org.apache.thrift.TException {
struct.validate();
oprot.writeStructBegin(STRUCT_DESC);
if (struct.invalidToken != null) {
oprot.writeFieldBegin(INVALID_TOKEN_FIELD_DESC);
struct.invalidToken.write(oprot);
oprot.writeFieldEnd();
}
oprot.writeFieldStop();
oprot.writeStructEnd();
}
}
private static class registerServer_resultTupleSchemeFactory implements SchemeFactory {
public registerServer_resultTupleScheme getScheme() {
return new registerServer_resultTupleScheme();
}
}
private static class registerServer_resultTupleScheme extends TupleScheme<registerServer_result> {
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, registerServer_result struct) throws org.apache.thrift.TException {
TTupleProtocol oprot = (TTupleProtocol) prot;
BitSet optionals = new BitSet();
if (struct.isSetInvalidToken()) {
optionals.set(0);
}
oprot.writeBitSet(optionals, 1);
if (struct.isSetInvalidToken()) {
struct.invalidToken.write(oprot);
}
}
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, registerServer_result struct) throws org.apache.thrift.TException {
TTupleProtocol iprot = (TTupleProtocol) prot;
BitSet incoming = iprot.readBitSet(1);
if (incoming.get(0)) {
struct.invalidToken = new InvalidTokenException();
struct.invalidToken.read(iprot);
struct.setInvalidTokenIsSet(true);
}
}
}
}
}