Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

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