package eu.dnetlib.functionality.index;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Required;

import eu.dnetlib.enabling.tools.AbstractBaseService;
import eu.dnetlib.enabling.tools.blackboard.NotificationHandler;
import eu.dnetlib.functionality.index.rmi.IndexService;

public class IndexServiceMockImpl extends AbstractBaseService implements IndexService {
	/**
	 * logger.
	 */
	private static final Log log = LogFactory.getLog(IndexServiceMockImpl.class); // NOPMD by marko on 11/24/08 5:02 PM

	/**
	 * notification handler.
	 */
	private NotificationHandler notificationHandler;

	/**
	 * {@inheritDoc}
	 * @see eu.dnetlib.enabling.tools.AbstractBaseService#notify(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
	 */
	@Override
	public void notify(String subscriptionId, String topic, String isId, String message) {
		log.info("mock index: " + message);

		getNotificationHandler().notified(subscriptionId, topic, isId, message);

	}

	public NotificationHandler getNotificationHandler() {
		return notificationHandler;
	}

	@Required
	public void setNotificationHandler(NotificationHandler notificationHandler) {
		this.notificationHandler = notificationHandler;
	}

}
