From 16b85e8ff91d92e43d9c12396d1657b9cc58fd84 Mon Sep 17 00:00:00 2001 From: GDLMadushanka Date: Mon, 12 Jun 2017 12:23:27 +0530 Subject: [PATCH] Removing hardcoded values --- .../agent/advanced/core/AgentUtilOperations.java | 4 ++-- .../mgt/iot/virtualfirealarm/agent/core/AgentConstants.java | 2 ++ .../iot/virtualfirealarm/agent/core/AgentUtilOperations.java | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java index 5027007b6f..a7ca10e73a 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.advanced.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/advanced/core/AgentUtilOperations.java @@ -202,8 +202,8 @@ public class AgentUtilOperations { AgentManager agentManager = AgentManager.getInstance(); String serverSecureEndpoint = agentManager.getAgentConfigs().getHTTPS_ServerEndpoint(); String serverUnSecureEndpoint = agentManager.getAgentConfigs().getHTTP_ServerEndpoint(); - String backEndContext = "/virtual_firealarm/device"; - String scepBackEndContext = "/virtual_firealarm_scep"; + String backEndContext =AgentConstants.DEVICE_CONTROLLER_API_EP; + String scepBackEndContext = AgentConstants.DEVICE_SCEP_API_EP;S String deviceControllerAPIEndpoint = serverSecureEndpoint + backEndContext; String deviceEnrollmentEndpoint = diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java index cdf0d52a00..bfa29ca582 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentConstants.java @@ -27,6 +27,8 @@ public class AgentConstants { /* --------------------------------------------------------------------------------------- IoT-Server specific information --------------------------------------------------------------------------------------- */ + public static final String DEVICE_CONTROLLER_API_EP = "/virtual_firealarm/device"; + public static final String DEVICE_SCEP_API_EP = "/virtual_firealarm_scep"; public static final String DEVICE_ENROLLMENT_API_EP = "/scep"; public static final String DEVICE_REGISTER_API_EP = "/register"; public static final String DEVICE_PUSH_TEMPERATURE_API_EP = "/temperature"; diff --git a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java index 26bec9e503..fa2a592759 100644 --- a/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java +++ b/components/device-types/virtual-fire-alarm-plugin/org.wso2.carbon.device.mgt.iot.virtualfirealarm.agent.impl/src/main/java/org/wso2/carbon/device/mgt/iot/virtualfirealarm/agent/core/AgentUtilOperations.java @@ -193,8 +193,8 @@ public class AgentUtilOperations { AgentManager agentManager = AgentManager.getInstance(); String serverSecureEndpoint = agentManager.getAgentConfigs().getHTTPS_ServerEndpoint(); String serverUnSecureEndpoint = agentManager.getAgentConfigs().getHTTP_ServerEndpoint(); - String backEndContext = "/virtual_firealarm/device"; - String scepBackEndContext = "/virtual_firealarm_scep"; + String backEndContext =AgentConstants.DEVICE_CONTROLLER_API_EP; + String scepBackEndContext = AgentConstants.DEVICE_SCEP_API_EP; String deviceControllerAPIEndpoint = serverSecureEndpoint + backEndContext;