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;
}
}
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);
}
}
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);
}
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);
}
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);
}
Aggregations