From e2b43822ced66b2ad3fb5f41ca324de79109acf8 Mon Sep 17 00:00:00 2001 From: Ace Date: Mon, 21 Dec 2015 17:55:25 +0530 Subject: [PATCH] Automating key generation capability for virtual_firealarm --- .../pom.xml | 5 +++++ .../virtualfirealarm/service/VirtualFireAlarmService.java | 3 +++ pom.xml | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml index 5ef39018fd..89ab6e7024 100644 --- a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml +++ b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/pom.xml @@ -231,6 +231,11 @@ smackx provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + provided + diff --git a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java index 82ffcd49ee..8762c1cbaa 100644 --- a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java +++ b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/service/VirtualFireAlarmService.java @@ -24,6 +24,7 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.device.DeviceType; import org.wso2.carbon.apimgt.annotations.device.feature.Feature; +import org.wso2.carbon.apimgt.webapp.publisher.KeyGenerationUtil; import org.wso2.carbon.certificate.mgt.core.dto.SCEPResponse; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; import org.wso2.carbon.certificate.mgt.core.service.CertificateManagementService; @@ -456,6 +457,8 @@ public class VirtualFireAlarmService { //create new device id String deviceId = shortUUID(); + KeyGenerationUtil.createApplicationKeys("virtual_firealarm"); + TokenClient accessTokenClient = new TokenClient(VirtualFireAlarmConstants.DEVICE_TYPE); AccessTokenInfo accessTokenInfo = accessTokenClient.getAccessToken(owner, deviceId); diff --git a/pom.xml b/pom.xml index 83918ea7c2..cf5971b704 100644 --- a/pom.xml +++ b/pom.xml @@ -687,6 +687,11 @@ + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.webapp.publisher + ${carbon.device.mgt.version} + org.wso2.carbon.apimgt org.wso2.carbon.apimgt.impl