From aa518e6b6c0237ad9e0976703b690175316fafd7 Mon Sep 17 00:00:00 2001 From: ayyoob Date: Sun, 23 Oct 2016 14:24:15 +0530 Subject: [PATCH] few changes to support the deployer --- .../src/main/webapp/WEB-INF/web.xml | 4 -- ...alFirealarmManagementServiceComponent.java | 32 ++++----- .../devicetypes/virtual_firealarm.xml | 68 +++++++++++++++++++ .../src/main/resources/p2.inf | 4 ++ 4 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/webapp/WEB-INF/web.xml b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/webapp/WEB-INF/web.xml index 2f18393cf..2d1c6e26b 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/webapp/WEB-INF/web.xml +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.api/src/main/webapp/WEB-INF/web.xml @@ -24,10 +24,6 @@ doAuthentication true - - isSharedWithAllTenants - true - providerTenantDomain carbon.super diff --git a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/internal/VirtualFirealarmManagementServiceComponent.java b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/internal/VirtualFirealarmManagementServiceComponent.java index 47f3a7f27..494b8547a 100644 --- a/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/internal/VirtualFirealarmManagementServiceComponent.java +++ b/components/iot-plugins/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.plugin/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/plugin/internal/VirtualFirealarmManagementServiceComponent.java @@ -75,10 +75,10 @@ public class VirtualFirealarmManagementServiceComponent { } try { - VirtualFireAlarmManagerService virtualFireAlarmManagerService = new VirtualFireAlarmManagerService(); + // VirtualFireAlarmManagerService virtualFireAlarmManagerService = new VirtualFireAlarmManagerService(); BundleContext bundleContext = ctx.getBundleContext(); - firealarmServiceRegRef = bundleContext.registerService(DeviceManagementService.class.getName() - ,virtualFireAlarmManagerService, null); +// firealarmServiceRegRef = bundleContext.registerService(DeviceManagementService.class.getName() +// ,virtualFireAlarmManagerService, null); bundleContext.registerService(ServerStartupObserver.class.getName(), new VirtualFirealarmStartupListener(), null); String setupOption = System.getProperty("setup"); @@ -103,19 +103,19 @@ public class VirtualFirealarmManagementServiceComponent { } protected void deactivate(ComponentContext ctx) { - if (log.isDebugEnabled()) { - log.debug("De-activating Virtual Firealarm Device Management Service Component"); - } - try { - if (firealarmServiceRegRef != null) { - firealarmServiceRegRef.unregister(); - } - if (log.isDebugEnabled()) { - log.debug("Virtual Firealarm Device Management Service Component has been successfully de-activated"); - } - } catch (Throwable e) { - log.error("Error occurred while de-activating Virtual Firealarm Device Management bundle", e); - } +// if (log.isDebugEnabled()) { +// log.debug("De-activating Virtual Firealarm Device Management Service Component"); +// } +// try { +// if (firealarmServiceRegRef != null) { +// firealarmServiceRegRef.unregister(); +// } +// if (log.isDebugEnabled()) { +// log.debug("Virtual Firealarm Device Management Service Component has been successfully de-activated"); +// } +// } catch (Throwable e) { +// log.error("Error occurred while de-activating Virtual Firealarm Device Management bundle", e); +// } } /** diff --git a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml new file mode 100644 index 000000000..11ff166ed --- /dev/null +++ b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/devicetypes/virtual_firealarm.xml @@ -0,0 +1,68 @@ + + + + + virtual_firealarm + + + + + + + + + + + + + + + + + + en_US + 1.0.0 + This is license text + + + + + + + false + + + + + + + MQTT + true + + + sample.mqtt.adapter.sample + tcp://localhost:1883 + admin + https://localhost:9443/dynamic-client-web/register + 0 + + true + + + diff --git a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf index c0b986f99..01279ba1f 100644 --- a/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf +++ b/features/iot-plugins-feature/virtual-fire-alarm-plugin-feature/org.wso2.carbon.device.mgt.iot.virtualfirealarm.feature/src/main/resources/p2.inf @@ -16,6 +16,9 @@ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../reso org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/certs/,target:${installFolder}/../../resources/security/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../resources/device-types/);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/conf/virtual-fire-alarm-config.xml,target:${installFolder}/../../conf/etc/device-mgt-plugins/virtual-fire-alarm-config.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/devicetypes/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.iot.virtualfirealarm_${feature.version}/devicetypes/,target:${installFolder}/../../deployment/server/devicetypes/,overwrite:true);\ + instructions.unconfigure = \ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/virtual_firealarm.war);\ @@ -37,3 +40,4 @@ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../dep org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.virtual_firealarm.policy-wizard);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../resources/security/wso2certs.jks);\ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/etc/device-mgt-plugins/virtual-fire-alarm-config.xml);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/devicetypes/virtual_firealarm.xml);\ \ No newline at end of file