package eu.dnetlib.common.nh;

import eu.dnetlib.enabling.tools.blackboard.AbstractBlackboardNotificationHandler;
import eu.dnetlib.enabling.tools.blackboard.BlackboardServerHandler;



/**
 * @author jochen
 *
 * @param <T> jobHandler
 */
public abstract class AbstractDataCollectiveServiceNotificationHandler<T> extends	AbstractBlackboardNotificationHandler<BlackboardServerHandler> {

	protected T jobHandler;
	private String topicPrefix;

	public void notified(String subscrId, String topic, String rsId, String msg) {
		if (!topic.startsWith(topicPrefix)){
			return;
		}
		super.notified(subscrId, topic, rsId, msg);
	}

	public void setJobHandler(final T aJobHandler){
		this.jobHandler = aJobHandler;
	}
	
	public T getJobHandler(){
		return jobHandler;
	}

	/**
	 * @param topicPrefix the topicPrefix to set
	 */
	public void setTopicPrefix(String topicPrefix) {
		this.topicPrefix = topicPrefix;
	}

	/**
	 * @return the topicPrefix
	 */
	public String getTopicPrefix() {
		return topicPrefix;
	}

}
