package eu.socialsensor.framework.client.search;

import org.apache.log4j.Logger;

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

public class MediaSearcher {

	public final Logger logger = Logger.getLogger(MediaSearcher.class);
	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) {
		try {
			publisherJedis.publish(CHANNEL, message);
		}
		catch(Exception e) {
			logger.error(e);
		}
	}
	
	public void delete(String message) {
		try {
			publisherJedis.publish(CHANNEL, message);
		}
		catch(Exception e) {
			logger.error(e);
		}
	}

	public void search(String message, String channel) {
		try {
			publisherJedis.publish(channel, message);
		}
		catch(Exception e) {
			logger.error(e);
		}
	}
	
	public void delete(String message, String channel) {
		try {
			publisherJedis.publish(channel, message);
		}
		catch(Exception e) {
			logger.error(e);
		}
	}
	
}

@@ -756,32 +756,56 @@
 (Exception e) %7B%0A
+%09%09%09e.printStackTrace();%0A
 %09%09%09logger.error(
@@ -800,32 +800,32 @@
 ogger.error(e);%0A
-
 %09%09%7D%0A%09%7D%0A%09%0A%09public
@@ -927,32 +927,56 @@
 (Exception e) %7B%0A
+%09%09%09e.printStackTrace();%0A
 %09%09%09logger.error(
@@ -1113,32 +1113,56 @@
 (Exception e) %7B%0A
+%09%09%09e.printStackTrace();%0A
 %09%09%09logger.error(
@@ -1277,32 +1277,32 @@
 , message);%0A%09%09%7D%0A
-
 %09%09catch(Exceptio
@@ -1308,16 +1308,40 @@
 on e) %7B%0A
+%09%09%09e.printStackTrace();%0A
 %09%09%09logge

Add printStackTrace in MediaSearcher