From b40e5b4bb187d4e3eb2f706daefc20397dc7709e Mon Sep 17 00:00:00 2001 From: GPrathap Date: Thu, 5 May 2016 22:23:26 +0530 Subject: [PATCH 1/2] corrected subscribe topic format --- .../__rootArtifactId__/api/transport/MQTTConnector.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/transport/MQTTConnector.java b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/transport/MQTTConnector.java index 5015cc18..495f9dc5 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/transport/MQTTConnector.java +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/transport/MQTTConnector.java @@ -55,7 +55,7 @@ public class MQTTConnector extends MQTTTransportHandler { private static final String publisherContext = "publisher"; private static final String subscriberContext = "subscriber"; - private static final String subscribeTopic = "wso2/" + DeviceTypeConstants.DEVICE_TYPE + "/+/" + publisherContext; + private static final String subscribeTopic = "wso2/+/"+ DeviceTypeConstants.DEVICE_TYPE + "/+/" + publisherContext; private static final String KEY_TYPE = "PRODUCTION"; private static final String EMPTY_STRING = ""; private static final String JSON_SERIAL_KEY = "SerialNumber"; From 384c1f35b32aa2f97c24bb809513559a32790719 Mon Sep 17 00:00:00 2001 From: GPrathap Date: Thu, 5 May 2016 22:24:16 +0530 Subject: [PATCH 2/2] removed unused code --- .../api/ControllerService.java | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/ControllerService.java b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/ControllerService.java index d71780ef..f6968246 100644 --- a/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/ControllerService.java +++ b/modules/tools/cdmf-devicetype-archetype/src/main/resources/archetype-resources/component/api/src/main/java/__groupId__/__rootArtifactId__/api/ControllerService.java @@ -63,29 +63,6 @@ public interface ControllerService { @Consumes(MediaType.APPLICATION_JSON) Response registerDevice(final DeviceJSON agentInfo); - /** - * @param deviceId unique identifier for given device type - * @param response - * @return - */ - /*@Path("device/{deviceId}/read-current-status") - @GET - @Consumes(MediaType.APPLICATION_JSON) - @Produces(MediaType.APPLICATION_JSON) - @Feature(code = "read-current-status", name = "Read current status of sensor On or Off", type = "monitor", - description = "Request current status of sensor from device") - public Response readCurrentStatus(@PathParam("deviceId") String deviceId, - @Context HttpServletResponse response);*/ - - /** - * @param agentInfo receive current status of sensor and device metadata - * @param response - */ - /*@Path("controller/push-sensor-value") - @POST - @Consumes(MediaType.APPLICATION_JSON) - public void pushData(final DeviceJSON agentInfo, @Context HttpServletResponse response) ;*/ - /** * @param deviceId unique identifier for given device type * @param state change status of sensor: on/off