Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
14372 kshitij.so 1
package in.shop2020.thrift.clients;
2
 
3
import in.shop2020.model.v1.dtr.DtrService.Client;
4
import in.shop2020.utils.ConfigClientKeys;
5
 
6
import org.apache.thrift.TException;
7
import org.apache.thrift.transport.TTransportException;
8
 
9
public class DtrClient extends GenericClient{
10
 
11
	private Client client = null;
12
 
13
	/**
14
	 * 
15
	 * @throws TTransportException
16
	 */
17
	public DtrClient() throws TTransportException{
18
		this(ConfigClientKeys.dtr_service_server_host.toString(), ConfigClientKeys.dtr_service_server_port.toString());
19
	}
20
 
21
	/**
22
	 * get the client for given hostkey and portkey
23
	 * @param hostConfigKey
24
	 * @param portConfigKey
25
	 * @throws TTransportException
26
	 */
27
	public DtrClient(String hostConfigKey, String portConfigKey) throws TTransportException{
28
		super(hostConfigKey, portConfigKey);
29
		client = new Client(protocol);
30
	}
31
 
32
 
33
	/**
34
	 * Get the client
35
	 * @return
36
	 */
37
	public Client getClient(){
38
		return client;
39
	}
40
 
41
	@Override
42
	public void closeSession() {
43
		try {
44
			client.closeSession();
45
		} catch (TException e) {
46
			e.printStackTrace();
47
		}
48
	}
49
 
50
}