Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
303 ashish 1
package in.shop2020.thrift.clients;
2
 
3
 
3123 rajveer 4
import in.shop2020.datalogger.DataLogger.Client;
5
import in.shop2020.utils.ConfigClientKeys;
6
 
767 rajveer 7
import org.apache.thrift.TException;
303 ashish 8
import org.apache.thrift.transport.TTransportException;
9
 
3123 rajveer 10
public class DataLoggingClient extends GenericClient{
303 ashish 11
 
3123 rajveer 12
	private Client client = null;
303 ashish 13
 
3123 rajveer 14
	/**
15
	 * 
16
	 * @throws TTransportException
17
	 */
18
	public DataLoggingClient() throws TTransportException{
19
		this(ConfigClientKeys.datalogging_service_local_hostname.toString(), ConfigClientKeys.datalogging_service_local_wrapper_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 DataLoggingClient(String hostConfigKey, String portConfigKey) throws TTransportException{
29
		super(hostConfigKey, portConfigKey);
303 ashish 30
		client = new Client(protocol);
31
	}
32
 
3123 rajveer 33
 
34
	/**
35
	 * Get the client
36
	 * @return
37
	 */
303 ashish 38
	public Client getClient(){
39
		return client;
40
	}
41
 
767 rajveer 42
	@Override
43
	public void closeSession() {
44
		try {
45
			client.closeSession();
46
		} catch (TException e) {
47
			e.printStackTrace();
48
		}
49
	}
3123 rajveer 50
 
303 ashish 51
}
3123 rajveer 52