/**
 * Autogenerated by Thrift Compiler (0.9.2)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.kaaproject.kaa.server.common.thrift.gen.cli;

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 org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
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 javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.2)", date = "2015-3-5")
public class CliThriftService {

  public interface Iface {

    public String serverName() throws CliThriftException, org.apache.thrift.TException;

    public void shutdown() throws CliThriftException, org.apache.thrift.TException;

    public MemoryUsage getMemoryUsage(boolean forceGC) throws CliThriftException, org.apache.thrift.TException;

    public CommandResult executeCommand(String commandLine) throws CliThriftException, org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void serverName(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void shutdown(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void getMemoryUsage(boolean forceGC, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void executeCommand(String commandLine, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

  }

  public static class Client extends org.apache.thrift.TServiceClient implements Iface {
    public static class Factory implements org.apache.thrift.TServiceClientFactory<Client> {
      public Factory() {}
      public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
        return new Client(prot);
      }
      public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
        return new Client(iprot, oprot);
      }
    }

    public Client(org.apache.thrift.protocol.TProtocol prot)
    {
      super(prot, prot);
    }

    public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
      super(iprot, oprot);
    }

    public String serverName() throws CliThriftException, org.apache.thrift.TException
    {
      send_serverName();
      return recv_serverName();
    }

    public void send_serverName() throws org.apache.thrift.TException
    {
      serverName_args args = new serverName_args();
      sendBase("serverName", args);
    }

    public String recv_serverName() throws CliThriftException, org.apache.thrift.TException
    {
      serverName_result result = new serverName_result();
      receiveBase(result, "serverName");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cliException != null) {
        throw result.cliException;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "serverName failed: unknown result");
    }

    public void shutdown() throws CliThriftException, org.apache.thrift.TException
    {
      send_shutdown();
      recv_shutdown();
    }

    public void send_shutdown() throws org.apache.thrift.TException
    {
      shutdown_args args = new shutdown_args();
      sendBase("shutdown", args);
    }

    public void recv_shutdown() throws CliThriftException, org.apache.thrift.TException
    {
      shutdown_result result = new shutdown_result();
      receiveBase(result, "shutdown");
      if (result.cliException != null) {
        throw result.cliException;
      }
      return;
    }

    public MemoryUsage getMemoryUsage(boolean forceGC) throws CliThriftException, org.apache.thrift.TException
    {
      send_getMemoryUsage(forceGC);
      return recv_getMemoryUsage();
    }

    public void send_getMemoryUsage(boolean forceGC) throws org.apache.thrift.TException
    {
      getMemoryUsage_args args = new getMemoryUsage_args();
      args.setForceGC(forceGC);
      sendBase("getMemoryUsage", args);
    }

    public MemoryUsage recv_getMemoryUsage() throws CliThriftException, org.apache.thrift.TException
    {
      getMemoryUsage_result result = new getMemoryUsage_result();
      receiveBase(result, "getMemoryUsage");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cliException != null) {
        throw result.cliException;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMemoryUsage failed: unknown result");
    }

    public CommandResult executeCommand(String commandLine) throws CliThriftException, org.apache.thrift.TException
    {
      send_executeCommand(commandLine);
      return recv_executeCommand();
    }

    public void send_executeCommand(String commandLine) throws org.apache.thrift.TException
    {
      executeCommand_args args = new executeCommand_args();
      args.setCommandLine(commandLine);
      sendBase("executeCommand", args);
    }

    public CommandResult recv_executeCommand() throws CliThriftException, org.apache.thrift.TException
    {
      executeCommand_result result = new executeCommand_result();
      receiveBase(result, "executeCommand");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.cliException != null) {
        throw result.cliException;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "executeCommand failed: unknown result");
    }

  }
  public static class AsyncClient extends org.apache.thrift.async.TAsyncClient implements AsyncIface {
    public static class Factory implements org.apache.thrift.async.TAsyncClientFactory<AsyncClient> {
      private org.apache.thrift.async.TAsyncClientManager clientManager;
      private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
      public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
        this.clientManager = clientManager;
        this.protocolFactory = protocolFactory;
      }
      public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
        return new AsyncClient(protocolFactory, clientManager, transport);
      }
    }

    public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
      super(protocolFactory, clientManager, transport);
    }

    public void serverName(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      serverName_call method_call = new serverName_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class serverName_call extends org.apache.thrift.async.TAsyncMethodCall {
      public serverName_call(org.apache.thrift.async.AsyncMethodCallback 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);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("serverName", org.apache.thrift.protocol.TMessageType.CALL, 0));
        serverName_args args = new serverName_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public String getResult() throws CliThriftException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_serverName();
      }
    }

    public void shutdown(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      shutdown_call method_call = new shutdown_call(resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class shutdown_call extends org.apache.thrift.async.TAsyncMethodCall {
      public shutdown_call(org.apache.thrift.async.AsyncMethodCallback 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);
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("shutdown", org.apache.thrift.protocol.TMessageType.CALL, 0));
        shutdown_args args = new shutdown_args();
        args.write(prot);
        prot.writeMessageEnd();
      }

      public void getResult() throws CliThriftException, 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_shutdown();
      }
    }

    public void getMemoryUsage(boolean forceGC, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      getMemoryUsage_call method_call = new getMemoryUsage_call(forceGC, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class getMemoryUsage_call extends org.apache.thrift.async.TAsyncMethodCall {
      private boolean forceGC;
      public getMemoryUsage_call(boolean forceGC, org.apache.thrift.async.AsyncMethodCallback 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.forceGC = forceGC;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getMemoryUsage", org.apache.thrift.protocol.TMessageType.CALL, 0));
        getMemoryUsage_args args = new getMemoryUsage_args();
        args.setForceGC(forceGC);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public MemoryUsage getResult() throws CliThriftException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_getMemoryUsage();
      }
    }

    public void executeCommand(String commandLine, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      executeCommand_call method_call = new executeCommand_call(commandLine, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class executeCommand_call extends org.apache.thrift.async.TAsyncMethodCall {
      private String commandLine;
      public executeCommand_call(String commandLine, org.apache.thrift.async.AsyncMethodCallback 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.commandLine = commandLine;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("executeCommand", org.apache.thrift.protocol.TMessageType.CALL, 0));
        executeCommand_args args = new executeCommand_args();
        args.setCommandLine(commandLine);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CommandResult getResult() throws CliThriftException, org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new IllegalStateException("Method call not finished!");
        }
        org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
        org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
        return (new Client(prot)).recv_executeCommand();
      }
    }

  }

  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("serverName", new serverName());
      processMap.put("shutdown", new shutdown());
      processMap.put("getMemoryUsage", new getMemoryUsage());
      processMap.put("executeCommand", new executeCommand());
      return processMap;
    }

    public static class serverName<I extends Iface> extends org.apache.thrift.ProcessFunction<I, serverName_args> {
      public serverName() {
        super("serverName");
      }

      public serverName_args getEmptyArgsInstance() {
        return new serverName_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public serverName_result getResult(I iface, serverName_args args) throws org.apache.thrift.TException {
        serverName_result result = new serverName_result();
        try {
          result.success = iface.serverName();
        } catch (CliThriftException cliException) {
          result.cliException = cliException;
        }
        return result;
      }
    }

    public static class shutdown<I extends Iface> extends org.apache.thrift.ProcessFunction<I, shutdown_args> {
      public shutdown() {
        super("shutdown");
      }

      public shutdown_args getEmptyArgsInstance() {
        return new shutdown_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public shutdown_result getResult(I iface, shutdown_args args) throws org.apache.thrift.TException {
        shutdown_result result = new shutdown_result();
        try {
          iface.shutdown();
        } catch (CliThriftException cliException) {
          result.cliException = cliException;
        }
        return result;
      }
    }

    public static class getMemoryUsage<I extends Iface> extends org.apache.thrift.ProcessFunction<I, getMemoryUsage_args> {
      public getMemoryUsage() {
        super("getMemoryUsage");
      }

      public getMemoryUsage_args getEmptyArgsInstance() {
        return new getMemoryUsage_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public getMemoryUsage_result getResult(I iface, getMemoryUsage_args args) throws org.apache.thrift.TException {
        getMemoryUsage_result result = new getMemoryUsage_result();
        try {
          result.success = iface.getMemoryUsage(args.forceGC);
        } catch (CliThriftException cliException) {
          result.cliException = cliException;
        }
        return result;
      }
    }

    public static class executeCommand<I extends Iface> extends org.apache.thrift.ProcessFunction<I, executeCommand_args> {
      public executeCommand() {
        super("executeCommand");
      }

      public executeCommand_args getEmptyArgsInstance() {
        return new executeCommand_args();
      }

      protected boolean isOneway() {
        return false;
      }

      public executeCommand_result getResult(I iface, executeCommand_args args) throws org.apache.thrift.TException {
        executeCommand_result result = new executeCommand_result();
        try {
          result.success = iface.executeCommand(args.commandLine);
        } catch (CliThriftException cliException) {
          result.cliException = cliException;
        }
        return result;
      }
    }

  }

  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
    private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new HashMap<String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
    }

    protected AsyncProcessor(I iface, Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends AsyncIface> Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(Map<String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      processMap.put("serverName", new serverName());
      processMap.put("shutdown", new shutdown());
      processMap.put("getMemoryUsage", new getMemoryUsage());
      processMap.put("executeCommand", new executeCommand());
      return processMap;
    }

    public static class serverName<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, serverName_args, String> {
      public serverName() {
        super("serverName");
      }

      public serverName_args getEmptyArgsInstance() {
        return new serverName_args();
      }

      public AsyncMethodCallback<String> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<String>() { 
          public void onComplete(String o) {
            serverName_result result = new serverName_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            serverName_result result = new serverName_result();
            if (e instanceof CliThriftException) {
                        result.cliException = (CliThriftException) e;
                        result.setCliExceptionIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, serverName_args args, org.apache.thrift.async.AsyncMethodCallback<String> resultHandler) throws TException {
        iface.serverName(resultHandler);
      }
    }

    public static class shutdown<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, shutdown_args, Void> {
      public shutdown() {
        super("shutdown");
      }

      public shutdown_args getEmptyArgsInstance() {
        return new shutdown_args();
      }

      public AsyncMethodCallback<Void> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<Void>() { 
          public void onComplete(Void o) {
            shutdown_result result = new shutdown_result();
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            shutdown_result result = new shutdown_result();
            if (e instanceof CliThriftException) {
                        result.cliException = (CliThriftException) e;
                        result.setCliExceptionIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, shutdown_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws TException {
        iface.shutdown(resultHandler);
      }
    }

    public static class getMemoryUsage<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, getMemoryUsage_args, MemoryUsage> {
      public getMemoryUsage() {
        super("getMemoryUsage");
      }

      public getMemoryUsage_args getEmptyArgsInstance() {
        return new getMemoryUsage_args();
      }

      public AsyncMethodCallback<MemoryUsage> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<MemoryUsage>() { 
          public void onComplete(MemoryUsage o) {
            getMemoryUsage_result result = new getMemoryUsage_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            getMemoryUsage_result result = new getMemoryUsage_result();
            if (e instanceof CliThriftException) {
                        result.cliException = (CliThriftException) e;
                        result.setCliExceptionIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, getMemoryUsage_args args, org.apache.thrift.async.AsyncMethodCallback<MemoryUsage> resultHandler) throws TException {
        iface.getMemoryUsage(args.forceGC,resultHandler);
      }
    }

    public static class executeCommand<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, executeCommand_args, CommandResult> {
      public executeCommand() {
        super("executeCommand");
      }

      public executeCommand_args getEmptyArgsInstance() {
        return new executeCommand_args();
      }

      public AsyncMethodCallback<CommandResult> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new AsyncMethodCallback<CommandResult>() { 
          public void onComplete(CommandResult o) {
            executeCommand_result result = new executeCommand_result();
            result.success = o;
            try {
              fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
              return;
            } catch (Exception e) {
              LOGGER.error("Exception writing to internal frame buffer", e);
            }
            fb.close();
          }
          public void onError(Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TBase msg;
            executeCommand_result result = new executeCommand_result();
            if (e instanceof CliThriftException) {
                        result.cliException = (CliThriftException) e;
                        result.setCliExceptionIsSet(true);
                        msg = result;
            }
             else 
            {
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
              return;
            } catch (Exception ex) {
              LOGGER.error("Exception writing to internal frame buffer", ex);
            }
            fb.close();
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, executeCommand_args args, org.apache.thrift.async.AsyncMethodCallback<CommandResult> resultHandler) throws TException {
        iface.executeCommand(args.commandLine,resultHandler);
      }
    }

  }

  public static class serverName_args implements org.apache.thrift.TBase<serverName_args, serverName_args._Fields>, java.io.Serializable, Cloneable, Comparable<serverName_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("serverName_args");


    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new serverName_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new serverName_argsTupleSchemeFactory());
    }


    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, 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);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(serverName_args.class, metaDataMap);
    }

    public serverName_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public serverName_args(serverName_args other) {
    }

    public serverName_args deepCopy() {
      return new serverName_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof serverName_args)
        return this.equals((serverName_args)that);
      return false;
    }

    public boolean equals(serverName_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      return list.hashCode();
    }

    @Override
    public int compareTo(serverName_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      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("serverName_args(");
      boolean first = true;

      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 serverName_argsStandardSchemeFactory implements SchemeFactory {
      public serverName_argsStandardScheme getScheme() {
        return new serverName_argsStandardScheme();
      }
    }

    private static class serverName_argsStandardScheme extends StandardScheme<serverName_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, serverName_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) {
            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, serverName_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class serverName_argsTupleSchemeFactory implements SchemeFactory {
      public serverName_argsTupleScheme getScheme() {
        return new serverName_argsTupleScheme();
      }
    }

    private static class serverName_argsTupleScheme extends TupleScheme<serverName_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, serverName_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, serverName_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

  public static class serverName_result implements org.apache.thrift.TBase<serverName_result, serverName_result._Fields>, java.io.Serializable, Cloneable, Comparable<serverName_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("serverName_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField CLI_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cliException", 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 serverName_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new serverName_resultTupleSchemeFactory());
    }

    public String success; // required
    public CliThriftException cliException; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CLI_EXCEPTION((short)1, "cliException");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // CLI_EXCEPTION
            return CLI_EXCEPTION;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.CLI_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("cliException", 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(serverName_result.class, metaDataMap);
    }

    public serverName_result() {
    }

    public serverName_result(
      String success,
      CliThriftException cliException)
    {
      this();
      this.success = success;
      this.cliException = cliException;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public serverName_result(serverName_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetCliException()) {
        this.cliException = new CliThriftException(other.cliException);
      }
    }

    public serverName_result deepCopy() {
      return new serverName_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cliException = null;
    }

    public String getSuccess() {
      return this.success;
    }

    public serverName_result setSuccess(String success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CliThriftException getCliException() {
      return this.cliException;
    }

    public serverName_result setCliException(CliThriftException cliException) {
      this.cliException = cliException;
      return this;
    }

    public void unsetCliException() {
      this.cliException = null;
    }

    /** Returns true if field cliException is set (has been assigned a value) and false otherwise */
    public boolean isSetCliException() {
      return this.cliException != null;
    }

    public void setCliExceptionIsSet(boolean value) {
      if (!value) {
        this.cliException = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((String)value);
        }
        break;

      case CLI_EXCEPTION:
        if (value == null) {
          unsetCliException();
        } else {
          setCliException((CliThriftException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CLI_EXCEPTION:
        return getCliException();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CLI_EXCEPTION:
        return isSetCliException();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof serverName_result)
        return this.equals((serverName_result)that);
      return false;
    }

    public boolean equals(serverName_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cliException = true && this.isSetCliException();
      boolean that_present_cliException = true && that.isSetCliException();
      if (this_present_cliException || that_present_cliException) {
        if (!(this_present_cliException && that_present_cliException))
          return false;
        if (!this.cliException.equals(that.cliException))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_cliException = true && (isSetCliException());
      list.add(present_cliException);
      if (present_cliException)
        list.add(cliException);

      return list.hashCode();
    }

    @Override
    public int compareTo(serverName_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCliException()).compareTo(other.isSetCliException());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCliException()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cliException, other.cliException);
        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("serverName_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cliException:");
      if (this.cliException == null) {
        sb.append("null");
      } else {
        sb.append(this.cliException);
      }
      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 serverName_resultStandardSchemeFactory implements SchemeFactory {
      public serverName_resultStandardScheme getScheme() {
        return new serverName_resultStandardScheme();
      }
    }

    private static class serverName_resultStandardScheme extends StandardScheme<serverName_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, serverName_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.success = iprot.readString();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // CLI_EXCEPTION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cliException = new CliThriftException();
                struct.cliException.read(iprot);
                struct.setCliExceptionIsSet(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, serverName_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeString(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.cliException != null) {
          oprot.writeFieldBegin(CLI_EXCEPTION_FIELD_DESC);
          struct.cliException.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class serverName_resultTupleSchemeFactory implements SchemeFactory {
      public serverName_resultTupleScheme getScheme() {
        return new serverName_resultTupleScheme();
      }
    }

    private static class serverName_resultTupleScheme extends TupleScheme<serverName_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, serverName_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetCliException()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeString(struct.success);
        }
        if (struct.isSetCliException()) {
          struct.cliException.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, serverName_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = iprot.readString();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.cliException = new CliThriftException();
          struct.cliException.read(iprot);
          struct.setCliExceptionIsSet(true);
        }
      }
    }

  }

  public static class shutdown_args implements org.apache.thrift.TBase<shutdown_args, shutdown_args._Fields>, java.io.Serializable, Cloneable, Comparable<shutdown_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("shutdown_args");


    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new shutdown_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new shutdown_argsTupleSchemeFactory());
    }


    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
