Search in sources :

Example 1 with IEventBroker

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

the class ApplicationReady method handleWithException.

public void handleWithException(IHttpRequest req, IMutableHttpResponse resp) throws HandlerException {
    try {
        IEventBroker evb = this.getRuntime().getEventBroker();
        evb.register(this);
        evb.send(this, evb.createEvent(IEventConst.EVENT_TYPE_APPLICATION_READY));
        this.m_logger.info("Send application ready event.");
        evb.unregister(this);
        resp.getContentStreamForWrite().close();
    } catch (Exception e) {
        throw new HandlerException(e.getMessage(), 500);
    }
}
Also used : HandlerException(de.janrufmonitor.service.commons.http.handler.HandlerException) IEventBroker(de.janrufmonitor.framework.event.IEventBroker) HandlerException(de.janrufmonitor.service.commons.http.handler.HandlerException)

Example 2 with IEventBroker

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

the class HtmlCallManager method startup.

public void startup() {
    super.startup();
    IEventBroker b = this.getRuntime().getEventBroker();
    b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
    b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
    b.register(this, b.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
    if (this.m_callList == null)
        this.m_callList = getRuntime().getCallFactory().createCallList();
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 3 with IEventBroker

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

the class HtmlCallManager method shutdown.

public void shutdown() {
    super.shutdown();
    IEventBroker b = this.getRuntime().getEventBroker();
    b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED));
    b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLCLEARED));
    b.unregister(this, b.createEvent(IEventConst.EVENT_TYPE_CALLREJECTED));
// this.saveDatabase();
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 4 with IEventBroker

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

the class DefaultCallDialogService method startup.

public void startup() {
    super.startup();
    IEventBroker eventBroker = this.getRuntime().getEventBroker();
    eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
    if (isDetectOutgoing())
        eventBroker.register(this, eventBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_OUTGOING_CALL));
    this.m_logger.info("DefaultCallDialogService is started ...");
}
Also used : IEventBroker(de.janrufmonitor.framework.event.IEventBroker)

Example 5 with IEventBroker

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

the class CallSimulator method sendAcceptEvent.

protected void sendAcceptEvent() {
    if (this.m_currentIdentifiedCall != null) {
        IEventBroker evtBroker = this.getRuntime().getEventBroker();
        evtBroker.register(this);
        this.m_currentIdentifiedCall.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_REASON, Integer.toString(IEventConst.EVENT_TYPE_CALLACCEPTED)));
        this.m_currentIdentifiedCall.setAttribute(this.getRuntime().getCallFactory().createAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS, IJAMConst.ATTRIBUTE_VALUE_ACCEPTED));
        IEvent ev = evtBroker.createEvent(IEventConst.EVENT_TYPE_CALLACCEPTED, this.m_currentIdentifiedCall);
        evtBroker.send(this, ev);
        evtBroker.unregister(this);
        evtBroker.unregister(this, evtBroker.createEvent(IEventConst.EVENT_TYPE_IDENTIFIED_CALL));
    }
}
Also used : IEvent(de.janrufmonitor.framework.event.IEvent) 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