use of org.eclipse.smarthome.extensionservice.marketplace.MarketplaceExtensionHandler in project smarthome by eclipse.
the class MarketplaceExtensionService method install.
@Override
public void install(String extensionId) {
Extension ext = getExtension(extensionId, null);
if (ext instanceof MarketplaceExtension) {
MarketplaceExtension mpExt = (MarketplaceExtension) ext;
for (MarketplaceExtensionHandler handler : extensionHandlers) {
if (handler.supports(mpExt)) {
if (!handler.isInstalled(mpExt)) {
try {
handler.install(mpExt);
postInstalledEvent(extensionId);
} catch (MarketplaceHandlerException e) {
postFailureEvent(extensionId, e.getMessage());
}
} else {
postFailureEvent(extensionId, "Extension is already installed.");
}
return;
}
}
}
postFailureEvent(extensionId, "Extension not known.");
}
use of org.eclipse.smarthome.extensionservice.marketplace.MarketplaceExtensionHandler in project smarthome by eclipse.
the class MarketplaceExtensionService method uninstall.
@Override
public void uninstall(String extensionId) {
Extension ext = getExtension(extensionId, null);
if (ext instanceof MarketplaceExtension) {
MarketplaceExtension mpExt = (MarketplaceExtension) ext;
for (MarketplaceExtensionHandler handler : extensionHandlers) {
if (handler.supports(mpExt)) {
if (handler.isInstalled(mpExt)) {
try {
handler.uninstall(mpExt);
postUninstalledEvent(extensionId);
} catch (MarketplaceHandlerException e) {
postFailureEvent(extensionId, e.getMessage());
}
} else {
postFailureEvent(extensionId, "Extension is not installed.");
}
return;
}
}
}
postFailureEvent(extensionId, "Extension not known.");
}
Aggregations