Subversion Repositories SmartDukaan

Rev

Rev 1986 | Details | Compare with Previous | Last modification | View Log | RSS feed

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