;

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }
    public static final Map<_Fields, 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);
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(shutdown_args.class, metaDataMap);
    }

    public shutdown_args() {
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public shutdown_args(shutdown_args other) {
    }

    public shutdown_args deepCopy() {
      return new shutdown_args(this);
    }

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof shutdown_args)
        return this.equals((shutdown_args)that);
      return false;
    }

    public boolean equals(shutdown_args that) {
      if (that == null)
        return false;

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      return list.hashCode();
    }

    @Override
    public int compareTo(shutdown_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      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("shutdown_args(");
      boolean first = true;

      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 shutdown_argsStandardSchemeFactory implements SchemeFactory {
      public shutdown_argsStandardScheme getScheme() {
        return new shutdown_argsStandardScheme();
      }
    }

    private static class shutdown_argsStandardScheme extends StandardScheme<shutdown_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, shutdown_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) {
            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, shutdown_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class shutdown_argsTupleSchemeFactory implements SchemeFactory {
      public shutdown_argsTupleScheme getScheme() {
        return new shutdown_argsTupleScheme();
      }
    }

    private static class shutdown_argsTupleScheme extends TupleScheme<shutdown_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, shutdown_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, shutdown_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
      }
    }

  }

  public static class shutdown_result implements org.apache.thrift.TBase<shutdown_result, shutdown_result._Fields>, java.io.Serializable, Cloneable, Comparable<shutdown_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("shutdown_result");

    private static final org.apache.thrift.protocol.TField CLI_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cliException", 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 shutdown_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new shutdown_resultTupleSchemeFactory());
    }

    public CliThriftException cliException; // 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 {
      CLI_EXCEPTION((short)1, "cliException");

      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: // CLI_EXCEPTION
            return CLI_EXCEPTION;
          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.CLI_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("cliException", 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(shutdown_result.class, metaDataMap);
    }

    public shutdown_result() {
    }

    public shutdown_result(
      CliThriftException cliException)
    {
      this();
      this.cliException = cliException;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public shutdown_result(shutdown_result other) {
      if (other.isSetCliException()) {
        this.cliException = new CliThriftException(other.cliException);
      }
    }

    public shutdown_result deepCopy() {
      return new shutdown_result(this);
    }

    @Override
    public void clear() {
      this.cliException = null;
    }

    public CliThriftException getCliException() {
      return this.cliException;
    }

    public shutdown_result setCliException(CliThriftException cliException) {
      this.cliException = cliException;
      return this;
    }

    public void unsetCliException() {
      this.cliException = null;
    }

    /** Returns true if field cliException is set (has been assigned a value) and false otherwise */
    public boolean isSetCliException() {
      return this.cliException != null;
    }

    public void setCliExceptionIsSet(boolean value) {
      if (!value) {
        this.cliException = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case CLI_EXCEPTION:
        if (value == null) {
          unsetCliException();
        } else {
          setCliException((CliThriftException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case CLI_EXCEPTION:
        return getCliException();

      }
      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 CLI_EXCEPTION:
        return isSetCliException();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof shutdown_result)
        return this.equals((shutdown_result)that);
      return false;
    }

    public boolean equals(shutdown_result that) {
      if (that == null)
        return false;

      boolean this_present_cliException = true && this.isSetCliException();
      boolean that_present_cliException = true && that.isSetCliException();
      if (this_present_cliException || that_present_cliException) {
        if (!(this_present_cliException && that_present_cliException))
          return false;
        if (!this.cliException.equals(that.cliException))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_cliException = true && (isSetCliException());
      list.add(present_cliException);
      if (present_cliException)
        list.add(cliException);

      return list.hashCode();
    }

    @Override
    public int compareTo(shutdown_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCliException()).compareTo(other.isSetCliException());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCliException()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cliException, other.cliException);
        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("shutdown_result(");
      boolean first = true;

      sb.append("cliException:");
      if (this.cliException == null) {
        sb.append("null");
      } else {
        sb.append(this.cliException);
      }
      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 shutdown_resultStandardSchemeFactory implements SchemeFactory {
      public shutdown_resultStandardScheme getScheme() {
        return new shutdown_resultStandardScheme();
      }
    }

    private static class shutdown_resultStandardScheme extends StandardScheme<shutdown_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, shutdown_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: // CLI_EXCEPTION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cliException = new CliThriftException();
                struct.cliException.read(iprot);
                struct.setCliExceptionIsSet(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, shutdown_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.cliException != null) {
          oprot.writeFieldBegin(CLI_EXCEPTION_FIELD_DESC);
          struct.cliException.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class shutdown_resultTupleSchemeFactory implements SchemeFactory {
      public shutdown_resultTupleScheme getScheme() {
        return new shutdown_resultTupleScheme();
      }
    }

    private static class shutdown_resultTupleScheme extends TupleScheme<shutdown_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, shutdown_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCliException()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCliException()) {
          struct.cliException.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, shutdown_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.cliException = new CliThriftException();
          struct.cliException.read(iprot);
          struct.setCliExceptionIsSet(true);
        }
      }
    }

  }

  public static class getMemoryUsage_args implements org.apache.thrift.TBase<getMemoryUsage_args, getMemoryUsage_args._Fields>, java.io.Serializable, Cloneable, Comparable<getMemoryUsage_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMemoryUsage_args");

    private static final org.apache.thrift.protocol.TField FORCE_GC_FIELD_DESC = new org.apache.thrift.protocol.TField("forceGC", org.apache.thrift.protocol.TType.BOOL, (short)1);

    private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
    static {
      schemes.put(StandardScheme.class, new getMemoryUsage_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getMemoryUsage_argsTupleSchemeFactory());
    }

    public boolean forceGC; // 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 {
      FORCE_GC((short)1, "forceGC");

      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: // FORCE_GC
            return FORCE_GC;
          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 __FORCEGC_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.FORCE_GC, new org.apache.thrift.meta_data.FieldMetaData("forceGC", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      metaDataMap = Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMemoryUsage_args.class, metaDataMap);
    }

    public getMemoryUsage_args() {
    }

    public getMemoryUsage_args(
      boolean forceGC)
    {
      this();
      this.forceGC = forceGC;
      setForceGCIsSet(true);
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMemoryUsage_args(getMemoryUsage_args other) {
      __isset_bitfield = other.__isset_bitfield;
      this.forceGC = other.forceGC;
    }

    public getMemoryUsage_args deepCopy() {
      return new getMemoryUsage_args(this);
    }

    @Override
    public void clear() {
      setForceGCIsSet(false);
      this.forceGC = false;
    }

    public boolean isForceGC() {
      return this.forceGC;
    }

    public getMemoryUsage_args setForceGC(boolean forceGC) {
      this.forceGC = forceGC;
      setForceGCIsSet(true);
      return this;
    }

    public void unsetForceGC() {
      __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FORCEGC_ISSET_ID);
    }

    /** Returns true if field forceGC is set (has been assigned a value) and false otherwise */
    public boolean isSetForceGC() {
      return EncodingUtils.testBit(__isset_bitfield, __FORCEGC_ISSET_ID);
    }

    public void setForceGCIsSet(boolean value) {
      __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FORCEGC_ISSET_ID, value);
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case FORCE_GC:
        if (value == null) {
          unsetForceGC();
        } else {
          setForceGC((Boolean)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case FORCE_GC:
        return Boolean.valueOf(isForceGC());

      }
      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 FORCE_GC:
        return isSetForceGC();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMemoryUsage_args)
        return this.equals((getMemoryUsage_args)that);
      return false;
    }

    public boolean equals(getMemoryUsage_args that) {
      if (that == null)
        return false;

      boolean this_present_forceGC = true;
      boolean that_present_forceGC = true;
      if (this_present_forceGC || that_present_forceGC) {
        if (!(this_present_forceGC && that_present_forceGC))
          return false;
        if (this.forceGC != that.forceGC)
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_forceGC = true;
      list.add(present_forceGC);
      if (present_forceGC)
        list.add(forceGC);

      return list.hashCode();
    }

    @Override
    public int compareTo(getMemoryUsage_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetForceGC()).compareTo(other.isSetForceGC());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetForceGC()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.forceGC, other.forceGC);
        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("getMemoryUsage_args(");
      boolean first = true;

      sb.append("forceGC:");
      sb.append(this.forceGC);
      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 getMemoryUsage_argsStandardSchemeFactory implements SchemeFactory {
      public getMemoryUsage_argsStandardScheme getScheme() {
        return new getMemoryUsage_argsStandardScheme();
      }
    }

    private static class getMemoryUsage_argsStandardScheme extends StandardScheme<getMemoryUsage_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getMemoryUsage_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: // FORCE_GC
              if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                struct.forceGC = iprot.readBool();
                struct.setForceGCIsSet(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, getMemoryUsage_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        oprot.writeFieldBegin(FORCE_GC_FIELD_DESC);
        oprot.writeBool(struct.forceGC);
        oprot.writeFieldEnd();
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getMemoryUsage_argsTupleSchemeFactory implements SchemeFactory {
      public getMemoryUsage_argsTupleScheme getScheme() {
        return new getMemoryUsage_argsTupleScheme();
      }
    }

    private static class getMemoryUsage_argsTupleScheme extends TupleScheme<getMemoryUsage_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getMemoryUsage_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetForceGC()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetForceGC()) {
          oprot.writeBool(struct.forceGC);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getMemoryUsage_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.forceGC = iprot.readBool();
          struct.setForceGCIsSet(true);
        }
      }
    }

  }

  public static class getMemoryUsage_result implements org.apache.thrift.TBase<getMemoryUsage_result, getMemoryUsage_result._Fields>, java.io.Serializable, Cloneable, Comparable<getMemoryUsage_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMemoryUsage_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField CLI_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cliException", 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 getMemoryUsage_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new getMemoryUsage_resultTupleSchemeFactory());
    }

    public MemoryUsage success; // required
    public CliThriftException cliException; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CLI_EXCEPTION((short)1, "cliException");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // CLI_EXCEPTION
            return CLI_EXCEPTION;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, MemoryUsage.class)));
      tmpMap.put(_Fields.CLI_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("cliException", 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(getMemoryUsage_result.class, metaDataMap);
    }

    public getMemoryUsage_result() {
    }

    public getMemoryUsage_result(
      MemoryUsage success,
      CliThriftException cliException)
    {
      this();
      this.success = success;
      this.cliException = cliException;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public getMemoryUsage_result(getMemoryUsage_result other) {
      if (other.isSetSuccess()) {
        this.success = new MemoryUsage(other.success);
      }
      if (other.isSetCliException()) {
        this.cliException = new CliThriftException(other.cliException);
      }
    }

    public getMemoryUsage_result deepCopy() {
      return new getMemoryUsage_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cliException = null;
    }

    public MemoryUsage getSuccess() {
      return this.success;
    }

    public getMemoryUsage_result setSuccess(MemoryUsage success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CliThriftException getCliException() {
      return this.cliException;
    }

    public getMemoryUsage_result setCliException(CliThriftException cliException) {
      this.cliException = cliException;
      return this;
    }

    public void unsetCliException() {
      this.cliException = null;
    }

    /** Returns true if field cliException is set (has been assigned a value) and false otherwise */
    public boolean isSetCliException() {
      return this.cliException != null;
    }

    public void setCliExceptionIsSet(boolean value) {
      if (!value) {
        this.cliException = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((MemoryUsage)value);
        }
        break;

      case CLI_EXCEPTION:
        if (value == null) {
          unsetCliException();
        } else {
          setCliException((CliThriftException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CLI_EXCEPTION:
        return getCliException();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CLI_EXCEPTION:
        return isSetCliException();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof getMemoryUsage_result)
        return this.equals((getMemoryUsage_result)that);
      return false;
    }

    public boolean equals(getMemoryUsage_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cliException = true && this.isSetCliException();
      boolean that_present_cliException = true && that.isSetCliException();
      if (this_present_cliException || that_present_cliException) {
        if (!(this_present_cliException && that_present_cliException))
          return false;
        if (!this.cliException.equals(that.cliException))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_cliException = true && (isSetCliException());
      list.add(present_cliException);
      if (present_cliException)
        list.add(cliException);

      return list.hashCode();
    }

    @Override
    public int compareTo(getMemoryUsage_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCliException()).compareTo(other.isSetCliException());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCliException()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cliException, other.cliException);
        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("getMemoryUsage_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cliException:");
      if (this.cliException == null) {
        sb.append("null");
      } else {
        sb.append(this.cliException);
      }
      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 (success != null) {
        success.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 getMemoryUsage_resultStandardSchemeFactory implements SchemeFactory {
      public getMemoryUsage_resultStandardScheme getScheme() {
        return new getMemoryUsage_resultStandardScheme();
      }
    }

    private static class getMemoryUsage_resultStandardScheme extends StandardScheme<getMemoryUsage_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, getMemoryUsage_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new MemoryUsage();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // CLI_EXCEPTION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cliException = new CliThriftException();
                struct.cliException.read(iprot);
                struct.setCliExceptionIsSet(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, getMemoryUsage_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.cliException != null) {
          oprot.writeFieldBegin(CLI_EXCEPTION_FIELD_DESC);
          struct.cliException.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class getMemoryUsage_resultTupleSchemeFactory implements SchemeFactory {
      public getMemoryUsage_resultTupleScheme getScheme() {
        return new getMemoryUsage_resultTupleScheme();
      }
    }

    private static class getMemoryUsage_resultTupleScheme extends TupleScheme<getMemoryUsage_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, getMemoryUsage_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetCliException()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetCliException()) {
          struct.cliException.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, getMemoryUsage_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new MemoryUsage();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.cliException = new CliThriftException();
          struct.cliException.read(iprot);
          struct.setCliExceptionIsSet(true);
        }
      }
    }

  }

  public static class executeCommand_args implements org.apache.thrift.TBase<executeCommand_args, executeCommand_args._Fields>, java.io.Serializable, Cloneable, Comparable<executeCommand_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeCommand_args");

    private static final org.apache.thrift.protocol.TField COMMAND_LINE_FIELD_DESC = new org.apache.thrift.protocol.TField("commandLine", 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 executeCommand_argsStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeCommand_argsTupleSchemeFactory());
    }

    public String commandLine; // 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 {
      COMMAND_LINE((short)1, "commandLine");

      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: // COMMAND_LINE
            return COMMAND_LINE;
          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.COMMAND_LINE, new org.apache.thrift.meta_data.FieldMetaData("commandLine", 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(executeCommand_args.class, metaDataMap);
    }

    public executeCommand_args() {
    }

    public executeCommand_args(
      String commandLine)
    {
      this();
      this.commandLine = commandLine;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public executeCommand_args(executeCommand_args other) {
      if (other.isSetCommandLine()) {
        this.commandLine = other.commandLine;
      }
    }

    public executeCommand_args deepCopy() {
      return new executeCommand_args(this);
    }

    @Override
    public void clear() {
      this.commandLine = null;
    }

    public String getCommandLine() {
      return this.commandLine;
    }

    public executeCommand_args setCommandLine(String commandLine) {
      this.commandLine = commandLine;
      return this;
    }

    public void unsetCommandLine() {
      this.commandLine = null;
    }

    /** Returns true if field commandLine is set (has been assigned a value) and false otherwise */
    public boolean isSetCommandLine() {
      return this.commandLine != null;
    }

    public void setCommandLineIsSet(boolean value) {
      if (!value) {
        this.commandLine = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case COMMAND_LINE:
        if (value == null) {
          unsetCommandLine();
        } else {
          setCommandLine((String)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case COMMAND_LINE:
        return getCommandLine();

      }
      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 COMMAND_LINE:
        return isSetCommandLine();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeCommand_args)
        return this.equals((executeCommand_args)that);
      return false;
    }

    public boolean equals(executeCommand_args that) {
      if (that == null)
        return false;

      boolean this_present_commandLine = true && this.isSetCommandLine();
      boolean that_present_commandLine = true && that.isSetCommandLine();
      if (this_present_commandLine || that_present_commandLine) {
        if (!(this_present_commandLine && that_present_commandLine))
          return false;
        if (!this.commandLine.equals(that.commandLine))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_commandLine = true && (isSetCommandLine());
      list.add(present_commandLine);
      if (present_commandLine)
        list.add(commandLine);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeCommand_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetCommandLine()).compareTo(other.isSetCommandLine());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCommandLine()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandLine, other.commandLine);
        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("executeCommand_args(");
      boolean first = true;

      sb.append("commandLine:");
      if (this.commandLine == null) {
        sb.append("null");
      } else {
        sb.append(this.commandLine);
      }
      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 executeCommand_argsStandardSchemeFactory implements SchemeFactory {
      public executeCommand_argsStandardScheme getScheme() {
        return new executeCommand_argsStandardScheme();
      }
    }

    private static class executeCommand_argsStandardScheme extends StandardScheme<executeCommand_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeCommand_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: // COMMAND_LINE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.commandLine = iprot.readString();
                struct.setCommandLineIsSet(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, executeCommand_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.commandLine != null) {
          oprot.writeFieldBegin(COMMAND_LINE_FIELD_DESC);
          oprot.writeString(struct.commandLine);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeCommand_argsTupleSchemeFactory implements SchemeFactory {
      public executeCommand_argsTupleScheme getScheme() {
        return new executeCommand_argsTupleScheme();
      }
    }

    private static class executeCommand_argsTupleScheme extends TupleScheme<executeCommand_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeCommand_args struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetCommandLine()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetCommandLine()) {
          oprot.writeString(struct.commandLine);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeCommand_args struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.commandLine = iprot.readString();
          struct.setCommandLineIsSet(true);
        }
      }
    }

  }

  public static class executeCommand_result implements org.apache.thrift.TBase<executeCommand_result, executeCommand_result._Fields>, java.io.Serializable, Cloneable, Comparable<executeCommand_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("executeCommand_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0);
    private static final org.apache.thrift.protocol.TField CLI_EXCEPTION_FIELD_DESC = new org.apache.thrift.protocol.TField("cliException", 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 executeCommand_resultStandardSchemeFactory());
      schemes.put(TupleScheme.class, new executeCommand_resultTupleSchemeFactory());
    }

    public CommandResult success; // required
    public CliThriftException cliException; // required

    /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
    public enum _Fields implements org.apache.thrift.TFieldIdEnum {
      SUCCESS((short)0, "success"),
      CLI_EXCEPTION((short)1, "cliException");

      private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();

      static {
        for (_Fields field : EnumSet.allOf(_Fields.class)) {
          byName.put(field.getFieldName(), field);
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, or null if its not found.
       */
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // CLI_EXCEPTION
            return CLI_EXCEPTION;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
        return fields;
      }

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      public static _Fields findByName(String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final String _fieldName;

      _Fields(short thriftId, String fieldName) {
        _thriftId = thriftId;
        _fieldName = fieldName;
      }

      public short getThriftFieldId() {
        return _thriftId;
      }

      public String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CommandResult.class)));
      tmpMap.put(_Fields.CLI_EXCEPTION, new org.apache.thrift.meta_data.FieldMetaData("cliException", 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(executeCommand_result.class, metaDataMap);
    }

    public executeCommand_result() {
    }

    public executeCommand_result(
      CommandResult success,
      CliThriftException cliException)
    {
      this();
      this.success = success;
      this.cliException = cliException;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public executeCommand_result(executeCommand_result other) {
      if (other.isSetSuccess()) {
        this.success = new CommandResult(other.success);
      }
      if (other.isSetCliException()) {
        this.cliException = new CliThriftException(other.cliException);
      }
    }

    public executeCommand_result deepCopy() {
      return new executeCommand_result(this);
    }

    @Override
    public void clear() {
      this.success = null;
      this.cliException = null;
    }

    public CommandResult getSuccess() {
      return this.success;
    }

    public executeCommand_result setSuccess(CommandResult success) {
      this.success = success;
      return this;
    }

    public void unsetSuccess() {
      this.success = null;
    }

    /** Returns true if field success is set (has been assigned a value) and false otherwise */
    public boolean isSetSuccess() {
      return this.success != null;
    }

    public void setSuccessIsSet(boolean value) {
      if (!value) {
        this.success = null;
      }
    }

    public CliThriftException getCliException() {
      return this.cliException;
    }

    public executeCommand_result setCliException(CliThriftException cliException) {
      this.cliException = cliException;
      return this;
    }

    public void unsetCliException() {
      this.cliException = null;
    }

    /** Returns true if field cliException is set (has been assigned a value) and false otherwise */
    public boolean isSetCliException() {
      return this.cliException != null;
    }

    public void setCliExceptionIsSet(boolean value) {
      if (!value) {
        this.cliException = null;
      }
    }

    public void setFieldValue(_Fields field, Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((CommandResult)value);
        }
        break;

      case CLI_EXCEPTION:
        if (value == null) {
          unsetCliException();
        } else {
          setCliException((CliThriftException)value);
        }
        break;

      }
    }

    public Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case CLI_EXCEPTION:
        return getCliException();

      }
      throw new IllegalStateException();
    }

    /** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
    public boolean isSet(_Fields field) {
      if (field == null) {
        throw new IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      case CLI_EXCEPTION:
        return isSetCliException();
      }
      throw new IllegalStateException();
    }

    @Override
    public boolean equals(Object that) {
      if (that == null)
        return false;
      if (that instanceof executeCommand_result)
        return this.equals((executeCommand_result)that);
      return false;
    }

    public boolean equals(executeCommand_result that) {
      if (that == null)
        return false;

      boolean this_present_success = true && this.isSetSuccess();
      boolean that_present_success = true && that.isSetSuccess();
      if (this_present_success || that_present_success) {
        if (!(this_present_success && that_present_success))
          return false;
        if (!this.success.equals(that.success))
          return false;
      }

      boolean this_present_cliException = true && this.isSetCliException();
      boolean that_present_cliException = true && that.isSetCliException();
      if (this_present_cliException || that_present_cliException) {
        if (!(this_present_cliException && that_present_cliException))
          return false;
        if (!this.cliException.equals(that.cliException))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      List<Object> list = new ArrayList<Object>();

      boolean present_success = true && (isSetSuccess());
      list.add(present_success);
      if (present_success)
        list.add(success);

      boolean present_cliException = true && (isSetCliException());
      list.add(present_cliException);
      if (present_cliException)
        list.add(cliException);

      return list.hashCode();
    }

    @Override
    public int compareTo(executeCommand_result other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = Boolean.valueOf(isSetCliException()).compareTo(other.isSetCliException());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetCliException()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.cliException, other.cliException);
        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("executeCommand_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("cliException:");
      if (this.cliException == null) {
        sb.append("null");
      } else {
        sb.append(this.cliException);
      }
      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 (success != null) {
        success.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 executeCommand_resultStandardSchemeFactory implements SchemeFactory {
      public executeCommand_resultStandardScheme getScheme() {
        return new executeCommand_resultStandardScheme();
      }
    }

    private static class executeCommand_resultStandardScheme extends StandardScheme<executeCommand_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, executeCommand_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.success = new CommandResult();
                struct.success.read(iprot);
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // CLI_EXCEPTION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.cliException = new CliThriftException();
                struct.cliException.read(iprot);
                struct.setCliExceptionIsSet(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, executeCommand_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          struct.success.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.cliException != null) {
          oprot.writeFieldBegin(CLI_EXCEPTION_FIELD_DESC);
          struct.cliException.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class executeCommand_resultTupleSchemeFactory implements SchemeFactory {
      public executeCommand_resultTupleScheme getScheme() {
        return new executeCommand_resultTupleScheme();
      }
    }

    private static class executeCommand_resultTupleScheme extends TupleScheme<executeCommand_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, executeCommand_result struct) throws org.apache.thrift.TException {
        TTupleProtocol oprot = (TTupleProtocol) prot;
        BitSet optionals = new BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        if (struct.isSetCliException()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          struct.success.write(oprot);
        }
        if (struct.isSetCliException()) {
          struct.cliException.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, executeCommand_result struct) throws org.apache.thrift.TException {
        TTupleProtocol iprot = (TTupleProtocol) prot;
        BitSet incoming = iprot.readBitSet(2);
        if (incoming.get(0)) {
          struct.success = new CommandResult();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.cliException = new CliThriftException();
          struct.cliException.read(iprot);
          struct.setCliExceptionIsSet(true);
        }
      }
    }

  }

}
