Search in sources :

Example 21 with IEventBroker

use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.

the class MailNotification method startup.

public void startup() {
    super.startup();
    IEventBroker eventBroker = this.getRuntime().getEventBroker();
    if (this.m_configuration.getProperty(CONFIG_PRE, "true").equalsIgnoreCase("true"))
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
    if (this.m_configuration.getProperty(CONFIG_OUT, "false").equalsIgnoreCase("true") || this.m_configuration.getProperty(CONFIG_END, "false").equalsIgnoreCase("true"))
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
    if (this.m_configuration.getProperty(CONFIG_MIS, "false").equalsIgnoreCase("true"))
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
    if (this.m_configuration.getProperty(CONFIG_ACC, "false").equalsIgnoreCase("true") || this.m_configuration.getProperty(CONFIG_END, "false").equalsIgnoreCase("true"))
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
    if (this.m_configuration.getProperty(CONFIG_REJ, "false").equalsIgnoreCase("true"))
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
    this.m_logger.info("MailNotification is started ...");
    if (this.m_timer == null) {
        this.m_task = new MailTask();
        this.m_task.setConfiguration(this.m_configuration);
        this.m_timer = new Timer(true);
        this.m_timer.schedule(this.m_task, getQueueTime(), getQueueTime());
    }
}
Also used : Timer(java.util.Timer) IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 22 with IEventBroker

use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.

the class MailNotification method shutdown.

public void shutdown() {
    super.shutdown();
    if (this.m_timer != null) {
        this.m_task.run();
        this.m_task.cancel();
        this.m_timer.cancel();
        this.m_timer = null;
        this.m_task = null;
    }
    IEventBroker eventBroker = this.getRuntime().getEventBroker();
    // if (this.m_configuration.getProperty(CONFIG_PRE, "true").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
    // if (this.m_configuration.getProperty(CONFIG_OUT, "false").equalsIgnoreCase("true") || this.m_configuration.getProperty(CONFIG_END, "false").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
    // if (this.m_configuration.getProperty(CONFIG_OUT, "false").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
    // if (this.m_configuration.getProperty(CONFIG_MIS, "false").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
    // if (this.m_configuration.getProperty(CONFIG_ACC, "false").equalsIgnoreCase("true") || this.m_configuration.getProperty(CONFIG_END, "false").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
    // if (this.m_configuration.getProperty(CONFIG_REJ, "false").equalsIgnoreCase("true"))
    eventBroker.unregister(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
    this.m_logger.info("MailNotification is shut down ...");
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 23 with IEventBroker

use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.

the class MySqlJournal method startup.

@Override
public void startup() {
    super.startup();
    IEventBroker eb = getRuntime().getEventBroker();
    eb.register(this, eb.createEvent(IEventConst.EVENT_TYPE_RETURNED_HIBERNATE));
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 24 with IEventBroker

use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.

the class MySqlJournal method shutdown.

@Override
public void shutdown() {
    IEventBroker eb = getRuntime().getEventBroker();
    eb.register(this, eb.createEvent(IEventConst.EVENT_TYPE_RETURNED_HIBERNATE));
    super.shutdown();
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 25 with IEventBroker

use of de.janrufmonitor.framework.event.IEventBroker in project janrufmonitor by tbrandt77.

the class MySqlAddressbook method shutdown.

@Override
public void shutdown() {
    IEventBroker eb = getRuntime().getEventBroker();
    eb.register(this, eb.createEvent(IEventConst.EVENT_TYPE_RETURNED_HIBERNATE));
    super.shutdown();
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Aggregations

IEventBroker (de.janrufmonitor.framework.event.IEventBroker)52 ICall (de.janrufmonitor.framework.ICall)5 Message (de.janrufmonitor.exception.Message)4 IEvent (de.janrufmonitor.framework.event.IEvent)4 ICaller (de.janrufmonitor.framework.ICaller)3 ICip (de.janrufmonitor.framework.ICip)3 ICallManager (de.janrufmonitor.repository.ICallManager)3 IWriteCallRepository (de.janrufmonitor.repository.types.IWriteCallRepository)3 IOException (java.io.IOException)3 List (java.util.List)3 ICallList (de.janrufmonitor.framework.ICallList)2 IMsn (de.janrufmonitor.framework.IMsn)2 IName (de.janrufmonitor.framework.IName)2 IPhonenumber (de.janrufmonitor.framework.IPhonenumber)2 IReadCallRepository (de.janrufmonitor.repository.types.IReadCallRepository)2 UnsupportedEncodingException (java.io.UnsupportedEncodingException)2 MalformedURLException (java.net.MalformedURLException)2 IAttributeMap (de.janrufmonitor.framework.IAttributeMap)1 FritzBoxCallCsv (de.janrufmonitor.fritzbox.FritzBoxCallCsv)1 FirmwareManager (de.janrufmonitor.fritzbox.firmware.FirmwareManager)1