Package eu.dnetlib.broker.events.output
Class AbstractNotificationDispatcher<T>
java.lang.Object
eu.dnetlib.broker.events.output.AbstractNotificationDispatcher<T>
- All Implemented Interfaces:
NotificationDispatcher,Runnable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware
- Direct Known Subclasses:
AlertRemoteApiDispatcher,EmailDispatcher,MockDispatcher
public abstract class AbstractNotificationDispatcher<T>
extends Object
implements NotificationDispatcher, org.springframework.beans.factory.BeanNameAware, Runnable
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongcount()longvoidinit()protected abstract voidperformAction(T message) protected abstract TprepareAction(Subscription subscription, Event... events) protected abstract TprepareAction(Subscription subscription, Map<String, Object> params) voidvoidrun()voidsendNotification(Subscription subscription, Event... events) voidsendNotification(Subscription subscription, Map<String, Object> params) voidsetBeanName(String name) voidsetDispatcherName(String dispatcherName) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.dnetlib.broker.events.output.NotificationDispatcher
getMode
-
Constructor Details
-
AbstractNotificationDispatcher
public AbstractNotificationDispatcher()
-
-
Method Details
-
init
-
run
public void run() -
sendNotification
- Specified by:
sendNotificationin interfaceNotificationDispatcher
-
sendNotification
- Specified by:
sendNotificationin interfaceNotificationDispatcher
-
prepareAction
protected abstract T prepareAction(Subscription subscription, Map<String, Object> params) throws Exception- Throws:
Exception
-
prepareAction
- Throws:
Exception
-
performAction
- Throws:
Exception
-
getDispatcherName
- Specified by:
getDispatcherNamein interfaceNotificationDispatcher
-
setDispatcherName
-
count
public long count()- Specified by:
countin interfaceNotificationDispatcher
-
countErrors
public long countErrors()- Specified by:
countErrorsin interfaceNotificationDispatcher
-
lastError
- Specified by:
lastErrorin interfaceNotificationDispatcher
-
resetCount
public void resetCount()- Specified by:
resetCountin interfaceNotificationDispatcher
-
setBeanName
- Specified by:
setBeanNamein interfaceorg.springframework.beans.factory.BeanNameAware
-