Class CGThriftClient


  • public class CGThriftClient
    extends Object
    A wrapper client for the native thrift client
    • Method Detail

      • login

        public String login​(String userName,
                            String passWord,
                            String queueName)
                     throws NotAuthorizedException,
                            org.apache.thrift.TException
        The login method. Returns a token for exchange operation upon successful login or throws an exception in case of an error
        Parameters:
        userName - user name of the user
        passWord - pass word of the user
        queueName - the buffer name to which user should allow access to
        Returns:
        token for exchange operation
        Throws:
        NotAuthorizedException - in case of user is not allowed
        org.apache.thrift.TException - in case of an connection error
      • exchange

        public List<Message> exchange​(List<Message> src,
                                      int size,
                                      String token)
                               throws NotAuthorizedException,
                                      org.apache.thrift.TException
        The exchange operation, this will pass the response buffer to the server and will receive request buffer from the server
        Parameters:
        src - the response buffer to pass to the server
        size - the size of the request message block that server should return
        token - the token for successive exchange operations
        Returns:
        the request buffer from server
        Throws:
        NotAuthorizedException - in case the token in invalid
        org.apache.thrift.TException - throws in case of an error