Class CGThriftClient
- java.lang.Object
-
- org.wso2.carbon.cloud.gateway.common.thrift.CGThriftClient
-
public class CGThriftClient extends Object
A wrapper client for the native thrift client
-
-
Constructor Summary
Constructors Constructor Description CGThriftClient(CloudGatewayService.Client client)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Message>
exchange(List<Message> src, int size, String token)
The exchange operation, this will pass the response buffer to the server and will receive request buffer from the serverString
login(String userName, String passWord, String queueName)
The login method.
-
-
-
Constructor Detail
-
CGThriftClient
public CGThriftClient(CloudGatewayService.Client 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 userpassWord
- pass word of the userqueueName
- the buffer name to which user should allow access to- Returns:
- token for exchange operation
- Throws:
NotAuthorizedException
- in case of user is not allowedorg.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 serversize
- the size of the request message block that server should returntoken
- the token for successive exchange operations- Returns:
- the request buffer from server
- Throws:
NotAuthorizedException
- in case the token in invalidorg.apache.thrift.TException
- throws in case of an error
-
-