package eu.socialsensor.framework.client.search;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
import redis.clients.jedis.JedisPoolConfig;

public class MediaSearcher {

	public static final String CHANNEL = "searchRequestsChannel";
	
	private Jedis publisherJedis;
	
	public MediaSearcher(String searcherHostname) {
		JedisPoolConfig poolConfig = new JedisPoolConfig();
        JedisPool jedisPool = new JedisPool(poolConfig, searcherHostname, 6379, 0);
        
        this.publisherJedis = jedisPool.getResource();
        
	}
	
	public void search(String message) {
		publisherJedis.publish(CHANNEL, message);
	}
	
	public void delete(String message){
		publisherJedis.publish(CHANNEL, message);
	}

}

@@ -43,16 +43,49 @@
 earch;%0A%0A
+import org.apache.log4j.Logger;%0A%0A
 import r
@@ -223,16 +223,85 @@
 cher %7B%0A%0A
+%09public final Logger logger = Logger.getLogger(MediaSearcher.class);%0A
 %09public 
@@ -693,16 +693,25 @@
 sage) %7B%0A
+%09%09try %7B%0A%09
 %09%09publis
@@ -746,16 +746,67 @@
 ssage);%0A
+%09%09%7D%0A%09%09catch(Exception e) %7B%0A%09%09%09logger.error(e);%0A%09%09%7D%0A
 %09%7D%0A%09%0A%09pu
@@ -837,18 +837,28 @@
 message)
+ 
 %7B%0A
+%09%09try %7B%0A%09
 %09%09publis
@@ -893,14 +893,65 @@
 ssage);%0A
+%09%09%7D%0A%09%09catch(Exception e) %7B%0A%09%09%09logger.error(e);%0A%09%09%7D%0A
 %09%7D%0A%0A%7D%0A

Add logging in MediaSearcher client