/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package eu.dnetlib.functionality.webInterface.app;

import eu.dnetlib.domain.enabling.Notification;
import gr.uoa.di.driver.enabling.issn.NotificationListener;
import gr.uoa.di.driver.xml.WebInterfaceLayoutXmlConverter;

import org.apache.log4j.Logger;

/**
 *
 * @author alexm
 */
public class LayoutNotifier implements NotificationListener {

    static Logger logger = Logger.getLogger( LayoutNotifier.class );
    
    private WebInterfaceLayoutXmlConverter xmlConverter;

    public LayoutNotifier() {
        try {
            xmlConverter = new WebInterfaceLayoutXmlConverter();
        } catch ( javax.xml.bind.JAXBException e ) {
            logger.error( e );
            xmlConverter = null;
        }
    }

    public void processNotification( Notification notification ) {
        logger.debug( "notification has arrived and being processed. Notification topic: "
						+ notification.getTopic() + "\n" );        
        if ( xmlConverter == null ) {
            logger.error( "Can not process notification, xml converter is not working" );
            return;
        }
    }
}
