@Override public String toString() { if (getTopic() .equals(ExtensionEventFactory.buildTopic(ExtensionEventFactory.EXTENSION_INSTALLED_EVENT_TOPIC, id))) { return "Extension '" + id + "' has been installed."; } else if (getTopic().equals( ExtensionEventFactory.buildTopic(ExtensionEventFactory.EXTENSION_UNINSTALLED_EVENT_TOPIC, id))) { return "Extension '" + id + "' has been uninstalled."; } else { return id + ": " + (msg != null ? msg : "Operation failed."); } } }
/** * Creates an "extension installed" event. * * @param id the id of the installed extension * @return the according event */ public static ExtensionEvent createExtensionInstalledEvent(String id) { String topic = buildTopic(EXTENSION_INSTALLED_EVENT_TOPIC, id); String payload = serializePayload(id); return new ExtensionEvent(topic, payload, id); }
/** * Creates an "extension failure" event. * * @param id the id of the extension that caused a failure * @param msg the message text of the failure * @return the according event */ public static ExtensionEvent createExtensionFailureEvent(String id, String msg) { String topic = buildTopic(EXTENSION_FAILURE_EVENT_TOPIC, id); String[] properties = new String[] { id, msg }; String payload = serializePayload(properties); return new ExtensionEvent(topic, payload, id, msg); }
/** * Creates an "extension uninstalled" event. * * @param id the id of the uninstalled extension * @return the according event */ public static ExtensionEvent createExtensionUninstalledEvent(String id) { String topic = buildTopic(EXTENSION_UNINSTALLED_EVENT_TOPIC, id); String payload = serializePayload(id); return new ExtensionEvent(topic, payload, id); }
@Override public String toString() { if (getTopic() .equals(ExtensionEventFactory.buildTopic(ExtensionEventFactory.EXTENSION_INSTALLED_EVENT_TOPIC, id))) { return "Extension '" + id + "' has been installed."; } else if (getTopic().equals( ExtensionEventFactory.buildTopic(ExtensionEventFactory.EXTENSION_UNINSTALLED_EVENT_TOPIC, id))) { return "Extension '" + id + "' has been uninstalled."; } else { return id + ": " + (msg != null ? msg : "Operation failed."); } } }
/** * Creates an "extension uninstalled" event. * * @param id the id of the uninstalled extension * @return the according event */ public static ExtensionEvent createExtensionUninstalledEvent(String id) { String topic = buildTopic(EXTENSION_UNINSTALLED_EVENT_TOPIC, id); String payload = serializePayload(id); return new ExtensionEvent(topic, payload, id); }
/** * Creates an "extension installed" event. * * @param id the id of the installed extension * @return the according event */ public static ExtensionEvent createExtensionInstalledEvent(String id) { String topic = buildTopic(EXTENSION_INSTALLED_EVENT_TOPIC, id); String payload = serializePayload(id); return new ExtensionEvent(topic, payload, id); }
/** * Creates an "extension failure" event. * * @param id the id of the extension that caused a failure * @param msg the message text of the failure * @return the according event */ public static ExtensionEvent createExtensionFailureEvent(String id, String msg) { String topic = buildTopic(EXTENSION_FAILURE_EVENT_TOPIC, id); String[] properties = new String[] { id, msg }; String payload = serializePayload(properties); return new ExtensionEvent(topic, payload, id, msg); }