Search in sources :

Example 26 with Event

use of org.eclipse.smarthome.core.events.Event in project smarthome by eclipse.

the class ExtensionEventFactory method createEventByType.

@Override
protected Event createEventByType(String eventType, String topic, String payload, String source) throws Exception {
    if (topic.endsWith(EXTENSION_FAILURE_EVENT_TOPIC_POSTFIX)) {
        String[] properties = deserializePayload(payload, String[].class);
        Event event = new ExtensionEvent(topic, payload, properties[0], properties[1]);
        return event;
    } else {
        String id = deserializePayload(payload, String.class);
        Event event = new ExtensionEvent(topic, payload, id);
        return event;
    }
}
Also used : Event(org.eclipse.smarthome.core.events.Event)

Example 27 with Event

use of org.eclipse.smarthome.core.events.Event in project smarthome by eclipse.

the class ExtensionResource method postFailureEvent.

private void postFailureEvent(String extensionId, String msg) {
    if (eventPublisher != null) {
        Event event = ExtensionEventFactory.createExtensionFailureEvent(extensionId, msg);
        eventPublisher.post(event);
    }
}
Also used : Event(org.eclipse.smarthome.core.events.Event)

Example 28 with Event

use of org.eclipse.smarthome.core.events.Event in project smarthome by eclipse.

the class MarketplaceExtensionService method postFailureEvent.

private void postFailureEvent(String extensionId, String msg) {
    Event event = ExtensionEventFactory.createExtensionFailureEvent(extensionId, msg);
    eventPublisher.post(event);
}
Also used : Event(org.eclipse.smarthome.core.events.Event)

Example 29 with Event

use of org.eclipse.smarthome.core.events.Event in project smarthome by eclipse.

the class MarketplaceExtensionService method postInstalledEvent.

private void postInstalledEvent(String extensionId) {
    Event event = ExtensionEventFactory.createExtensionInstalledEvent(extensionId);
    eventPublisher.post(event);
}
Also used : Event(org.eclipse.smarthome.core.events.Event)

Example 30 with Event

use of org.eclipse.smarthome.core.events.Event in project smarthome by eclipse.

the class MarketplaceExtensionService method postUninstalledEvent.

private void postUninstalledEvent(String extensionId) {
    Event event = ExtensionEventFactory.createExtensionUninstalledEvent(extensionId);
    eventPublisher.post(event);
}
Also used : Event(org.eclipse.smarthome.core.events.Event)

Aggregations

Event (org.eclipse.smarthome.core.events.Event)30 JavaOSGiTest (org.eclipse.smarthome.test.java.JavaOSGiTest)19 Test (org.junit.Test)19 EventSubscriber (org.eclipse.smarthome.core.events.EventSubscriber)15 EventPublisher (org.eclipse.smarthome.core.events.EventPublisher)14 Set (java.util.Set)13 EventFilter (org.eclipse.smarthome.core.events.EventFilter)13 LinkedList (java.util.LinkedList)11 Collections (java.util.Collections)9 HashSet (java.util.HashSet)9 List (java.util.List)8 Collectors (java.util.stream.Collectors)8 Ignore (org.junit.Ignore)8 GroupFunctionHelper (org.eclipse.smarthome.core.internal.items.GroupFunctionHelper)7 ItemStateConverterImpl (org.eclipse.smarthome.core.internal.items.ItemStateConverterImpl)7 GroupItemStateChangedEvent (org.eclipse.smarthome.core.items.events.GroupItemStateChangedEvent)7 ItemUpdatedEvent (org.eclipse.smarthome.core.items.events.ItemUpdatedEvent)7 SwitchItem (org.eclipse.smarthome.core.library.items.SwitchItem)7 OnOffType (org.eclipse.smarthome.core.library.types.OnOffType)7 StringType (org.eclipse.smarthome.core.library.types.StringType)7