All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cicada.authorization.config.UserSessionService Maven / Gradle / Ivy

There is a newer version: 1.0.6.6
Show newest version
/**
 * Autogenerated by Thrift Compiler (0.10.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package cicada.authorization.config;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.10.0)", date = "2017-05-27")
public class UserSessionService {

  public interface Iface {

    public CreateSessionRet CreateSession(java.lang.String userId, int userType, java.lang.String loginFrom) throws org.apache.thrift.TException;

    public GetUserIdRet GetUserId(java.lang.String sessionId) throws org.apache.thrift.TException;

    public RemoveSessionStatus RemoveSession(java.lang.String sessionId) throws org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void CreateSession(java.lang.String userId, int userType, java.lang.String loginFrom, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void GetUserId(java.lang.String sessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;

    public void RemoveSession(java.lang.String sessionId, 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 {
      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 CreateSessionRet CreateSession(java.lang.String userId, int userType, java.lang.String loginFrom) throws org.apache.thrift.TException
    {
      send_CreateSession(userId, userType, loginFrom);
      return recv_CreateSession();
    }

    public void send_CreateSession(java.lang.String userId, int userType, java.lang.String loginFrom) throws org.apache.thrift.TException
    {
      CreateSession_args args = new CreateSession_args();
      args.setUserId(userId);
      args.setUserType(userType);
      args.setLoginFrom(loginFrom);
      sendBase("CreateSession", args);
    }

    public CreateSessionRet recv_CreateSession() throws org.apache.thrift.TException
    {
      CreateSession_result result = new CreateSession_result();
      receiveBase(result, "CreateSession");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "CreateSession failed: unknown result");
    }

    public GetUserIdRet GetUserId(java.lang.String sessionId) throws org.apache.thrift.TException
    {
      send_GetUserId(sessionId);
      return recv_GetUserId();
    }

    public void send_GetUserId(java.lang.String sessionId) throws org.apache.thrift.TException
    {
      GetUserId_args args = new GetUserId_args();
      args.setSessionId(sessionId);
      sendBase("GetUserId", args);
    }

    public GetUserIdRet recv_GetUserId() throws org.apache.thrift.TException
    {
      GetUserId_result result = new GetUserId_result();
      receiveBase(result, "GetUserId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "GetUserId failed: unknown result");
    }

    public RemoveSessionStatus RemoveSession(java.lang.String sessionId) throws org.apache.thrift.TException
    {
      send_RemoveSession(sessionId);
      return recv_RemoveSession();
    }

    public void send_RemoveSession(java.lang.String sessionId) throws org.apache.thrift.TException
    {
      RemoveSession_args args = new RemoveSession_args();
      args.setSessionId(sessionId);
      sendBase("RemoveSession", args);
    }

    public RemoveSessionStatus recv_RemoveSession() throws org.apache.thrift.TException
    {
      RemoveSession_result result = new RemoveSession_result();
      receiveBase(result, "RemoveSession");
      if (result.isSetSuccess()) {
        return result.success;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "RemoveSession 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 {
      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 CreateSession(java.lang.String userId, int userType, java.lang.String loginFrom, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      CreateSession_call method_call = new CreateSession_call(userId, userType, loginFrom, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class CreateSession_call extends org.apache.thrift.async.TAsyncMethodCall {
      private java.lang.String userId;
      private int userType;
      private java.lang.String loginFrom;
      public CreateSession_call(java.lang.String userId, int userType, java.lang.String loginFrom, 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.userId = userId;
        this.userType = userType;
        this.loginFrom = loginFrom;
      }

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("CreateSession", org.apache.thrift.protocol.TMessageType.CALL, 0));
        CreateSession_args args = new CreateSession_args();
        args.setUserId(userId);
        args.setUserType(userType);
        args.setLoginFrom(loginFrom);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public CreateSessionRet getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.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_CreateSession();
      }
    }

    public void GetUserId(java.lang.String sessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      GetUserId_call method_call = new GetUserId_call(sessionId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class GetUserId_call extends org.apache.thrift.async.TAsyncMethodCall {
      private java.lang.String sessionId;
      public GetUserId_call(java.lang.String sessionId, 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.sessionId = sessionId;
      }

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

      public GetUserIdRet getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.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_GetUserId();
      }
    }

    public void RemoveSession(java.lang.String sessionId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
      checkReady();
      RemoveSession_call method_call = new RemoveSession_call(sessionId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class RemoveSession_call extends org.apache.thrift.async.TAsyncMethodCall {
      private java.lang.String sessionId;
      public RemoveSession_call(java.lang.String sessionId, 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.sessionId = sessionId;
      }

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

      public RemoveSessionStatus getResult() throws org.apache.thrift.TException {
        if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
          throw new java.lang.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_RemoveSession();
      }
    }

  }

  public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor {
    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(Processor.class.getName());
    public Processor(I iface) {
      super(iface, getProcessMap(new java.util.HashMap>()));
    }

    protected Processor(I iface, java.util.Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  java.util.Map> getProcessMap(java.util.Map> processMap) {
      processMap.put("CreateSession", new CreateSession());
      processMap.put("GetUserId", new GetUserId());
      processMap.put("RemoveSession", new RemoveSession());
      return processMap;
    }

    public static class CreateSession extends org.apache.thrift.ProcessFunction {
      public CreateSession() {
        super("CreateSession");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public CreateSession_result getResult(I iface, CreateSession_args args) throws org.apache.thrift.TException {
        CreateSession_result result = new CreateSession_result();
        result.success = iface.CreateSession(args.userId, args.userType, args.loginFrom);
        return result;
      }
    }

    public static class GetUserId extends org.apache.thrift.ProcessFunction {
      public GetUserId() {
        super("GetUserId");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public GetUserId_result getResult(I iface, GetUserId_args args) throws org.apache.thrift.TException {
        GetUserId_result result = new GetUserId_result();
        result.success = iface.GetUserId(args.sessionId);
        return result;
      }
    }

    public static class RemoveSession extends org.apache.thrift.ProcessFunction {
      public RemoveSession() {
        super("RemoveSession");
      }

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

      protected boolean isOneway() {
        return false;
      }

      public RemoveSession_result getResult(I iface, RemoveSession_args args) throws org.apache.thrift.TException {
        RemoveSession_result result = new RemoveSession_result();
        result.success = iface.RemoveSession(args.sessionId);
        return result;
      }
    }

  }

  public static class AsyncProcessor extends org.apache.thrift.TBaseAsyncProcessor {
    private static final org.slf4j.Logger _LOGGER = org.slf4j.LoggerFactory.getLogger(AsyncProcessor.class.getName());
    public AsyncProcessor(I iface) {
      super(iface, getProcessMap(new java.util.HashMap>()));
    }

    protected AsyncProcessor(I iface, java.util.Map> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static  java.util.Map> getProcessMap(java.util.Map> processMap) {
      processMap.put("CreateSession", new CreateSession());
      processMap.put("GetUserId", new GetUserId());
      processMap.put("RemoveSession", new RemoveSession());
      return processMap;
    }

    public static class CreateSession extends org.apache.thrift.AsyncProcessFunction {
      public CreateSession() {
        super("CreateSession");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(CreateSessionRet o) {
            CreateSession_result result = new CreateSession_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            CreateSession_result result = new CreateSession_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, CreateSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.CreateSession(args.userId, args.userType, args.loginFrom,resultHandler);
      }
    }

    public static class GetUserId extends org.apache.thrift.AsyncProcessFunction {
      public GetUserId() {
        super("GetUserId");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(GetUserIdRet o) {
            GetUserId_result result = new GetUserId_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            GetUserId_result result = new GetUserId_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, GetUserId_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.GetUserId(args.sessionId,resultHandler);
      }
    }

    public static class RemoveSession extends org.apache.thrift.AsyncProcessFunction {
      public RemoveSession() {
        super("RemoveSession");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback getResultHandler(final org.apache.thrift.server.AbstractNonblockingServer.AsyncFrameBuffer fb, final int seqid) {
        final org.apache.thrift.AsyncProcessFunction fcall = this;
        return new org.apache.thrift.async.AsyncMethodCallback() { 
          public void onComplete(RemoveSessionStatus o) {
            RemoveSession_result result = new RemoveSession_result();
            result.success = o;
            try {
              fcall.sendResponse(fb, result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
            } catch (org.apache.thrift.transport.TTransportException e) {
              _LOGGER.error("TTransportException writing to internal frame buffer", e);
              fb.close();
            } catch (java.lang.Exception e) {
              _LOGGER.error("Exception writing to internal frame buffer", e);
              onError(e);
            }
          }
          public void onError(java.lang.Exception e) {
            byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
            org.apache.thrift.TSerializable msg;
            RemoveSession_result result = new RemoveSession_result();
            if (e instanceof org.apache.thrift.transport.TTransportException) {
              _LOGGER.error("TTransportException inside handler", e);
              fb.close();
              return;
            } else if (e instanceof org.apache.thrift.TApplicationException) {
              _LOGGER.error("TApplicationException inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = (org.apache.thrift.TApplicationException)e;
            } else {
              _LOGGER.error("Exception inside handler", e);
              msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
              msg = new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
            }
            try {
              fcall.sendResponse(fb,msg,msgType,seqid);
            } catch (java.lang.Exception ex) {
              _LOGGER.error("Exception writing to internal frame buffer", ex);
              fb.close();
            }
          }
        };
      }

      protected boolean isOneway() {
        return false;
      }

      public void start(I iface, RemoveSession_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
        iface.RemoveSession(args.sessionId,resultHandler);
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField USER_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("userType", org.apache.thrift.protocol.TType.I32, (short)2);
    private static final org.apache.thrift.protocol.TField LOGIN_FROM_FIELD_DESC = new org.apache.thrift.protocol.TField("loginFrom", org.apache.thrift.protocol.TType.STRING, (short)3);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CreateSession_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CreateSession_argsTupleSchemeFactory();

    public java.lang.String userId; // required
    public int userType; // required
    public java.lang.String loginFrom; // 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 {
      USER_ID((short)1, "userId"),
      USER_TYPE((short)2, "userType"),
      LOGIN_FROM((short)3, "loginFrom");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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: // USER_ID
            return USER_ID;
          case 2: // USER_TYPE
            return USER_TYPE;
          case 3: // LOGIN_FROM
            return LOGIN_FROM;
          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 java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    private static final int __USERTYPE_ISSET_ID = 0;
    private byte __isset_bitfield = 0;
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.USER_TYPE, new org.apache.thrift.meta_data.FieldMetaData("userType", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)));
      tmpMap.put(_Fields.LOGIN_FROM, new org.apache.thrift.meta_data.FieldMetaData("loginFrom", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreateSession_args.class, metaDataMap);
    }

    public CreateSession_args() {
    }

    public CreateSession_args(
      java.lang.String userId,
      int userType,
      java.lang.String loginFrom)
    {
      this();
      this.userId = userId;
      this.userType = userType;
      setUserTypeIsSet(true);
      this.loginFrom = loginFrom;
    }

    /**
     * Performs a deep copy on other.
     */
    public CreateSession_args(CreateSession_args other) {
      __isset_bitfield = other.__isset_bitfield;
      if (other.isSetUserId()) {
        this.userId = other.userId;
      }
      this.userType = other.userType;
      if (other.isSetLoginFrom()) {
        this.loginFrom = other.loginFrom;
      }
    }

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

    @Override
    public void clear() {
      this.userId = null;
      setUserTypeIsSet(false);
      this.userType = 0;
      this.loginFrom = null;
    }

    public java.lang.String getUserId() {
      return this.userId;
    }

    public CreateSession_args setUserId(java.lang.String userId) {
      this.userId = userId;
      return this;
    }

    public void unsetUserId() {
      this.userId = null;
    }

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

    public void setUserIdIsSet(boolean value) {
      if (!value) {
        this.userId = null;
      }
    }

    public int getUserType() {
      return this.userType;
    }

    public CreateSession_args setUserType(int userType) {
      this.userType = userType;
      setUserTypeIsSet(true);
      return this;
    }

    public void unsetUserType() {
      __isset_bitfield = org.apache.thrift.EncodingUtils.clearBit(__isset_bitfield, __USERTYPE_ISSET_ID);
    }

    /** Returns true if field userType is set (has been assigned a value) and false otherwise */
    public boolean isSetUserType() {
      return org.apache.thrift.EncodingUtils.testBit(__isset_bitfield, __USERTYPE_ISSET_ID);
    }

    public void setUserTypeIsSet(boolean value) {
      __isset_bitfield = org.apache.thrift.EncodingUtils.setBit(__isset_bitfield, __USERTYPE_ISSET_ID, value);
    }

    public java.lang.String getLoginFrom() {
      return this.loginFrom;
    }

    public CreateSession_args setLoginFrom(java.lang.String loginFrom) {
      this.loginFrom = loginFrom;
      return this;
    }

    public void unsetLoginFrom() {
      this.loginFrom = null;
    }

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

    public void setLoginFromIsSet(boolean value) {
      if (!value) {
        this.loginFrom = null;
      }
    }

    public void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case USER_ID:
        if (value == null) {
          unsetUserId();
        } else {
          setUserId((java.lang.String)value);
        }
        break;

      case USER_TYPE:
        if (value == null) {
          unsetUserType();
        } else {
          setUserType((java.lang.Integer)value);
        }
        break;

      case LOGIN_FROM:
        if (value == null) {
          unsetLoginFrom();
        } else {
          setLoginFrom((java.lang.String)value);
        }
        break;

      }
    }

    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_ID:
        return getUserId();

      case USER_TYPE:
        return getUserType();

      case LOGIN_FROM:
        return getLoginFrom();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case USER_ID:
        return isSetUserId();
      case USER_TYPE:
        return isSetUserType();
      case LOGIN_FROM:
        return isSetLoginFrom();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(CreateSession_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_userId = true && this.isSetUserId();
      boolean that_present_userId = true && that.isSetUserId();
      if (this_present_userId || that_present_userId) {
        if (!(this_present_userId && that_present_userId))
          return false;
        if (!this.userId.equals(that.userId))
          return false;
      }

      boolean this_present_userType = true;
      boolean that_present_userType = true;
      if (this_present_userType || that_present_userType) {
        if (!(this_present_userType && that_present_userType))
          return false;
        if (this.userType != that.userType)
          return false;
      }

      boolean this_present_loginFrom = true && this.isSetLoginFrom();
      boolean that_present_loginFrom = true && that.isSetLoginFrom();
      if (this_present_loginFrom || that_present_loginFrom) {
        if (!(this_present_loginFrom && that_present_loginFrom))
          return false;
        if (!this.loginFrom.equals(that.loginFrom))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetUserId()) ? 131071 : 524287);
      if (isSetUserId())
        hashCode = hashCode * 8191 + userId.hashCode();

      hashCode = hashCode * 8191 + userType;

      hashCode = hashCode * 8191 + ((isSetLoginFrom()) ? 131071 : 524287);
      if (isSetLoginFrom())
        hashCode = hashCode * 8191 + loginFrom.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.valueOf(isSetUserId()).compareTo(other.isSetUserId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userId, other.userId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.valueOf(isSetUserType()).compareTo(other.isSetUserType());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserType()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userType, other.userType);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.valueOf(isSetLoginFrom()).compareTo(other.isSetLoginFrom());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetLoginFrom()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.loginFrom, other.loginFrom);
        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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
    }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("CreateSession_args(");
      boolean first = true;

      sb.append("userId:");
      if (this.userId == null) {
        sb.append("null");
      } else {
        sb.append(this.userId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("userType:");
      sb.append(this.userType);
      first = false;
      if (!first) sb.append(", ");
      sb.append("loginFrom:");
      if (this.loginFrom == null) {
        sb.append("null");
      } else {
        sb.append(this.loginFrom);
      }
      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, java.lang.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 CreateSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public CreateSession_argsStandardScheme getScheme() {
        return new CreateSession_argsStandardScheme();
      }
    }

    private static class CreateSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, CreateSession_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: // USER_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.userId = iprot.readString();
                struct.setUserIdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // USER_TYPE
              if (schemeField.type == org.apache.thrift.protocol.TType.I32) {
                struct.userType = iprot.readI32();
                struct.setUserTypeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // LOGIN_FROM
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.loginFrom = iprot.readString();
                struct.setLoginFromIsSet(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, CreateSession_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.userId != null) {
          oprot.writeFieldBegin(USER_ID_FIELD_DESC);
          oprot.writeString(struct.userId);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldBegin(USER_TYPE_FIELD_DESC);
        oprot.writeI32(struct.userType);
        oprot.writeFieldEnd();
        if (struct.loginFrom != null) {
          oprot.writeFieldBegin(LOGIN_FROM_FIELD_DESC);
          oprot.writeString(struct.loginFrom);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class CreateSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public CreateSession_argsTupleScheme getScheme() {
        return new CreateSession_argsTupleScheme();
      }
    }

    private static class CreateSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, CreateSession_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetUserId()) {
          optionals.set(0);
        }
        if (struct.isSetUserType()) {
          optionals.set(1);
        }
        if (struct.isSetLoginFrom()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetUserId()) {
          oprot.writeString(struct.userId);
        }
        if (struct.isSetUserType()) {
          oprot.writeI32(struct.userType);
        }
        if (struct.isSetLoginFrom()) {
          oprot.writeString(struct.loginFrom);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, CreateSession_args struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(3);
        if (incoming.get(0)) {
          struct.userId = iprot.readString();
          struct.setUserIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.userType = iprot.readI32();
          struct.setUserTypeIsSet(true);
        }
        if (incoming.get(2)) {
          struct.loginFrom = iprot.readString();
          struct.setLoginFromIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class CreateSession_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("CreateSession_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new CreateSession_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new CreateSession_resultTupleSchemeFactory();

    public CreateSessionRet success; // 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");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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;
          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 java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRUCT          , "CreateSessionRet")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(CreateSession_result.class, metaDataMap);
    }

    public CreateSession_result() {
    }

    public CreateSession_result(
      CreateSessionRet success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public CreateSession_result(CreateSession_result other) {
      if (other.isSetSuccess()) {
        this.success = new CreateSessionRet(other.success);
      }
    }

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

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

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

    public CreateSession_result setSuccess(CreateSessionRet 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 void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((CreateSessionRet)value);
        }
        break;

      }
    }

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

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(CreateSession_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.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;
        }
      }
      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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
      }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("CreateSession_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      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, java.lang.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 CreateSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public CreateSession_resultStandardScheme getScheme() {
        return new CreateSession_resultStandardScheme();
      }
    }

    private static class CreateSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, CreateSession_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 CreateSessionRet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(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, CreateSession_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class CreateSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public CreateSession_resultTupleScheme getScheme() {
        return new CreateSession_resultTupleScheme();
      }
    }

    private static class CreateSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, CreateSession_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new CreateSessionRet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

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

    private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetUserId_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetUserId_argsTupleSchemeFactory();

    public java.lang.String sessionId; // 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 {
      SESSION_ID((short)1, "sessionId");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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: // SESSION_ID
            return SESSION_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetUserId_args.class, metaDataMap);
    }

    public GetUserId_args() {
    }

    public GetUserId_args(
      java.lang.String sessionId)
    {
      this();
      this.sessionId = sessionId;
    }

    /**
     * Performs a deep copy on other.
     */
    public GetUserId_args(GetUserId_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
    }

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

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

    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public GetUserId_args setSessionId(java.lang.String sessionId) {
      this.sessionId = sessionId;
      return this;
    }

    public void unsetSessionId() {
      this.sessionId = null;
    }

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

    public void setSessionIdIsSet(boolean value) {
      if (!value) {
        this.sessionId = null;
      }
    }

    public void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case SESSION_ID:
        if (value == null) {
          unsetSessionId();
        } else {
          setSessionId((java.lang.String)value);
        }
        break;

      }
    }

    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SESSION_ID:
        return isSetSessionId();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(GetUserId_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_sessionId = true && this.isSetSessionId();
      boolean that_present_sessionId = true && that.isSetSessionId();
      if (this_present_sessionId || that_present_sessionId) {
        if (!(this_present_sessionId && that_present_sessionId))
          return false;
        if (!this.sessionId.equals(that.sessionId))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287);
      if (isSetSessionId())
        hashCode = hashCode * 8191 + sessionId.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
    }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("GetUserId_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      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, java.lang.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 GetUserId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public GetUserId_argsStandardScheme getScheme() {
        return new GetUserId_argsStandardScheme();
      }
    }

    private static class GetUserId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, GetUserId_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: // SESSION_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sessionId = iprot.readString();
                struct.setSessionIdIsSet(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, GetUserId_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class GetUserId_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public GetUserId_argsTupleScheme getScheme() {
        return new GetUserId_argsTupleScheme();
      }
    }

    private static class GetUserId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

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

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

  public static class GetUserId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("GetUserId_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.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new GetUserId_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new GetUserId_resultTupleSchemeFactory();

    public GetUserIdRet success; // 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");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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;
          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 java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.STRUCT          , "GetUserIdRet")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(GetUserId_result.class, metaDataMap);
    }

    public GetUserId_result() {
    }

    public GetUserId_result(
      GetUserIdRet success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public GetUserId_result(GetUserId_result other) {
      if (other.isSetSuccess()) {
        this.success = new GetUserIdRet(other.success);
      }
    }

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

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

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

    public GetUserId_result setSuccess(GetUserIdRet 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 void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((GetUserIdRet)value);
        }
        break;

      }
    }

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

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(GetUserId_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.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;
        }
      }
      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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
      }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("GetUserId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      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, java.lang.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 GetUserId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public GetUserId_resultStandardScheme getScheme() {
        return new GetUserId_resultStandardScheme();
      }
    }

    private static class GetUserId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, GetUserId_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 GetUserIdRet();
                struct.success.read(iprot);
                struct.setSuccessIsSet(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, GetUserId_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();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

    private static class GetUserId_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public GetUserId_resultTupleScheme getScheme() {
        return new GetUserId_resultTupleScheme();
      }
    }

    private static class GetUserId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, GetUserId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = new GetUserIdRet();
          struct.success.read(iprot);
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

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

    private static final org.apache.thrift.protocol.TField SESSION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("sessionId", org.apache.thrift.protocol.TType.STRING, (short)1);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RemoveSession_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RemoveSession_argsTupleSchemeFactory();

    public java.lang.String sessionId; // 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 {
      SESSION_ID((short)1, "sessionId");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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: // SESSION_ID
            return SESSION_ID;
          default:
            return null;
        }
      }

      /**
       * Find the _Fields constant that matches fieldId, throwing an exception
       * if it is not found.
       */
      public static _Fields findByThriftIdOrThrow(int fieldId) {
        _Fields fields = findByThriftId(fieldId);
        if (fields == null) throw new java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
      tmpMap.put(_Fields.SESSION_ID, new org.apache.thrift.meta_data.FieldMetaData("sessionId", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoveSession_args.class, metaDataMap);
    }

    public RemoveSession_args() {
    }

    public RemoveSession_args(
      java.lang.String sessionId)
    {
      this();
      this.sessionId = sessionId;
    }

    /**
     * Performs a deep copy on other.
     */
    public RemoveSession_args(RemoveSession_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
    }

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

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

    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public RemoveSession_args setSessionId(java.lang.String sessionId) {
      this.sessionId = sessionId;
      return this;
    }

    public void unsetSessionId() {
      this.sessionId = null;
    }

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

    public void setSessionIdIsSet(boolean value) {
      if (!value) {
        this.sessionId = null;
      }
    }

    public void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case SESSION_ID:
        if (value == null) {
          unsetSessionId();
        } else {
          setSessionId((java.lang.String)value);
        }
        break;

      }
    }

    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SESSION_ID:
        return isSetSessionId();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(RemoveSession_args that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      boolean this_present_sessionId = true && this.isSetSessionId();
      boolean that_present_sessionId = true && that.isSetSessionId();
      if (this_present_sessionId || that_present_sessionId) {
        if (!(this_present_sessionId && that_present_sessionId))
          return false;
        if (!this.sessionId.equals(that.sessionId))
          return false;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSessionId()) ? 131071 : 524287);
      if (isSetSessionId())
        hashCode = hashCode * 8191 + sessionId.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.valueOf(isSetSessionId()).compareTo(other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
    }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("RemoveSession_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      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, java.lang.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 RemoveSession_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public RemoveSession_argsStandardScheme getScheme() {
        return new RemoveSession_argsStandardScheme();
      }
    }

    private static class RemoveSession_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RemoveSession_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: // SESSION_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.sessionId = iprot.readString();
                struct.setSessionIdIsSet(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, RemoveSession_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RemoveSession_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public RemoveSession_argsTupleScheme getScheme() {
        return new RemoveSession_argsTupleScheme();
      }
    }

    private static class RemoveSession_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme {

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

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

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

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

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0);

    private static final org.apache.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new RemoveSession_resultStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new RemoveSession_resultTupleSchemeFactory();

    public RemoveSessionStatus success; // 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");

      private static final java.util.Map byName = new java.util.HashMap();

      static {
        for (_Fields field : java.util.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;
          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 java.lang.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(java.lang.String name) {
        return byName.get(name);
      }

      private final short _thriftId;
      private final java.lang.String _fieldName;

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

      public short getThriftFieldId() {
        return _thriftId;
      }

      public java.lang.String getFieldName() {
        return _fieldName;
      }
    }

    // isset id assignments
    public static final java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
    static {
      java.util.Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new java.util.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.ENUM          , "RemoveSessionStatus")));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(RemoveSession_result.class, metaDataMap);
    }

    public RemoveSession_result() {
    }

    public RemoveSession_result(
      RemoveSessionStatus success)
    {
      this();
      this.success = success;
    }

    /**
     * Performs a deep copy on other.
     */
    public RemoveSession_result(RemoveSession_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
    }

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

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

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

    public RemoveSession_result setSuccess(RemoveSessionStatus 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 void setFieldValue(_Fields field, java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((RemoveSessionStatus)value);
        }
        break;

      }
    }

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

      }
      throw new java.lang.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 java.lang.IllegalArgumentException();
      }

      switch (field) {
      case SUCCESS:
        return isSetSuccess();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(RemoveSession_result that) {
      if (that == null)
        return false;
      if (this == that)
        return true;

      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;
      }

      return true;
    }

    @Override
    public int hashCode() {
      int hashCode = 1;

      hashCode = hashCode * 8191 + ((isSetSuccess()) ? 131071 : 524287);
      if (isSetSuccess())
        hashCode = hashCode * 8191 + success.getValue();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.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;
        }
      }
      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 {
      scheme(iprot).read(iprot, this);
    }

    public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException {
      scheme(oprot).write(oprot, this);
      }

    @Override
    public java.lang.String toString() {
      java.lang.StringBuilder sb = new java.lang.StringBuilder("RemoveSession_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      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, java.lang.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 RemoveSession_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public RemoveSession_resultStandardScheme getScheme() {
        return new RemoveSession_resultStandardScheme();
      }
    }

    private static class RemoveSession_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme {

      public void read(org.apache.thrift.protocol.TProtocol iprot, RemoveSession_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.I32) {
                struct.success = cicada.authorization.config.RemoveSessionStatus.findByValue(iprot.readI32());
                struct.setSuccessIsSet(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, RemoveSession_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

    private static class RemoveSession_resultTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public RemoveSession_resultTupleScheme getScheme() {
        return new RemoveSession_resultTupleScheme();
      }
    }

    private static class RemoveSession_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, RemoveSession_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol oprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet optionals = new java.util.BitSet();
        if (struct.isSetSuccess()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetSuccess()) {
          oprot.writeI32(struct.success.getValue());
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, RemoveSession_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TTupleProtocol iprot = (org.apache.thrift.protocol.TTupleProtocol) prot;
        java.util.BitSet incoming = iprot.readBitSet(1);
        if (incoming.get(0)) {
          struct.success = cicada.authorization.config.RemoveSessionStatus.findByValue(iprot.readI32());
          struct.setSuccessIsSet(true);
        }
      }
    }

    private static  S scheme(org.apache.thrift.protocol.TProtocol proto) {
      return (org.apache.thrift.scheme.StandardScheme.class.equals(proto.getScheme()) ? STANDARD_SCHEME_FACTORY : TUPLE_SCHEME_FACTORY).getScheme();
    }
  }

}