/**
 * Autogenerated by Thrift Compiler (0.16.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
package org.wso2.carbon.databridge.commons.thrift.service.secure;

@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"})
@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.16.0)", date = "2022-04-22")
public class ThriftSecureEventTransmissionService {

  public interface Iface {

    public java.lang.String connect(java.lang.String userName, java.lang.String password) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException, org.apache.thrift.TException;

    public void disconnect(java.lang.String sessionId) throws org.apache.thrift.TException;

    public java.lang.String defineStream(java.lang.String sessionId, java.lang.String streamDefinition) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException;

    public java.lang.String findStreamId(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException;

    public void publish(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException;

    public boolean deleteStreamById(java.lang.String sessionId, java.lang.String streamId) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException;

    public boolean deleteStreamByNameVersion(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException;

  }

  public interface AsyncIface {

    public void connect(java.lang.String userName, java.lang.String password, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;

    public void disconnect(java.lang.String sessionId, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;

    public void defineStream(java.lang.String sessionId, java.lang.String streamDefinition, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;

    public void findStreamId(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException;

    public void publish(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException;

    public void deleteStreamById(java.lang.String sessionId, java.lang.String streamId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;

    public void deleteStreamByNameVersion(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException;

  }

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

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

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

    public java.lang.String connect(java.lang.String userName, java.lang.String password) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException, org.apache.thrift.TException
    {
      send_connect(userName, password);
      return recv_connect();
    }

    public void send_connect(java.lang.String userName, java.lang.String password) throws org.apache.thrift.TException
    {
      connect_args args = new connect_args();
      args.setUserName(userName);
      args.setPassword(password);
      sendBase("connect", args);
    }

    public java.lang.String recv_connect() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException, org.apache.thrift.TException
    {
      connect_result result = new connect_result();
      receiveBase(result, "connect");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ae != null) {
        throw result.ae;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "connect failed: unknown result");
    }

    public void disconnect(java.lang.String sessionId) throws org.apache.thrift.TException
    {
      send_disconnect(sessionId);
      recv_disconnect();
    }

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

    public void recv_disconnect() throws org.apache.thrift.TException
    {
      disconnect_result result = new disconnect_result();
      receiveBase(result, "disconnect");
      return;
    }

    public java.lang.String defineStream(java.lang.String sessionId, java.lang.String streamDefinition) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      send_defineStream(sessionId, streamDefinition);
      return recv_defineStream();
    }

    public void send_defineStream(java.lang.String sessionId, java.lang.String streamDefinition) throws org.apache.thrift.TException
    {
      defineStream_args args = new defineStream_args();
      args.setSessionId(sessionId);
      args.setStreamDefinition(streamDefinition);
      sendBase("defineStream", args);
    }

    public java.lang.String recv_defineStream() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      defineStream_result result = new defineStream_result();
      receiveBase(result, "defineStream");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.ade != null) {
        throw result.ade;
      }
      if (result.mtd != null) {
        throw result.mtd;
      }
      if (result.tde != null) {
        throw result.tde;
      }
      if (result.se != null) {
        throw result.se;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "defineStream failed: unknown result");
    }

    public java.lang.String findStreamId(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      send_findStreamId(sessionId, streamName, streamVersion);
      return recv_findStreamId();
    }

    public void send_findStreamId(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.apache.thrift.TException
    {
      findStreamId_args args = new findStreamId_args();
      args.setSessionId(sessionId);
      args.setStreamName(streamName);
      args.setStreamVersion(streamVersion);
      sendBase("findStreamId", args);
    }

    public java.lang.String recv_findStreamId() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      findStreamId_result result = new findStreamId_result();
      receiveBase(result, "findStreamId");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.tnde != null) {
        throw result.tnde;
      }
      if (result.se != null) {
        throw result.se;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "findStreamId failed: unknown result");
    }

    public void publish(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      send_publish(eventBundle);
      recv_publish();
    }

    public void send_publish(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle) throws org.apache.thrift.TException
    {
      publish_args args = new publish_args();
      args.setEventBundle(eventBundle);
      sendBase("publish", args);
    }

    public void recv_publish() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      publish_result result = new publish_result();
      receiveBase(result, "publish");
      if (result.ue != null) {
        throw result.ue;
      }
      if (result.se != null) {
        throw result.se;
      }
      return;
    }

    public boolean deleteStreamById(java.lang.String sessionId, java.lang.String streamId) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      send_deleteStreamById(sessionId, streamId);
      return recv_deleteStreamById();
    }

    public void send_deleteStreamById(java.lang.String sessionId, java.lang.String streamId) throws org.apache.thrift.TException
    {
      deleteStreamById_args args = new deleteStreamById_args();
      args.setSessionId(sessionId);
      args.setStreamId(streamId);
      sendBase("deleteStreamById", args);
    }

    public boolean recv_deleteStreamById() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      deleteStreamById_result result = new deleteStreamById_result();
      receiveBase(result, "deleteStreamById");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.se != null) {
        throw result.se;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteStreamById failed: unknown result");
    }

    public boolean deleteStreamByNameVersion(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      send_deleteStreamByNameVersion(sessionId, streamName, streamVersion);
      return recv_deleteStreamByNameVersion();
    }

    public void send_deleteStreamByNameVersion(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion) throws org.apache.thrift.TException
    {
      deleteStreamByNameVersion_args args = new deleteStreamByNameVersion_args();
      args.setSessionId(sessionId);
      args.setStreamName(streamName);
      args.setStreamVersion(streamVersion);
      sendBase("deleteStreamByNameVersion", args);
    }

    public boolean recv_deleteStreamByNameVersion() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, org.apache.thrift.TException
    {
      deleteStreamByNameVersion_result result = new deleteStreamByNameVersion_result();
      receiveBase(result, "deleteStreamByNameVersion");
      if (result.isSetSuccess()) {
        return result.success;
      }
      if (result.se != null) {
        throw result.se;
      }
      throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "deleteStreamByNameVersion failed: unknown result");
    }

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

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

    public void connect(java.lang.String userName, java.lang.String password, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      connect_call method_call = new connect_call(userName, password, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

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

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("connect", org.apache.thrift.protocol.TMessageType.CALL, 0));
        connect_args args = new connect_args();
        args.setUserName(userName);
        args.setPassword(password);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.String getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException, 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_connect();
      }
    }

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

    public static class disconnect_call extends org.apache.thrift.async.TAsyncMethodCall<Void> {
      private java.lang.String sessionId;
      public disconnect_call(java.lang.String sessionId, org.apache.thrift.async.AsyncMethodCallback<Void> 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("disconnect", org.apache.thrift.protocol.TMessageType.CALL, 0));
        disconnect_args args = new disconnect_args();
        args.setSessionId(sessionId);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public Void 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 null;
      }
    }

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

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

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

      public java.lang.String getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, 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_defineStream();
      }
    }

    public void findStreamId(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      findStreamId_call method_call = new findStreamId_call(sessionId, streamName, streamVersion, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

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

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("findStreamId", org.apache.thrift.protocol.TMessageType.CALL, 0));
        findStreamId_args args = new findStreamId_args();
        args.setSessionId(sessionId);
        args.setStreamName(streamName);
        args.setStreamVersion(streamVersion);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.String getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, 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_findStreamId();
      }
    }

    public void publish(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      publish_call method_call = new publish_call(eventBundle, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

    public static class publish_call extends org.apache.thrift.async.TAsyncMethodCall<Void> {
      private org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle;
      public publish_call(org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle, org.apache.thrift.async.AsyncMethodCallback<Void> 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.eventBundle = eventBundle;
      }

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

      public Void getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, 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 null;
      }
    }

    public void deleteStreamById(java.lang.String sessionId, java.lang.String streamId, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      deleteStreamById_call method_call = new deleteStreamById_call(sessionId, streamId, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

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

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

      public java.lang.Boolean getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, 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_deleteStreamById();
      }
    }

    public void deleteStreamByNameVersion(java.lang.String sessionId, java.lang.String streamName, java.lang.String streamVersion, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
      checkReady();
      deleteStreamByNameVersion_call method_call = new deleteStreamByNameVersion_call(sessionId, streamName, streamVersion, resultHandler, this, ___protocolFactory, ___transport);
      this.___currentMethod = method_call;
      ___manager.call(method_call);
    }

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

      public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
        prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("deleteStreamByNameVersion", org.apache.thrift.protocol.TMessageType.CALL, 0));
        deleteStreamByNameVersion_args args = new deleteStreamByNameVersion_args();
        args.setSessionId(sessionId);
        args.setStreamName(streamName);
        args.setStreamVersion(streamVersion);
        args.write(prot);
        prot.writeMessageEnd();
      }

      public java.lang.Boolean getResult() throws org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException, 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_deleteStreamByNameVersion();
      }
    }

  }

  public static class Processor<I extends Iface> extends org.apache.thrift.TBaseProcessor<I> 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<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>>()));
    }

    protected Processor(I iface, java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> processMap) {
      super(iface, getProcessMap(processMap));
    }

    private static <I extends Iface> java.util.Map<java.lang.String,  org.apache.thrift.ProcessFunction<I, ? extends org.apache.thrift.TBase>> getProcessMap(java.util.Map<java.lang.String, org.apache.thrift.ProcessFunction<I, ? extends  org.apache.thrift.TBase>> processMap) {
      processMap.put("connect", new connect());
      processMap.put("disconnect", new disconnect());
      processMap.put("defineStream", new defineStream());
      processMap.put("findStreamId", new findStreamId());
      processMap.put("publish", new publish());
      processMap.put("deleteStreamById", new deleteStreamById());
      processMap.put("deleteStreamByNameVersion", new deleteStreamByNameVersion());
      return processMap;
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public connect_result getResult(I iface, connect_args args) throws org.apache.thrift.TException {
        connect_result result = new connect_result();
        try {
          result.success = iface.connect(args.userName, args.password);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException ae) {
          result.ae = ae;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public disconnect_result getResult(I iface, disconnect_args args) throws org.apache.thrift.TException {
        disconnect_result result = new disconnect_result();
        iface.disconnect(args.sessionId);
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public defineStream_result getResult(I iface, defineStream_args args) throws org.apache.thrift.TException {
        defineStream_result result = new defineStream_result();
        try {
          result.success = iface.defineStream(args.sessionId, args.streamDefinition);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade) {
          result.ade = ade;
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException mtd) {
          result.mtd = mtd;
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException tde) {
          result.tde = tde;
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
          result.se = se;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public findStreamId_result getResult(I iface, findStreamId_args args) throws org.apache.thrift.TException {
        findStreamId_result result = new findStreamId_result();
        try {
          result.success = iface.findStreamId(args.sessionId, args.streamName, args.streamVersion);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException tnde) {
          result.tnde = tnde;
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
          result.se = se;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public publish_result getResult(I iface, publish_args args) throws org.apache.thrift.TException {
        publish_result result = new publish_result();
        try {
          iface.publish(args.eventBundle);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException ue) {
          result.ue = ue;
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
          result.se = se;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public deleteStreamById_result getResult(I iface, deleteStreamById_args args) throws org.apache.thrift.TException {
        deleteStreamById_result result = new deleteStreamById_result();
        try {
          result.success = iface.deleteStreamById(args.sessionId, args.streamId);
          result.setSuccessIsSet(true);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
          result.se = se;
        }
        return result;
      }
    }

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

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

      protected boolean isOneway() {
        return false;
      }

      @Override
      protected boolean rethrowUnhandledExceptions() {
        return false;
      }

      public deleteStreamByNameVersion_result getResult(I iface, deleteStreamByNameVersion_args args) throws org.apache.thrift.TException {
        deleteStreamByNameVersion_result result = new deleteStreamByNameVersion_result();
        try {
          result.success = iface.deleteStreamByNameVersion(args.sessionId, args.streamName, args.streamVersion);
          result.setSuccessIsSet(true);
        } catch (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
          result.se = se;
        }
        return result;
      }
    }

  }

  public static class AsyncProcessor<I extends AsyncIface> extends org.apache.thrift.TBaseAsyncProcessor<I> {
    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<java.lang.String, org.apache.thrift.AsyncProcessFunction<I, ? extends org.apache.thrift.TBase, ?>>()));
    }

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

    private static <I extends AsyncIface> java.util.Map<java.lang.String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase,?>> getProcessMap(java.util.Map<java.lang.String,  org.apache.thrift.AsyncProcessFunction<I, ? extends  org.apache.thrift.TBase, ?>> processMap) {
      processMap.put("connect", new connect());
      processMap.put("disconnect", new disconnect());
      processMap.put("defineStream", new defineStream());
      processMap.put("findStreamId", new findStreamId());
      processMap.put("publish", new publish());
      processMap.put("deleteStreamById", new deleteStreamById());
      processMap.put("deleteStreamByNameVersion", new deleteStreamByNameVersion());
      return processMap;
    }

    public static class connect<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, connect_args, java.lang.String> {
      public connect() {
        super("connect");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> 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<java.lang.String>() { 
          public void onComplete(java.lang.String o) {
            connect_result result = new connect_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;
            connect_result result = new connect_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException) {
              result.ae = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException) e;
              result.setAeIsSet(true);
              msg = result;
            } else 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, connect_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
        iface.connect(args.userName, args.password,resultHandler);
      }
    }

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

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

      public org.apache.thrift.async.AsyncMethodCallback<Void> 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<Void>() { 
          public void onComplete(Void o) {
            disconnect_result result = new disconnect_result();
            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;
            disconnect_result result = new disconnect_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, disconnect_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
        iface.disconnect(args.sessionId,resultHandler);
      }
    }

    public static class defineStream<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, defineStream_args, java.lang.String> {
      public defineStream() {
        super("defineStream");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> 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<java.lang.String>() { 
          public void onComplete(java.lang.String o) {
            defineStream_result result = new defineStream_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;
            defineStream_result result = new defineStream_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException) {
              result.ade = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException) e;
              result.setAdeIsSet(true);
              msg = result;
            } else if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException) {
              result.mtd = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException) e;
              result.setMtdIsSet(true);
              msg = result;
            } else if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException) {
              result.tde = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException) e;
              result.setTdeIsSet(true);
              msg = result;
            } else if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) {
              result.se = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) e;
              result.setSeIsSet(true);
              msg = result;
            } else 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, defineStream_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
        iface.defineStream(args.sessionId, args.streamDefinition,resultHandler);
      }
    }

    public static class findStreamId<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, findStreamId_args, java.lang.String> {
      public findStreamId() {
        super("findStreamId");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback<java.lang.String> 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<java.lang.String>() { 
          public void onComplete(java.lang.String o) {
            findStreamId_result result = new findStreamId_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;
            findStreamId_result result = new findStreamId_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException) {
              result.tnde = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException) e;
              result.setTndeIsSet(true);
              msg = result;
            } else if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) {
              result.se = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) e;
              result.setSeIsSet(true);
              msg = result;
            } else 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, findStreamId_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.String> resultHandler) throws org.apache.thrift.TException {
        iface.findStreamId(args.sessionId, args.streamName, args.streamVersion,resultHandler);
      }
    }

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

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

      public org.apache.thrift.async.AsyncMethodCallback<Void> 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<Void>() { 
          public void onComplete(Void o) {
            publish_result result = new publish_result();
            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;
            publish_result result = new publish_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException) {
              result.ue = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException) e;
              result.setUeIsSet(true);
              msg = result;
            } else if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) {
              result.se = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) e;
              result.setSeIsSet(true);
              msg = result;
            } else 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, publish_args args, org.apache.thrift.async.AsyncMethodCallback<Void> resultHandler) throws org.apache.thrift.TException {
        iface.publish(args.eventBundle,resultHandler);
      }
    }

    public static class deleteStreamById<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteStreamById_args, java.lang.Boolean> {
      public deleteStreamById() {
        super("deleteStreamById");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> 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<java.lang.Boolean>() { 
          public void onComplete(java.lang.Boolean o) {
            deleteStreamById_result result = new deleteStreamById_result();
            result.success = o;
            result.setSuccessIsSet(true);
            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;
            deleteStreamById_result result = new deleteStreamById_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) {
              result.se = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) e;
              result.setSeIsSet(true);
              msg = result;
            } else 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, deleteStreamById_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
        iface.deleteStreamById(args.sessionId, args.streamId,resultHandler);
      }
    }

    public static class deleteStreamByNameVersion<I extends AsyncIface> extends org.apache.thrift.AsyncProcessFunction<I, deleteStreamByNameVersion_args, java.lang.Boolean> {
      public deleteStreamByNameVersion() {
        super("deleteStreamByNameVersion");
      }

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

      public org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> 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<java.lang.Boolean>() { 
          public void onComplete(java.lang.Boolean o) {
            deleteStreamByNameVersion_result result = new deleteStreamByNameVersion_result();
            result.success = o;
            result.setSuccessIsSet(true);
            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;
            deleteStreamByNameVersion_result result = new deleteStreamByNameVersion_result();
            if (e instanceof org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) {
              result.se = (org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException) e;
              result.setSeIsSet(true);
              msg = result;
            } else 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, deleteStreamByNameVersion_args args, org.apache.thrift.async.AsyncMethodCallback<java.lang.Boolean> resultHandler) throws org.apache.thrift.TException {
        iface.deleteStreamByNameVersion(args.sessionId, args.streamName, args.streamVersion,resultHandler);
      }
    }

  }

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

    private static final org.apache.thrift.protocol.TField USER_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("userName", org.apache.thrift.protocol.TType.STRING, (short)1);
    private static final org.apache.thrift.protocol.TField PASSWORD_FIELD_DESC = new org.apache.thrift.protocol.TField("password", org.apache.thrift.protocol.TType.STRING, (short)2);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String userName; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String password; // 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_NAME((short)1, "userName"),
      PASSWORD((short)2, "password");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // USER_NAME
            return USER_NAME;
          case 2: // PASSWORD
            return PASSWORD;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.USER_NAME, new org.apache.thrift.meta_data.FieldMetaData("userName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.PASSWORD, new org.apache.thrift.meta_data.FieldMetaData("password", 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(connect_args.class, metaDataMap);
    }

    public connect_args() {
    }

    public connect_args(
      java.lang.String userName,
      java.lang.String password)
    {
      this();
      this.userName = userName;
      this.password = password;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public connect_args(connect_args other) {
      if (other.isSetUserName()) {
        this.userName = other.userName;
      }
      if (other.isSetPassword()) {
        this.password = other.password;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getUserName() {
      return this.userName;
    }

    public connect_args setUserName(@org.apache.thrift.annotation.Nullable java.lang.String userName) {
      this.userName = userName;
      return this;
    }

    public void unsetUserName() {
      this.userName = null;
    }

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

    public void setUserNameIsSet(boolean value) {
      if (!value) {
        this.userName = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getPassword() {
      return this.password;
    }

    public connect_args setPassword(@org.apache.thrift.annotation.Nullable java.lang.String password) {
      this.password = password;
      return this;
    }

    public void unsetPassword() {
      this.password = null;
    }

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

    public void setPasswordIsSet(boolean value) {
      if (!value) {
        this.password = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case USER_NAME:
        if (value == null) {
          unsetUserName();
        } else {
          setUserName((java.lang.String)value);
        }
        break;

      case PASSWORD:
        if (value == null) {
          unsetPassword();
        } else {
          setPassword((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case USER_NAME:
        return getUserName();

      case PASSWORD:
        return getPassword();

      }
      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_NAME:
        return isSetUserName();
      case PASSWORD:
        return isSetPassword();
      }
      throw new java.lang.IllegalStateException();
    }

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

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

      boolean this_present_userName = true && this.isSetUserName();
      boolean that_present_userName = true && that.isSetUserName();
      if (this_present_userName || that_present_userName) {
        if (!(this_present_userName && that_present_userName))
          return false;
        if (!this.userName.equals(that.userName))
          return false;
      }

      boolean this_present_password = true && this.isSetPassword();
      boolean that_present_password = true && that.isSetPassword();
      if (this_present_password || that_present_password) {
        if (!(this_present_password && that_present_password))
          return false;
        if (!this.password.equals(that.password))
          return false;
      }

      return true;
    }

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

      hashCode = hashCode * 8191 + ((isSetUserName()) ? 131071 : 524287);
      if (isSetUserName())
        hashCode = hashCode * 8191 + userName.hashCode();

      hashCode = hashCode * 8191 + ((isSetPassword()) ? 131071 : 524287);
      if (isSetPassword())
        hashCode = hashCode * 8191 + password.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetUserName(), other.isSetUserName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUserName()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.userName, other.userName);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetPassword(), other.isSetPassword());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetPassword()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.password, other.password);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("connect_args(");
      boolean first = true;

      sb.append("userName:");
      if (this.userName == null) {
        sb.append("null");
      } else {
        sb.append(this.userName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("password:");
      if (this.password == null) {
        sb.append("null");
      } else {
        sb.append(this.password);
      }
      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 connect_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public connect_argsStandardScheme getScheme() {
        return new connect_argsStandardScheme();
      }
    }

    private static class connect_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<connect_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, connect_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_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.userName = iprot.readString();
                struct.setUserNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // PASSWORD
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.password = iprot.readString();
                struct.setPasswordIsSet(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, connect_args struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.userName != null) {
          oprot.writeFieldBegin(USER_NAME_FIELD_DESC);
          oprot.writeString(struct.userName);
          oprot.writeFieldEnd();
        }
        if (struct.password != null) {
          oprot.writeFieldBegin(PASSWORD_FIELD_DESC);
          oprot.writeString(struct.password);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class connect_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<connect_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, connect_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.isSetUserName()) {
          optionals.set(0);
        }
        if (struct.isSetPassword()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUserName()) {
          oprot.writeString(struct.userName);
        }
        if (struct.isSetPassword()) {
          oprot.writeString(struct.password);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, connect_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(2);
        if (incoming.get(0)) {
          struct.userName = iprot.readString();
          struct.setUserNameIsSet(true);
        }
        if (incoming.get(1)) {
          struct.password = iprot.readString();
          struct.setPasswordIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 connect_result implements org.apache.thrift.TBase<connect_result, connect_result._Fields>, java.io.Serializable, Cloneable, Comparable<connect_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("connect_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField AE_FIELD_DESC = new org.apache.thrift.protocol.TField("ae", org.apache.thrift.protocol.TType.STRUCT, (short)1);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String success; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException ae; // 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"),
      AE((short)1, "ae");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // AE
            return AE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.STRING)));
      tmpMap.put(_Fields.AE, new org.apache.thrift.meta_data.FieldMetaData("ae", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(connect_result.class, metaDataMap);
    }

    public connect_result() {
    }

    public connect_result(
      java.lang.String success,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException ae)
    {
      this();
      this.success = success;
      this.ae = ae;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public connect_result(connect_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetAe()) {
        this.ae = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException(other.ae);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSuccess() {
      return this.success;
    }

    public connect_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) {
      this.success = success;
      return this;
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException getAe() {
      return this.ae;
    }

    public connect_result setAe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException ae) {
      this.ae = ae;
      return this;
    }

    public void unsetAe() {
      this.ae = null;
    }

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

    public void setAeIsSet(boolean value) {
      if (!value) {
        this.ae = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.String)value);
        }
        break;

      case AE:
        if (value == null) {
          unsetAe();
        } else {
          setAe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case AE:
        return getAe();

      }
      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();
      case AE:
        return isSetAe();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(connect_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;
      }

      boolean this_present_ae = true && this.isSetAe();
      boolean that_present_ae = true && that.isSetAe();
      if (this_present_ae || that_present_ae) {
        if (!(this_present_ae && that_present_ae))
          return false;
        if (!this.ae.equals(that.ae))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetAe()) ? 131071 : 524287);
      if (isSetAe())
        hashCode = hashCode * 8191 + ae.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetAe(), other.isSetAe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ae, other.ae);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("connect_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ae:");
      if (this.ae == null) {
        sb.append("null");
      } else {
        sb.append(this.ae);
      }
      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 connect_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public connect_resultStandardScheme getScheme() {
        return new connect_resultStandardScheme();
      }
    }

    private static class connect_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<connect_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, connect_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.success = iprot.readString();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // AE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ae = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException();
                struct.ae.read(iprot);
                struct.setAeIsSet(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, connect_result struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

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

    private static class connect_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<connect_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, connect_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);
        }
        if (struct.isSetAe()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeString(struct.success);
        }
        if (struct.isSetAe()) {
          struct.ae.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, connect_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(2);
        if (incoming.get(0)) {
          struct.success = iprot.readString();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.ae = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftAuthenticationException();
          struct.ae.read(iprot);
          struct.setAeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 disconnect_args implements org.apache.thrift.TBase<disconnect_args, disconnect_args._Fields>, java.io.Serializable, Cloneable, Comparable<disconnect_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("disconnect_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 disconnect_argsStandardSchemeFactory();
    private static final org.apache.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new disconnect_argsTupleSchemeFactory();

    public @org.apache.thrift.annotation.Nullable 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<java.lang.String, _Fields> byName = new java.util.HashMap<java.lang.String, _Fields>();

      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.
       */
      @org.apache.thrift.annotation.Nullable
      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.
       */
      @org.apache.thrift.annotation.Nullable
      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(disconnect_args.class, metaDataMap);
    }

    public disconnect_args() {
    }

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

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

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public disconnect_args setSessionId(@org.apache.thrift.annotation.Nullable 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, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SESSION_ID:
        if (value == null) {
          unsetSessionId();
        } else {
          setSessionId((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    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 instanceof disconnect_args)
        return this.equals((disconnect_args)that);
      return false;
    }

    public boolean equals(disconnect_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(disconnect_args other) {
      if (!getClass().equals(other.getClass())) {
        return getClass().getName().compareTo(other.getClass().getName());
      }

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSessionId(), 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;
    }

    @org.apache.thrift.annotation.Nullable
    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("disconnect_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 disconnect_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public disconnect_argsStandardScheme getScheme() {
        return new disconnect_argsStandardScheme();
      }
    }

    private static class disconnect_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<disconnect_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, disconnect_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, disconnect_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 disconnect_argsTupleSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public disconnect_argsTupleScheme getScheme() {
        return new disconnect_argsTupleScheme();
      }
    }

    private static class disconnect_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<disconnect_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, disconnect_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, disconnect_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 extends org.apache.thrift.scheme.IScheme> 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 disconnect_result implements org.apache.thrift.TBase<disconnect_result, disconnect_result._Fields>, java.io.Serializable, Cloneable, Comparable<disconnect_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("disconnect_result");


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


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

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          default:
            return null;
        }
      }

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

      /**
       * Find the _Fields constant that matches name, or null if its not found.
       */
      @org.apache.thrift.annotation.Nullable
      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;
      }
    }
    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);
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(disconnect_result.class, metaDataMap);
    }

    public disconnect_result() {
    }

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

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

    @Override
    public void clear() {
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      }
      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) {
      }
      throw new java.lang.IllegalStateException();
    }

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

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

      return true;
    }

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

      return hashCode;
    }

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

      int lastComparison = 0;

      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("disconnect_result(");
      boolean first = true;

      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 disconnect_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public disconnect_resultStandardScheme getScheme() {
        return new disconnect_resultStandardScheme();
      }
    }

    private static class disconnect_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<disconnect_result> {

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

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

    }

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

    private static class disconnect_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<disconnect_result> {

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

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

    private static <S extends org.apache.thrift.scheme.IScheme> 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 defineStream_args implements org.apache.thrift.TBase<defineStream_args, defineStream_args._Fields>, java.io.Serializable, Cloneable, Comparable<defineStream_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("defineStream_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.protocol.TField STREAM_DEFINITION_FIELD_DESC = new org.apache.thrift.protocol.TField("streamDefinition", org.apache.thrift.protocol.TType.STRING, (short)2);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String sessionId; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamDefinition; // 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"),
      STREAM_DEFINITION((short)2, "streamDefinition");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SESSION_ID
            return SESSION_ID;
          case 2: // STREAM_DEFINITION
            return STREAM_DEFINITION;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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)));
      tmpMap.put(_Fields.STREAM_DEFINITION, new org.apache.thrift.meta_data.FieldMetaData("streamDefinition", 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(defineStream_args.class, metaDataMap);
    }

    public defineStream_args() {
    }

    public defineStream_args(
      java.lang.String sessionId,
      java.lang.String streamDefinition)
    {
      this();
      this.sessionId = sessionId;
      this.streamDefinition = streamDefinition;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public defineStream_args(defineStream_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
      if (other.isSetStreamDefinition()) {
        this.streamDefinition = other.streamDefinition;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public defineStream_args setSessionId(@org.apache.thrift.annotation.Nullable 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;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamDefinition() {
      return this.streamDefinition;
    }

    public defineStream_args setStreamDefinition(@org.apache.thrift.annotation.Nullable java.lang.String streamDefinition) {
      this.streamDefinition = streamDefinition;
      return this;
    }

    public void unsetStreamDefinition() {
      this.streamDefinition = null;
    }

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

    public void setStreamDefinitionIsSet(boolean value) {
      if (!value) {
        this.streamDefinition = null;
      }
    }

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

      case STREAM_DEFINITION:
        if (value == null) {
          unsetStreamDefinition();
        } else {
          setStreamDefinition((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      case STREAM_DEFINITION:
        return getStreamDefinition();

      }
      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();
      case STREAM_DEFINITION:
        return isSetStreamDefinition();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(defineStream_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;
      }

      boolean this_present_streamDefinition = true && this.isSetStreamDefinition();
      boolean that_present_streamDefinition = true && that.isSetStreamDefinition();
      if (this_present_streamDefinition || that_present_streamDefinition) {
        if (!(this_present_streamDefinition && that_present_streamDefinition))
          return false;
        if (!this.streamDefinition.equals(that.streamDefinition))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetStreamDefinition()) ? 131071 : 524287);
      if (isSetStreamDefinition())
        hashCode = hashCode * 8191 + streamDefinition.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSessionId(), other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamDefinition(), other.isSetStreamDefinition());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamDefinition()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamDefinition, other.streamDefinition);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("defineStream_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamDefinition:");
      if (this.streamDefinition == null) {
        sb.append("null");
      } else {
        sb.append(this.streamDefinition);
      }
      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 defineStream_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public defineStream_argsStandardScheme getScheme() {
        return new defineStream_argsStandardScheme();
      }
    }

    private static class defineStream_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<defineStream_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, defineStream_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;
            case 2: // STREAM_DEFINITION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamDefinition = iprot.readString();
                struct.setStreamDefinitionIsSet(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, defineStream_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();
        }
        if (struct.streamDefinition != null) {
          oprot.writeFieldBegin(STREAM_DEFINITION_FIELD_DESC);
          oprot.writeString(struct.streamDefinition);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class defineStream_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<defineStream_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, defineStream_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);
        }
        if (struct.isSetStreamDefinition()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSessionId()) {
          oprot.writeString(struct.sessionId);
        }
        if (struct.isSetStreamDefinition()) {
          oprot.writeString(struct.streamDefinition);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, defineStream_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(2);
        if (incoming.get(0)) {
          struct.sessionId = iprot.readString();
          struct.setSessionIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.streamDefinition = iprot.readString();
          struct.setStreamDefinitionIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 defineStream_result implements org.apache.thrift.TBase<defineStream_result, defineStream_result._Fields>, java.io.Serializable, Cloneable, Comparable<defineStream_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("defineStream_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField ADE_FIELD_DESC = new org.apache.thrift.protocol.TField("ade", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField MTD_FIELD_DESC = new org.apache.thrift.protocol.TField("mtd", org.apache.thrift.protocol.TType.STRUCT, (short)2);
    private static final org.apache.thrift.protocol.TField TDE_FIELD_DESC = new org.apache.thrift.protocol.TField("tde", org.apache.thrift.protocol.TType.STRUCT, (short)3);
    private static final org.apache.thrift.protocol.TField SE_FIELD_DESC = new org.apache.thrift.protocol.TField("se", org.apache.thrift.protocol.TType.STRUCT, (short)4);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String success; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException mtd; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException tde; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se; // 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"),
      ADE((short)1, "ade"),
      MTD((short)2, "mtd"),
      TDE((short)3, "tde"),
      SE((short)4, "se");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // ADE
            return ADE;
          case 2: // MTD
            return MTD;
          case 3: // TDE
            return TDE;
          case 4: // SE
            return SE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.STRING)));
      tmpMap.put(_Fields.ADE, new org.apache.thrift.meta_data.FieldMetaData("ade", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException.class)));
      tmpMap.put(_Fields.MTD, new org.apache.thrift.meta_data.FieldMetaData("mtd", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException.class)));
      tmpMap.put(_Fields.TDE, new org.apache.thrift.meta_data.FieldMetaData("tde", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException.class)));
      tmpMap.put(_Fields.SE, new org.apache.thrift.meta_data.FieldMetaData("se", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(defineStream_result.class, metaDataMap);
    }

    public defineStream_result() {
    }

    public defineStream_result(
      java.lang.String success,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException mtd,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException tde,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se)
    {
      this();
      this.success = success;
      this.ade = ade;
      this.mtd = mtd;
      this.tde = tde;
      this.se = se;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public defineStream_result(defineStream_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetAde()) {
        this.ade = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException(other.ade);
      }
      if (other.isSetMtd()) {
        this.mtd = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException(other.mtd);
      }
      if (other.isSetTde()) {
        this.tde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException(other.tde);
      }
      if (other.isSetSe()) {
        this.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException(other.se);
      }
    }

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

    @Override
    public void clear() {
      this.success = null;
      this.ade = null;
      this.mtd = null;
      this.tde = null;
      this.se = null;
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSuccess() {
      return this.success;
    }

    public defineStream_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) {
      this.success = success;
      return this;
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException getAde() {
      return this.ade;
    }

    public defineStream_result setAde(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException ade) {
      this.ade = ade;
      return this;
    }

    public void unsetAde() {
      this.ade = null;
    }

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

    public void setAdeIsSet(boolean value) {
      if (!value) {
        this.ade = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException getMtd() {
      return this.mtd;
    }

    public defineStream_result setMtd(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException mtd) {
      this.mtd = mtd;
      return this;
    }

    public void unsetMtd() {
      this.mtd = null;
    }

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

    public void setMtdIsSet(boolean value) {
      if (!value) {
        this.mtd = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException getTde() {
      return this.tde;
    }

    public defineStream_result setTde(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException tde) {
      this.tde = tde;
      return this;
    }

    public void unsetTde() {
      this.tde = null;
    }

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

    public void setTdeIsSet(boolean value) {
      if (!value) {
        this.tde = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException getSe() {
      return this.se;
    }

    public defineStream_result setSe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
      this.se = se;
      return this;
    }

    public void unsetSe() {
      this.se = null;
    }

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

    public void setSeIsSet(boolean value) {
      if (!value) {
        this.se = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.String)value);
        }
        break;

      case ADE:
        if (value == null) {
          unsetAde();
        } else {
          setAde((org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException)value);
        }
        break;

      case MTD:
        if (value == null) {
          unsetMtd();
        } else {
          setMtd((org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException)value);
        }
        break;

      case TDE:
        if (value == null) {
          unsetTde();
        } else {
          setTde((org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException)value);
        }
        break;

      case SE:
        if (value == null) {
          unsetSe();
        } else {
          setSe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case ADE:
        return getAde();

      case MTD:
        return getMtd();

      case TDE:
        return getTde();

      case SE:
        return getSe();

      }
      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();
      case ADE:
        return isSetAde();
      case MTD:
        return isSetMtd();
      case TDE:
        return isSetTde();
      case SE:
        return isSetSe();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(defineStream_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;
      }

      boolean this_present_ade = true && this.isSetAde();
      boolean that_present_ade = true && that.isSetAde();
      if (this_present_ade || that_present_ade) {
        if (!(this_present_ade && that_present_ade))
          return false;
        if (!this.ade.equals(that.ade))
          return false;
      }

      boolean this_present_mtd = true && this.isSetMtd();
      boolean that_present_mtd = true && that.isSetMtd();
      if (this_present_mtd || that_present_mtd) {
        if (!(this_present_mtd && that_present_mtd))
          return false;
        if (!this.mtd.equals(that.mtd))
          return false;
      }

      boolean this_present_tde = true && this.isSetTde();
      boolean that_present_tde = true && that.isSetTde();
      if (this_present_tde || that_present_tde) {
        if (!(this_present_tde && that_present_tde))
          return false;
        if (!this.tde.equals(that.tde))
          return false;
      }

      boolean this_present_se = true && this.isSetSe();
      boolean that_present_se = true && that.isSetSe();
      if (this_present_se || that_present_se) {
        if (!(this_present_se && that_present_se))
          return false;
        if (!this.se.equals(that.se))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetAde()) ? 131071 : 524287);
      if (isSetAde())
        hashCode = hashCode * 8191 + ade.hashCode();

      hashCode = hashCode * 8191 + ((isSetMtd()) ? 131071 : 524287);
      if (isSetMtd())
        hashCode = hashCode * 8191 + mtd.hashCode();

      hashCode = hashCode * 8191 + ((isSetTde()) ? 131071 : 524287);
      if (isSetTde())
        hashCode = hashCode * 8191 + tde.hashCode();

      hashCode = hashCode * 8191 + ((isSetSe()) ? 131071 : 524287);
      if (isSetSe())
        hashCode = hashCode * 8191 + se.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetAde(), other.isSetAde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetAde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ade, other.ade);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetMtd(), other.isSetMtd());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetMtd()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.mtd, other.mtd);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetTde(), other.isSetTde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tde, other.tde);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSe(), other.isSetSe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.se, other.se);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("defineStream_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("ade:");
      if (this.ade == null) {
        sb.append("null");
      } else {
        sb.append(this.ade);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("mtd:");
      if (this.mtd == null) {
        sb.append("null");
      } else {
        sb.append(this.mtd);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("tde:");
      if (this.tde == null) {
        sb.append("null");
      } else {
        sb.append(this.tde);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("se:");
      if (this.se == null) {
        sb.append("null");
      } else {
        sb.append(this.se);
      }
      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 defineStream_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public defineStream_resultStandardScheme getScheme() {
        return new defineStream_resultStandardScheme();
      }
    }

    private static class defineStream_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<defineStream_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, defineStream_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.success = iprot.readString();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // ADE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ade = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException();
                struct.ade.read(iprot);
                struct.setAdeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // MTD
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.mtd = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException();
                struct.mtd.read(iprot);
                struct.setMtdIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // TDE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.tde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException();
                struct.tde.read(iprot);
                struct.setTdeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 4: // SE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
                struct.se.read(iprot);
                struct.setSeIsSet(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, defineStream_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeString(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.ade != null) {
          oprot.writeFieldBegin(ADE_FIELD_DESC);
          struct.ade.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.mtd != null) {
          oprot.writeFieldBegin(MTD_FIELD_DESC);
          struct.mtd.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.tde != null) {
          oprot.writeFieldBegin(TDE_FIELD_DESC);
          struct.tde.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.se != null) {
          oprot.writeFieldBegin(SE_FIELD_DESC);
          struct.se.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class defineStream_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<defineStream_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, defineStream_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);
        }
        if (struct.isSetAde()) {
          optionals.set(1);
        }
        if (struct.isSetMtd()) {
          optionals.set(2);
        }
        if (struct.isSetTde()) {
          optionals.set(3);
        }
        if (struct.isSetSe()) {
          optionals.set(4);
        }
        oprot.writeBitSet(optionals, 5);
        if (struct.isSetSuccess()) {
          oprot.writeString(struct.success);
        }
        if (struct.isSetAde()) {
          struct.ade.write(oprot);
        }
        if (struct.isSetMtd()) {
          struct.mtd.write(oprot);
        }
        if (struct.isSetTde()) {
          struct.tde.write(oprot);
        }
        if (struct.isSetSe()) {
          struct.se.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, defineStream_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(5);
        if (incoming.get(0)) {
          struct.success = iprot.readString();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.ade = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftDifferentStreamDefinitionAlreadyDefinedException();
          struct.ade.read(iprot);
          struct.setAdeIsSet(true);
        }
        if (incoming.get(2)) {
          struct.mtd = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftMalformedStreamDefinitionException();
          struct.mtd.read(iprot);
          struct.setMtdIsSet(true);
        }
        if (incoming.get(3)) {
          struct.tde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftStreamDefinitionException();
          struct.tde.read(iprot);
          struct.setTdeIsSet(true);
        }
        if (incoming.get(4)) {
          struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
          struct.se.read(iprot);
          struct.setSeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 findStreamId_args implements org.apache.thrift.TBase<findStreamId_args, findStreamId_args._Fields>, java.io.Serializable, Cloneable, Comparable<findStreamId_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findStreamId_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.protocol.TField STREAM_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("streamName", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField STREAM_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("streamVersion", org.apache.thrift.protocol.TType.STRING, (short)3);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String sessionId; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamName; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamVersion; // 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"),
      STREAM_NAME((short)2, "streamName"),
      STREAM_VERSION((short)3, "streamVersion");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SESSION_ID
            return SESSION_ID;
          case 2: // STREAM_NAME
            return STREAM_NAME;
          case 3: // STREAM_VERSION
            return STREAM_VERSION;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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)));
      tmpMap.put(_Fields.STREAM_NAME, new org.apache.thrift.meta_data.FieldMetaData("streamName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.STREAM_VERSION, new org.apache.thrift.meta_data.FieldMetaData("streamVersion", 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(findStreamId_args.class, metaDataMap);
    }

    public findStreamId_args() {
    }

    public findStreamId_args(
      java.lang.String sessionId,
      java.lang.String streamName,
      java.lang.String streamVersion)
    {
      this();
      this.sessionId = sessionId;
      this.streamName = streamName;
      this.streamVersion = streamVersion;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public findStreamId_args(findStreamId_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
      if (other.isSetStreamName()) {
        this.streamName = other.streamName;
      }
      if (other.isSetStreamVersion()) {
        this.streamVersion = other.streamVersion;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public findStreamId_args setSessionId(@org.apache.thrift.annotation.Nullable 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;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamName() {
      return this.streamName;
    }

    public findStreamId_args setStreamName(@org.apache.thrift.annotation.Nullable java.lang.String streamName) {
      this.streamName = streamName;
      return this;
    }

    public void unsetStreamName() {
      this.streamName = null;
    }

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

    public void setStreamNameIsSet(boolean value) {
      if (!value) {
        this.streamName = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamVersion() {
      return this.streamVersion;
    }

    public findStreamId_args setStreamVersion(@org.apache.thrift.annotation.Nullable java.lang.String streamVersion) {
      this.streamVersion = streamVersion;
      return this;
    }

    public void unsetStreamVersion() {
      this.streamVersion = null;
    }

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

    public void setStreamVersionIsSet(boolean value) {
      if (!value) {
        this.streamVersion = null;
      }
    }

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

      case STREAM_NAME:
        if (value == null) {
          unsetStreamName();
        } else {
          setStreamName((java.lang.String)value);
        }
        break;

      case STREAM_VERSION:
        if (value == null) {
          unsetStreamVersion();
        } else {
          setStreamVersion((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      case STREAM_NAME:
        return getStreamName();

      case STREAM_VERSION:
        return getStreamVersion();

      }
      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();
      case STREAM_NAME:
        return isSetStreamName();
      case STREAM_VERSION:
        return isSetStreamVersion();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(findStreamId_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;
      }

      boolean this_present_streamName = true && this.isSetStreamName();
      boolean that_present_streamName = true && that.isSetStreamName();
      if (this_present_streamName || that_present_streamName) {
        if (!(this_present_streamName && that_present_streamName))
          return false;
        if (!this.streamName.equals(that.streamName))
          return false;
      }

      boolean this_present_streamVersion = true && this.isSetStreamVersion();
      boolean that_present_streamVersion = true && that.isSetStreamVersion();
      if (this_present_streamVersion || that_present_streamVersion) {
        if (!(this_present_streamVersion && that_present_streamVersion))
          return false;
        if (!this.streamVersion.equals(that.streamVersion))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetStreamName()) ? 131071 : 524287);
      if (isSetStreamName())
        hashCode = hashCode * 8191 + streamName.hashCode();

      hashCode = hashCode * 8191 + ((isSetStreamVersion()) ? 131071 : 524287);
      if (isSetStreamVersion())
        hashCode = hashCode * 8191 + streamVersion.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSessionId(), other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamName(), other.isSetStreamName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamName()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamName, other.streamName);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamVersion(), other.isSetStreamVersion());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamVersion()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamVersion, other.streamVersion);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("findStreamId_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamName:");
      if (this.streamName == null) {
        sb.append("null");
      } else {
        sb.append(this.streamName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamVersion:");
      if (this.streamVersion == null) {
        sb.append("null");
      } else {
        sb.append(this.streamVersion);
      }
      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 findStreamId_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public findStreamId_argsStandardScheme getScheme() {
        return new findStreamId_argsStandardScheme();
      }
    }

    private static class findStreamId_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<findStreamId_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, findStreamId_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;
            case 2: // STREAM_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamName = iprot.readString();
                struct.setStreamNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // STREAM_VERSION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamVersion = iprot.readString();
                struct.setStreamVersionIsSet(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, findStreamId_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();
        }
        if (struct.streamName != null) {
          oprot.writeFieldBegin(STREAM_NAME_FIELD_DESC);
          oprot.writeString(struct.streamName);
          oprot.writeFieldEnd();
        }
        if (struct.streamVersion != null) {
          oprot.writeFieldBegin(STREAM_VERSION_FIELD_DESC);
          oprot.writeString(struct.streamVersion);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class findStreamId_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<findStreamId_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, findStreamId_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);
        }
        if (struct.isSetStreamName()) {
          optionals.set(1);
        }
        if (struct.isSetStreamVersion()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetSessionId()) {
          oprot.writeString(struct.sessionId);
        }
        if (struct.isSetStreamName()) {
          oprot.writeString(struct.streamName);
        }
        if (struct.isSetStreamVersion()) {
          oprot.writeString(struct.streamVersion);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, findStreamId_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.sessionId = iprot.readString();
          struct.setSessionIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.streamName = iprot.readString();
          struct.setStreamNameIsSet(true);
        }
        if (incoming.get(2)) {
          struct.streamVersion = iprot.readString();
          struct.setStreamVersionIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 findStreamId_result implements org.apache.thrift.TBase<findStreamId_result, findStreamId_result._Fields>, java.io.Serializable, Cloneable, Comparable<findStreamId_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("findStreamId_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0);
    private static final org.apache.thrift.protocol.TField TNDE_FIELD_DESC = new org.apache.thrift.protocol.TField("tnde", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField SE_FIELD_DESC = new org.apache.thrift.protocol.TField("se", org.apache.thrift.protocol.TType.STRUCT, (short)2);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String success; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException tnde; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se; // 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"),
      TNDE((short)1, "tnde"),
      SE((short)2, "se");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // TNDE
            return TNDE;
          case 2: // SE
            return SE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.STRING)));
      tmpMap.put(_Fields.TNDE, new org.apache.thrift.meta_data.FieldMetaData("tnde", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException.class)));
      tmpMap.put(_Fields.SE, new org.apache.thrift.meta_data.FieldMetaData("se", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(findStreamId_result.class, metaDataMap);
    }

    public findStreamId_result() {
    }

    public findStreamId_result(
      java.lang.String success,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException tnde,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se)
    {
      this();
      this.success = success;
      this.tnde = tnde;
      this.se = se;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public findStreamId_result(findStreamId_result other) {
      if (other.isSetSuccess()) {
        this.success = other.success;
      }
      if (other.isSetTnde()) {
        this.tnde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException(other.tnde);
      }
      if (other.isSetSe()) {
        this.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException(other.se);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSuccess() {
      return this.success;
    }

    public findStreamId_result setSuccess(@org.apache.thrift.annotation.Nullable java.lang.String success) {
      this.success = success;
      return this;
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException getTnde() {
      return this.tnde;
    }

    public findStreamId_result setTnde(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException tnde) {
      this.tnde = tnde;
      return this;
    }

    public void unsetTnde() {
      this.tnde = null;
    }

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

    public void setTndeIsSet(boolean value) {
      if (!value) {
        this.tnde = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException getSe() {
      return this.se;
    }

    public findStreamId_result setSe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
      this.se = se;
      return this;
    }

    public void unsetSe() {
      this.se = null;
    }

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

    public void setSeIsSet(boolean value) {
      if (!value) {
        this.se = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.String)value);
        }
        break;

      case TNDE:
        if (value == null) {
          unsetTnde();
        } else {
          setTnde((org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException)value);
        }
        break;

      case SE:
        if (value == null) {
          unsetSe();
        } else {
          setSe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return getSuccess();

      case TNDE:
        return getTnde();

      case SE:
        return getSe();

      }
      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();
      case TNDE:
        return isSetTnde();
      case SE:
        return isSetSe();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(findStreamId_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;
      }

      boolean this_present_tnde = true && this.isSetTnde();
      boolean that_present_tnde = true && that.isSetTnde();
      if (this_present_tnde || that_present_tnde) {
        if (!(this_present_tnde && that_present_tnde))
          return false;
        if (!this.tnde.equals(that.tnde))
          return false;
      }

      boolean this_present_se = true && this.isSetSe();
      boolean that_present_se = true && that.isSetSe();
      if (this_present_se || that_present_se) {
        if (!(this_present_se && that_present_se))
          return false;
        if (!this.se.equals(that.se))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetTnde()) ? 131071 : 524287);
      if (isSetTnde())
        hashCode = hashCode * 8191 + tnde.hashCode();

      hashCode = hashCode * 8191 + ((isSetSe()) ? 131071 : 524287);
      if (isSetSe())
        hashCode = hashCode * 8191 + se.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetTnde(), other.isSetTnde());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetTnde()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.tnde, other.tnde);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSe(), other.isSetSe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.se, other.se);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("findStreamId_result(");
      boolean first = true;

      sb.append("success:");
      if (this.success == null) {
        sb.append("null");
      } else {
        sb.append(this.success);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("tnde:");
      if (this.tnde == null) {
        sb.append("null");
      } else {
        sb.append(this.tnde);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("se:");
      if (this.se == null) {
        sb.append("null");
      } else {
        sb.append(this.se);
      }
      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 findStreamId_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public findStreamId_resultStandardScheme getScheme() {
        return new findStreamId_resultStandardScheme();
      }
    }

    private static class findStreamId_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<findStreamId_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, findStreamId_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 0: // SUCCESS
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.success = iprot.readString();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // TNDE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.tnde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException();
                struct.tnde.read(iprot);
                struct.setTndeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
                struct.se.read(iprot);
                struct.setSeIsSet(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, findStreamId_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.success != null) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeString(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.tnde != null) {
          oprot.writeFieldBegin(TNDE_FIELD_DESC);
          struct.tnde.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.se != null) {
          oprot.writeFieldBegin(SE_FIELD_DESC);
          struct.se.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class findStreamId_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<findStreamId_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, findStreamId_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);
        }
        if (struct.isSetTnde()) {
          optionals.set(1);
        }
        if (struct.isSetSe()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetSuccess()) {
          oprot.writeString(struct.success);
        }
        if (struct.isSetTnde()) {
          struct.tnde.write(oprot);
        }
        if (struct.isSetSe()) {
          struct.se.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, findStreamId_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(3);
        if (incoming.get(0)) {
          struct.success = iprot.readString();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.tnde = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftNoStreamDefinitionExistException();
          struct.tnde.read(iprot);
          struct.setTndeIsSet(true);
        }
        if (incoming.get(2)) {
          struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
          struct.se.read(iprot);
          struct.setSeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 publish_args implements org.apache.thrift.TBase<publish_args, publish_args._Fields>, java.io.Serializable, Cloneable, Comparable<publish_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publish_args");

    private static final org.apache.thrift.protocol.TField EVENT_BUNDLE_FIELD_DESC = new org.apache.thrift.protocol.TField("eventBundle", org.apache.thrift.protocol.TType.STRUCT, (short)1);

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

    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle; // 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 {
      EVENT_BUNDLE((short)1, "eventBundle");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // EVENT_BUNDLE
            return EVENT_BUNDLE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.EVENT_BUNDLE, new org.apache.thrift.meta_data.FieldMetaData("eventBundle", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publish_args.class, metaDataMap);
    }

    public publish_args() {
    }

    public publish_args(
      org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle)
    {
      this();
      this.eventBundle = eventBundle;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public publish_args(publish_args other) {
      if (other.isSetEventBundle()) {
        this.eventBundle = new org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle(other.eventBundle);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle getEventBundle() {
      return this.eventBundle;
    }

    public publish_args setEventBundle(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle eventBundle) {
      this.eventBundle = eventBundle;
      return this;
    }

    public void unsetEventBundle() {
      this.eventBundle = null;
    }

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

    public void setEventBundleIsSet(boolean value) {
      if (!value) {
        this.eventBundle = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case EVENT_BUNDLE:
        if (value == null) {
          unsetEventBundle();
        } else {
          setEventBundle((org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case EVENT_BUNDLE:
        return getEventBundle();

      }
      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 EVENT_BUNDLE:
        return isSetEventBundle();
      }
      throw new java.lang.IllegalStateException();
    }

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

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

      boolean this_present_eventBundle = true && this.isSetEventBundle();
      boolean that_present_eventBundle = true && that.isSetEventBundle();
      if (this_present_eventBundle || that_present_eventBundle) {
        if (!(this_present_eventBundle && that_present_eventBundle))
          return false;
        if (!this.eventBundle.equals(that.eventBundle))
          return false;
      }

      return true;
    }

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

      hashCode = hashCode * 8191 + ((isSetEventBundle()) ? 131071 : 524287);
      if (isSetEventBundle())
        hashCode = hashCode * 8191 + eventBundle.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetEventBundle(), other.isSetEventBundle());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetEventBundle()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eventBundle, other.eventBundle);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("publish_args(");
      boolean first = true;

      sb.append("eventBundle:");
      if (this.eventBundle == null) {
        sb.append("null");
      } else {
        sb.append(this.eventBundle);
      }
      first = false;
      sb.append(")");
      return sb.toString();
    }

    public void validate() throws org.apache.thrift.TException {
      // check for required fields
      // check for sub-struct validity
      if (eventBundle != null) {
        eventBundle.validate();
      }
    }

    private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
      try {
        write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
      } catch (org.apache.thrift.TException te) {
        throw new java.io.IOException(te);
      }
    }

    private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, 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 publish_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public publish_argsStandardScheme getScheme() {
        return new publish_argsStandardScheme();
      }
    }

    private static class publish_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<publish_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, publish_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: // EVENT_BUNDLE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.eventBundle = new org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle();
                struct.eventBundle.read(iprot);
                struct.setEventBundleIsSet(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, publish_args struct) throws org.apache.thrift.TException {
        struct.validate();

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

    }

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

    private static class publish_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<publish_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, publish_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.isSetEventBundle()) {
          optionals.set(0);
        }
        oprot.writeBitSet(optionals, 1);
        if (struct.isSetEventBundle()) {
          struct.eventBundle.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, publish_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.eventBundle = new org.wso2.carbon.databridge.commons.thrift.data.ThriftEventBundle();
          struct.eventBundle.read(iprot);
          struct.setEventBundleIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 publish_result implements org.apache.thrift.TBase<publish_result, publish_result._Fields>, java.io.Serializable, Cloneable, Comparable<publish_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("publish_result");

    private static final org.apache.thrift.protocol.TField UE_FIELD_DESC = new org.apache.thrift.protocol.TField("ue", org.apache.thrift.protocol.TType.STRUCT, (short)1);
    private static final org.apache.thrift.protocol.TField SE_FIELD_DESC = new org.apache.thrift.protocol.TField("se", org.apache.thrift.protocol.TType.STRUCT, (short)2);

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

    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException ue; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se; // 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 {
      UE((short)1, "ue"),
      SE((short)2, "se");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // UE
            return UE;
          case 2: // SE
            return SE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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.UE, new org.apache.thrift.meta_data.FieldMetaData("ue", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException.class)));
      tmpMap.put(_Fields.SE, new org.apache.thrift.meta_data.FieldMetaData("se", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(publish_result.class, metaDataMap);
    }

    public publish_result() {
    }

    public publish_result(
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException ue,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se)
    {
      this();
      this.ue = ue;
      this.se = se;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public publish_result(publish_result other) {
      if (other.isSetUe()) {
        this.ue = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException(other.ue);
      }
      if (other.isSetSe()) {
        this.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException(other.se);
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException getUe() {
      return this.ue;
    }

    public publish_result setUe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException ue) {
      this.ue = ue;
      return this;
    }

    public void unsetUe() {
      this.ue = null;
    }

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

    public void setUeIsSet(boolean value) {
      if (!value) {
        this.ue = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException getSe() {
      return this.se;
    }

    public publish_result setSe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
      this.se = se;
      return this;
    }

    public void unsetSe() {
      this.se = null;
    }

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

    public void setSeIsSet(boolean value) {
      if (!value) {
        this.se = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case UE:
        if (value == null) {
          unsetUe();
        } else {
          setUe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException)value);
        }
        break;

      case SE:
        if (value == null) {
          unsetSe();
        } else {
          setSe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case UE:
        return getUe();

      case SE:
        return getSe();

      }
      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 UE:
        return isSetUe();
      case SE:
        return isSetSe();
      }
      throw new java.lang.IllegalStateException();
    }

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

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

      boolean this_present_ue = true && this.isSetUe();
      boolean that_present_ue = true && that.isSetUe();
      if (this_present_ue || that_present_ue) {
        if (!(this_present_ue && that_present_ue))
          return false;
        if (!this.ue.equals(that.ue))
          return false;
      }

      boolean this_present_se = true && this.isSetSe();
      boolean that_present_se = true && that.isSetSe();
      if (this_present_se || that_present_se) {
        if (!(this_present_se && that_present_se))
          return false;
        if (!this.se.equals(that.se))
          return false;
      }

      return true;
    }

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

      hashCode = hashCode * 8191 + ((isSetUe()) ? 131071 : 524287);
      if (isSetUe())
        hashCode = hashCode * 8191 + ue.hashCode();

      hashCode = hashCode * 8191 + ((isSetSe()) ? 131071 : 524287);
      if (isSetSe())
        hashCode = hashCode * 8191 + se.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetUe(), other.isSetUe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetUe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.ue, other.ue);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSe(), other.isSetSe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.se, other.se);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("publish_result(");
      boolean first = true;

      sb.append("ue:");
      if (this.ue == null) {
        sb.append("null");
      } else {
        sb.append(this.ue);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("se:");
      if (this.se == null) {
        sb.append("null");
      } else {
        sb.append(this.se);
      }
      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 publish_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public publish_resultStandardScheme getScheme() {
        return new publish_resultStandardScheme();
      }
    }

    private static class publish_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<publish_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, publish_result struct) throws org.apache.thrift.TException {
        org.apache.thrift.protocol.TField schemeField;
        iprot.readStructBegin();
        while (true)
        {
          schemeField = iprot.readFieldBegin();
          if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
            break;
          }
          switch (schemeField.id) {
            case 1: // UE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.ue = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException();
                struct.ue.read(iprot);
                struct.setUeIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 2: // SE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
                struct.se.read(iprot);
                struct.setSeIsSet(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, publish_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.ue != null) {
          oprot.writeFieldBegin(UE_FIELD_DESC);
          struct.ue.write(oprot);
          oprot.writeFieldEnd();
        }
        if (struct.se != null) {
          oprot.writeFieldBegin(SE_FIELD_DESC);
          struct.se.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class publish_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<publish_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, publish_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.isSetUe()) {
          optionals.set(0);
        }
        if (struct.isSetSe()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetUe()) {
          struct.ue.write(oprot);
        }
        if (struct.isSetSe()) {
          struct.se.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, publish_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(2);
        if (incoming.get(0)) {
          struct.ue = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftUndefinedEventTypeException();
          struct.ue.read(iprot);
          struct.setUeIsSet(true);
        }
        if (incoming.get(1)) {
          struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
          struct.se.read(iprot);
          struct.setSeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 deleteStreamById_args implements org.apache.thrift.TBase<deleteStreamById_args, deleteStreamById_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteStreamById_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteStreamById_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.protocol.TField STREAM_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("streamId", org.apache.thrift.protocol.TType.STRING, (short)2);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String sessionId; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamId; // 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"),
      STREAM_ID((short)2, "streamId");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SESSION_ID
            return SESSION_ID;
          case 2: // STREAM_ID
            return STREAM_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.
       */
      @org.apache.thrift.annotation.Nullable
      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)));
      tmpMap.put(_Fields.STREAM_ID, new org.apache.thrift.meta_data.FieldMetaData("streamId", 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(deleteStreamById_args.class, metaDataMap);
    }

    public deleteStreamById_args() {
    }

    public deleteStreamById_args(
      java.lang.String sessionId,
      java.lang.String streamId)
    {
      this();
      this.sessionId = sessionId;
      this.streamId = streamId;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteStreamById_args(deleteStreamById_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
      if (other.isSetStreamId()) {
        this.streamId = other.streamId;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public deleteStreamById_args setSessionId(@org.apache.thrift.annotation.Nullable 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;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamId() {
      return this.streamId;
    }

    public deleteStreamById_args setStreamId(@org.apache.thrift.annotation.Nullable java.lang.String streamId) {
      this.streamId = streamId;
      return this;
    }

    public void unsetStreamId() {
      this.streamId = null;
    }

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

    public void setStreamIdIsSet(boolean value) {
      if (!value) {
        this.streamId = null;
      }
    }

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

      case STREAM_ID:
        if (value == null) {
          unsetStreamId();
        } else {
          setStreamId((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      case STREAM_ID:
        return getStreamId();

      }
      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();
      case STREAM_ID:
        return isSetStreamId();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(deleteStreamById_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;
      }

      boolean this_present_streamId = true && this.isSetStreamId();
      boolean that_present_streamId = true && that.isSetStreamId();
      if (this_present_streamId || that_present_streamId) {
        if (!(this_present_streamId && that_present_streamId))
          return false;
        if (!this.streamId.equals(that.streamId))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetStreamId()) ? 131071 : 524287);
      if (isSetStreamId())
        hashCode = hashCode * 8191 + streamId.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSessionId(), other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamId(), other.isSetStreamId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamId, other.streamId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("deleteStreamById_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamId:");
      if (this.streamId == null) {
        sb.append("null");
      } else {
        sb.append(this.streamId);
      }
      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 deleteStreamById_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public deleteStreamById_argsStandardScheme getScheme() {
        return new deleteStreamById_argsStandardScheme();
      }
    }

    private static class deleteStreamById_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteStreamById_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, deleteStreamById_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;
            case 2: // STREAM_ID
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamId = iprot.readString();
                struct.setStreamIdIsSet(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, deleteStreamById_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();
        }
        if (struct.streamId != null) {
          oprot.writeFieldBegin(STREAM_ID_FIELD_DESC);
          oprot.writeString(struct.streamId);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class deleteStreamById_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteStreamById_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, deleteStreamById_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);
        }
        if (struct.isSetStreamId()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSessionId()) {
          oprot.writeString(struct.sessionId);
        }
        if (struct.isSetStreamId()) {
          oprot.writeString(struct.streamId);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, deleteStreamById_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(2);
        if (incoming.get(0)) {
          struct.sessionId = iprot.readString();
          struct.setSessionIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.streamId = iprot.readString();
          struct.setStreamIdIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 deleteStreamById_result implements org.apache.thrift.TBase<deleteStreamById_result, deleteStreamById_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteStreamById_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteStreamById_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField SE_FIELD_DESC = new org.apache.thrift.protocol.TField("se", org.apache.thrift.protocol.TType.STRUCT, (short)1);

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

    public boolean success; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se; // 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"),
      SE((short)1, "se");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // SE
            return SE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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 __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.SE, new org.apache.thrift.meta_data.FieldMetaData("se", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteStreamById_result.class, metaDataMap);
    }

    public deleteStreamById_result() {
    }

    public deleteStreamById_result(
      boolean success,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.se = se;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteStreamById_result(deleteStreamById_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetSe()) {
        this.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException(other.se);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public deleteStreamById_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException getSe() {
      return this.se;
    }

    public deleteStreamById_result setSe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
      this.se = se;
      return this;
    }

    public void unsetSe() {
      this.se = null;
    }

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

    public void setSeIsSet(boolean value) {
      if (!value) {
        this.se = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Boolean)value);
        }
        break;

      case SE:
        if (value == null) {
          unsetSe();
        } else {
          setSe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSuccess();

      case SE:
        return getSe();

      }
      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();
      case SE:
        return isSetSe();
      }
      throw new java.lang.IllegalStateException();
    }

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

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

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

      boolean this_present_se = true && this.isSetSe();
      boolean that_present_se = true && that.isSetSe();
      if (this_present_se || that_present_se) {
        if (!(this_present_se && that_present_se))
          return false;
        if (!this.se.equals(that.se))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetSe()) ? 131071 : 524287);
      if (isSetSe())
        hashCode = hashCode * 8191 + se.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSe(), other.isSetSe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.se, other.se);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("deleteStreamById_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("se:");
      if (this.se == null) {
        sb.append("null");
      } else {
        sb.append(this.se);
      }
      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 deleteStreamById_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public deleteStreamById_resultStandardScheme getScheme() {
        return new deleteStreamById_resultStandardScheme();
      }
    }

    private static class deleteStreamById_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteStreamById_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, deleteStreamById_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.BOOL) {
                struct.success = iprot.readBool();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // SE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
                struct.se.read(iprot);
                struct.setSeIsSet(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, deleteStreamById_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeBool(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.se != null) {
          oprot.writeFieldBegin(SE_FIELD_DESC);
          struct.se.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class deleteStreamById_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteStreamById_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, deleteStreamById_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);
        }
        if (struct.isSetSe()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeBool(struct.success);
        }
        if (struct.isSetSe()) {
          struct.se.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, deleteStreamById_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(2);
        if (incoming.get(0)) {
          struct.success = iprot.readBool();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
          struct.se.read(iprot);
          struct.setSeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 deleteStreamByNameVersion_args implements org.apache.thrift.TBase<deleteStreamByNameVersion_args, deleteStreamByNameVersion_args._Fields>, java.io.Serializable, Cloneable, Comparable<deleteStreamByNameVersion_args>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteStreamByNameVersion_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.protocol.TField STREAM_NAME_FIELD_DESC = new org.apache.thrift.protocol.TField("streamName", org.apache.thrift.protocol.TType.STRING, (short)2);
    private static final org.apache.thrift.protocol.TField STREAM_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("streamVersion", org.apache.thrift.protocol.TType.STRING, (short)3);

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

    public @org.apache.thrift.annotation.Nullable java.lang.String sessionId; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamName; // required
    public @org.apache.thrift.annotation.Nullable java.lang.String streamVersion; // 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"),
      STREAM_NAME((short)2, "streamName"),
      STREAM_VERSION((short)3, "streamVersion");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 1: // SESSION_ID
            return SESSION_ID;
          case 2: // STREAM_NAME
            return STREAM_NAME;
          case 3: // STREAM_VERSION
            return STREAM_VERSION;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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)));
      tmpMap.put(_Fields.STREAM_NAME, new org.apache.thrift.meta_data.FieldMetaData("streamName", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
      tmpMap.put(_Fields.STREAM_VERSION, new org.apache.thrift.meta_data.FieldMetaData("streamVersion", 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(deleteStreamByNameVersion_args.class, metaDataMap);
    }

    public deleteStreamByNameVersion_args() {
    }

    public deleteStreamByNameVersion_args(
      java.lang.String sessionId,
      java.lang.String streamName,
      java.lang.String streamVersion)
    {
      this();
      this.sessionId = sessionId;
      this.streamName = streamName;
      this.streamVersion = streamVersion;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteStreamByNameVersion_args(deleteStreamByNameVersion_args other) {
      if (other.isSetSessionId()) {
        this.sessionId = other.sessionId;
      }
      if (other.isSetStreamName()) {
        this.streamName = other.streamName;
      }
      if (other.isSetStreamVersion()) {
        this.streamVersion = other.streamVersion;
      }
    }

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

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

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getSessionId() {
      return this.sessionId;
    }

    public deleteStreamByNameVersion_args setSessionId(@org.apache.thrift.annotation.Nullable 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;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamName() {
      return this.streamName;
    }

    public deleteStreamByNameVersion_args setStreamName(@org.apache.thrift.annotation.Nullable java.lang.String streamName) {
      this.streamName = streamName;
      return this;
    }

    public void unsetStreamName() {
      this.streamName = null;
    }

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

    public void setStreamNameIsSet(boolean value) {
      if (!value) {
        this.streamName = null;
      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.String getStreamVersion() {
      return this.streamVersion;
    }

    public deleteStreamByNameVersion_args setStreamVersion(@org.apache.thrift.annotation.Nullable java.lang.String streamVersion) {
      this.streamVersion = streamVersion;
      return this;
    }

    public void unsetStreamVersion() {
      this.streamVersion = null;
    }

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

    public void setStreamVersionIsSet(boolean value) {
      if (!value) {
        this.streamVersion = null;
      }
    }

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

      case STREAM_NAME:
        if (value == null) {
          unsetStreamName();
        } else {
          setStreamName((java.lang.String)value);
        }
        break;

      case STREAM_VERSION:
        if (value == null) {
          unsetStreamVersion();
        } else {
          setStreamVersion((java.lang.String)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SESSION_ID:
        return getSessionId();

      case STREAM_NAME:
        return getStreamName();

      case STREAM_VERSION:
        return getStreamVersion();

      }
      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();
      case STREAM_NAME:
        return isSetStreamName();
      case STREAM_VERSION:
        return isSetStreamVersion();
      }
      throw new java.lang.IllegalStateException();
    }

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

    public boolean equals(deleteStreamByNameVersion_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;
      }

      boolean this_present_streamName = true && this.isSetStreamName();
      boolean that_present_streamName = true && that.isSetStreamName();
      if (this_present_streamName || that_present_streamName) {
        if (!(this_present_streamName && that_present_streamName))
          return false;
        if (!this.streamName.equals(that.streamName))
          return false;
      }

      boolean this_present_streamVersion = true && this.isSetStreamVersion();
      boolean that_present_streamVersion = true && that.isSetStreamVersion();
      if (this_present_streamVersion || that_present_streamVersion) {
        if (!(this_present_streamVersion && that_present_streamVersion))
          return false;
        if (!this.streamVersion.equals(that.streamVersion))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetStreamName()) ? 131071 : 524287);
      if (isSetStreamName())
        hashCode = hashCode * 8191 + streamName.hashCode();

      hashCode = hashCode * 8191 + ((isSetStreamVersion()) ? 131071 : 524287);
      if (isSetStreamVersion())
        hashCode = hashCode * 8191 + streamVersion.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSessionId(), other.isSetSessionId());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSessionId()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.sessionId, other.sessionId);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamName(), other.isSetStreamName());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamName()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamName, other.streamName);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetStreamVersion(), other.isSetStreamVersion());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetStreamVersion()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.streamVersion, other.streamVersion);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("deleteStreamByNameVersion_args(");
      boolean first = true;

      sb.append("sessionId:");
      if (this.sessionId == null) {
        sb.append("null");
      } else {
        sb.append(this.sessionId);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamName:");
      if (this.streamName == null) {
        sb.append("null");
      } else {
        sb.append(this.streamName);
      }
      first = false;
      if (!first) sb.append(", ");
      sb.append("streamVersion:");
      if (this.streamVersion == null) {
        sb.append("null");
      } else {
        sb.append(this.streamVersion);
      }
      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 deleteStreamByNameVersion_argsStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public deleteStreamByNameVersion_argsStandardScheme getScheme() {
        return new deleteStreamByNameVersion_argsStandardScheme();
      }
    }

    private static class deleteStreamByNameVersion_argsStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteStreamByNameVersion_args> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, deleteStreamByNameVersion_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;
            case 2: // STREAM_NAME
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamName = iprot.readString();
                struct.setStreamNameIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 3: // STREAM_VERSION
              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
                struct.streamVersion = iprot.readString();
                struct.setStreamVersionIsSet(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, deleteStreamByNameVersion_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();
        }
        if (struct.streamName != null) {
          oprot.writeFieldBegin(STREAM_NAME_FIELD_DESC);
          oprot.writeString(struct.streamName);
          oprot.writeFieldEnd();
        }
        if (struct.streamVersion != null) {
          oprot.writeFieldBegin(STREAM_VERSION_FIELD_DESC);
          oprot.writeString(struct.streamVersion);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class deleteStreamByNameVersion_argsTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteStreamByNameVersion_args> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, deleteStreamByNameVersion_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);
        }
        if (struct.isSetStreamName()) {
          optionals.set(1);
        }
        if (struct.isSetStreamVersion()) {
          optionals.set(2);
        }
        oprot.writeBitSet(optionals, 3);
        if (struct.isSetSessionId()) {
          oprot.writeString(struct.sessionId);
        }
        if (struct.isSetStreamName()) {
          oprot.writeString(struct.streamName);
        }
        if (struct.isSetStreamVersion()) {
          oprot.writeString(struct.streamVersion);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, deleteStreamByNameVersion_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.sessionId = iprot.readString();
          struct.setSessionIdIsSet(true);
        }
        if (incoming.get(1)) {
          struct.streamName = iprot.readString();
          struct.setStreamNameIsSet(true);
        }
        if (incoming.get(2)) {
          struct.streamVersion = iprot.readString();
          struct.setStreamVersionIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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 deleteStreamByNameVersion_result implements org.apache.thrift.TBase<deleteStreamByNameVersion_result, deleteStreamByNameVersion_result._Fields>, java.io.Serializable, Cloneable, Comparable<deleteStreamByNameVersion_result>   {
    private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("deleteStreamByNameVersion_result");

    private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0);
    private static final org.apache.thrift.protocol.TField SE_FIELD_DESC = new org.apache.thrift.protocol.TField("se", org.apache.thrift.protocol.TType.STRUCT, (short)1);

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

    public boolean success; // required
    public @org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se; // 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"),
      SE((short)1, "se");

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

      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.
       */
      @org.apache.thrift.annotation.Nullable
      public static _Fields findByThriftId(int fieldId) {
        switch(fieldId) {
          case 0: // SUCCESS
            return SUCCESS;
          case 1: // SE
            return SE;
          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.
       */
      @org.apache.thrift.annotation.Nullable
      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 __SUCCESS_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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL)));
      tmpMap.put(_Fields.SE, new org.apache.thrift.meta_data.FieldMetaData("se", org.apache.thrift.TFieldRequirementType.DEFAULT, 
          new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException.class)));
      metaDataMap = java.util.Collections.unmodifiableMap(tmpMap);
      org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(deleteStreamByNameVersion_result.class, metaDataMap);
    }

    public deleteStreamByNameVersion_result() {
    }

    public deleteStreamByNameVersion_result(
      boolean success,
      org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se)
    {
      this();
      this.success = success;
      setSuccessIsSet(true);
      this.se = se;
    }

    /**
     * Performs a deep copy on <i>other</i>.
     */
    public deleteStreamByNameVersion_result(deleteStreamByNameVersion_result other) {
      __isset_bitfield = other.__isset_bitfield;
      this.success = other.success;
      if (other.isSetSe()) {
        this.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException(other.se);
      }
    }

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

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

    public boolean isSuccess() {
      return this.success;
    }

    public deleteStreamByNameVersion_result setSuccess(boolean success) {
      this.success = success;
      setSuccessIsSet(true);
      return this;
    }

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

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

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

    @org.apache.thrift.annotation.Nullable
    public org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException getSe() {
      return this.se;
    }

    public deleteStreamByNameVersion_result setSe(@org.apache.thrift.annotation.Nullable org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException se) {
      this.se = se;
      return this;
    }

    public void unsetSe() {
      this.se = null;
    }

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

    public void setSeIsSet(boolean value) {
      if (!value) {
        this.se = null;
      }
    }

    public void setFieldValue(_Fields field, @org.apache.thrift.annotation.Nullable java.lang.Object value) {
      switch (field) {
      case SUCCESS:
        if (value == null) {
          unsetSuccess();
        } else {
          setSuccess((java.lang.Boolean)value);
        }
        break;

      case SE:
        if (value == null) {
          unsetSe();
        } else {
          setSe((org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException)value);
        }
        break;

      }
    }

    @org.apache.thrift.annotation.Nullable
    public java.lang.Object getFieldValue(_Fields field) {
      switch (field) {
      case SUCCESS:
        return isSuccess();

      case SE:
        return getSe();

      }
      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();
      case SE:
        return isSetSe();
      }
      throw new java.lang.IllegalStateException();
    }

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

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

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

      boolean this_present_se = true && this.isSetSe();
      boolean that_present_se = true && that.isSetSe();
      if (this_present_se || that_present_se) {
        if (!(this_present_se && that_present_se))
          return false;
        if (!this.se.equals(that.se))
          return false;
      }

      return true;
    }

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

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

      hashCode = hashCode * 8191 + ((isSetSe()) ? 131071 : 524287);
      if (isSetSe())
        hashCode = hashCode * 8191 + se.hashCode();

      return hashCode;
    }

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

      int lastComparison = 0;

      lastComparison = java.lang.Boolean.compare(isSetSuccess(), other.isSetSuccess());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSuccess()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, other.success);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      lastComparison = java.lang.Boolean.compare(isSetSe(), other.isSetSe());
      if (lastComparison != 0) {
        return lastComparison;
      }
      if (isSetSe()) {
        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.se, other.se);
        if (lastComparison != 0) {
          return lastComparison;
        }
      }
      return 0;
    }

    @org.apache.thrift.annotation.Nullable
    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("deleteStreamByNameVersion_result(");
      boolean first = true;

      sb.append("success:");
      sb.append(this.success);
      first = false;
      if (!first) sb.append(", ");
      sb.append("se:");
      if (this.se == null) {
        sb.append("null");
      } else {
        sb.append(this.se);
      }
      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 deleteStreamByNameVersion_resultStandardSchemeFactory implements org.apache.thrift.scheme.SchemeFactory {
      public deleteStreamByNameVersion_resultStandardScheme getScheme() {
        return new deleteStreamByNameVersion_resultStandardScheme();
      }
    }

    private static class deleteStreamByNameVersion_resultStandardScheme extends org.apache.thrift.scheme.StandardScheme<deleteStreamByNameVersion_result> {

      public void read(org.apache.thrift.protocol.TProtocol iprot, deleteStreamByNameVersion_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.BOOL) {
                struct.success = iprot.readBool();
                struct.setSuccessIsSet(true);
              } else { 
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
              }
              break;
            case 1: // SE
              if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
                struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
                struct.se.read(iprot);
                struct.setSeIsSet(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, deleteStreamByNameVersion_result struct) throws org.apache.thrift.TException {
        struct.validate();

        oprot.writeStructBegin(STRUCT_DESC);
        if (struct.isSetSuccess()) {
          oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
          oprot.writeBool(struct.success);
          oprot.writeFieldEnd();
        }
        if (struct.se != null) {
          oprot.writeFieldBegin(SE_FIELD_DESC);
          struct.se.write(oprot);
          oprot.writeFieldEnd();
        }
        oprot.writeFieldStop();
        oprot.writeStructEnd();
      }

    }

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

    private static class deleteStreamByNameVersion_resultTupleScheme extends org.apache.thrift.scheme.TupleScheme<deleteStreamByNameVersion_result> {

      @Override
      public void write(org.apache.thrift.protocol.TProtocol prot, deleteStreamByNameVersion_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);
        }
        if (struct.isSetSe()) {
          optionals.set(1);
        }
        oprot.writeBitSet(optionals, 2);
        if (struct.isSetSuccess()) {
          oprot.writeBool(struct.success);
        }
        if (struct.isSetSe()) {
          struct.se.write(oprot);
        }
      }

      @Override
      public void read(org.apache.thrift.protocol.TProtocol prot, deleteStreamByNameVersion_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(2);
        if (incoming.get(0)) {
          struct.success = iprot.readBool();
          struct.setSuccessIsSet(true);
        }
        if (incoming.get(1)) {
          struct.se = new org.wso2.carbon.databridge.commons.thrift.exception.ThriftSessionExpiredException();
          struct.se.read(iprot);
          struct.setSeIsSet(true);
        }
      }
    }

    private static <S extends org.apache.thrift.scheme.IScheme> 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();
    }
  }

}
