From 4c95ac6e59850d97a5da4c123ec009cbd7043b90 Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 18 Dec 2015 11:48:22 +0530 Subject: [PATCH] Documenting digital display --- .../pom.xml | 6 ++++ .../api/DigitalDisplayControllerService.java | 32 +++++++++++++++++++ .../src/main/webapp/WEB-INF/web.xml | 22 +++++++++++++ .../service/VirtualFireAlarmService.java | 2 ++ .../src/main/webapp/WEB-INF/web.xml | 16 ---------- 5 files changed, 62 insertions(+), 16 deletions(-) diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/pom.xml b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/pom.xml index 057f8083de..10593233a1 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/pom.xml +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/pom.xml @@ -209,6 +209,12 @@ provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.annotations + provided + + diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/api/DigitalDisplayControllerService.java b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/api/DigitalDisplayControllerService.java index 012dd0a1c3..9a8fba5ba7 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/api/DigitalDisplayControllerService.java +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/java/org/wso2/carbon/device/mgt/iot/digitaldisplay/api/DigitalDisplayControllerService.java @@ -2,11 +2,14 @@ package org.wso2.carbon.device.mgt.iot.digitaldisplay.api; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.apimgt.annotations.device.DeviceType; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.iot.digitaldisplay.api.exception.DigitalDisplayException; import org.wso2.carbon.device.mgt.iot.digitaldisplay.api.transport.CommunicationHandlerException; import org.wso2.carbon.device.mgt.iot.digitaldisplay.api.util.DigitalDisplayMqttCommunicationHandler; import org.wso2.carbon.device.mgt.iot.digitaldisplay.constants.DigitalDisplayConstants; +import org.wso2.carbon.apimgt.annotations.api.API; +import org.wso2.carbon.apimgt.annotations.device.feature.Feature; import javax.servlet.http.HttpServletResponse; import javax.ws.rs.*; @@ -17,6 +20,9 @@ import javax.ws.rs.core.Response; * Created by nuwan on 11/13/15. */ +@Path("/DigitalDisplayDeviceManager") +@API( name="digital_display", version="1.0.0", context="/digital_display") +@DeviceType( value = "digital_display") public class DigitalDisplayControllerService { @@ -46,6 +52,8 @@ public class DigitalDisplayControllerService { */ @Path("/restart-browser") @POST + @Feature( code="DISPLAY_BROWSERRESTART", name="Restart Browser", + description="Restart Browser in Digital Display") public void restartBrowser(@FormParam("deviceId") String deviceId , @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -77,6 +85,8 @@ public class DigitalDisplayControllerService { */ @Path("/close-browser") @POST + @Feature( code="DISPLAY_BROWSERCLOSE", name="Close Browser", + description="Close Browser in Digital Display") public void closeBrowser(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -107,6 +117,8 @@ public class DigitalDisplayControllerService { */ @Path("/terminate-display") @POST + @Feature( code="DISPLAY_TERMINATE", name="Terminate Display", + description="Terminate all running processe in Digital Display") public void terminateDisplay(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -137,6 +149,8 @@ public class DigitalDisplayControllerService { */ @Path("/restart-display") @POST + @Feature( code="DISPLAY_RESTART", name="Restart Display", + description="Restart Digital Display") public void restartDisplay(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -170,6 +184,8 @@ public class DigitalDisplayControllerService { */ @Path("/edit-content") @POST + @Feature( code="DISPLAY_EDITCONTENT", name="Edit Content", + description="Search through the sequence and edit requested resource in Digital Display") public void editContent(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("path") String path, @@ -207,6 +223,8 @@ public class DigitalDisplayControllerService { */ @Path("/add-resource") @POST + @Feature( code="DISPLAY_ADDRESOURCE", name="Add Resource", + description="Add new resource end to the existing sequence in Digital Display") public void addNewResource(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("type") String type, @@ -245,6 +263,8 @@ public class DigitalDisplayControllerService { */ @Path("/add-resource-before") @POST + @Feature( code="DISPLAY_ADDRESOURCE_BEFORE", name="Add Resource Before", + description="Add new resource to sequence before given page no. in Digital Display") public void addNewResourceBefore(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -286,6 +306,8 @@ public class DigitalDisplayControllerService { */ @Path("/add-resource-next") @POST + @Feature( code="DISPLAY_ADDRESOURCE_NEXT", name="Add Resource Next", + description="Add new resource to sequence after given page in Digital Display") public void addNewResourceAfter(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("type") String type, @@ -323,6 +345,8 @@ public class DigitalDisplayControllerService { */ @Path("/remove-resource") @POST + @Feature( code="DISPLAY_REMOVE_RESOURCE", name="Remove Resource", + description="Delete a resource from sequence in Digital Display") public void removeResource(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("path") String path, @@ -356,6 +380,8 @@ public class DigitalDisplayControllerService { */ @Path("/remove-directory") @POST + @Feature( code="DISPLAY_REMOVE_DIR", name="Remove Directory", + description="Remove directory and whole content in Digital Display") public void removeDirectory(@FormParam("directory-name") String directoryName, @FormParam("deviceId") String deviceId , @FormParam("owner") String owner, @@ -389,6 +415,8 @@ public class DigitalDisplayControllerService { */ @Path("/remove-content") @POST + @Feature( code="DISPLAY_REMOVE_CONTENT", name="Remove Content", + description="Remove content from www folder in Digital Display") public void removeContent(@FormParam("directory-name") String directoryName, @FormParam("content") String content, @FormParam("deviceId") String deviceId , @@ -421,6 +449,8 @@ public class DigitalDisplayControllerService { */ @Path("/shutdown-display") @POST + @Feature( code="DISPLAY_SHUTDOWN", name="Shut Down", + description="Stop specific display in Digital Display") public void shutDownDisplay(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, @@ -451,6 +481,8 @@ public class DigitalDisplayControllerService { */ @Path("/get-status") @GET + @Feature( code="DISPLAY_GET_STATUS", name="Get Status", + description="Check specific digital display power ON of OFF") public void getStatus(@FormParam("deviceId") String deviceId, @FormParam("owner") String owner, @FormParam("sessionId") String sessionId, diff --git a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/webapp/WEB-INF/web.xml b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/webapp/WEB-INF/web.xml index 5d7b23a701..79da5003ba 100644 --- a/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/webapp/WEB-INF/web.xml +++ b/components/device-mgt-iot-digitaldisplay/org.wso2.carbon.device.mgt.iot.digitaldisplay.api/src/main/webapp/WEB-INF/web.xml @@ -35,4 +35,26 @@ /* + + + managed-api-enabled + true + + + managed-api-owner + admin + + + managed-api-context-template + /digital_display/{version} + + + managed-api-application + digital_display + + + managed-api-isSecured + true + + 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 c45b5d52bd..0c77b1e8df 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 @@ -22,6 +22,7 @@ import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; 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.certificate.mgt.core.dto.SCEPResponse; import org.wso2.carbon.certificate.mgt.core.exception.KeystoreException; @@ -81,6 +82,7 @@ import java.util.concurrent.ConcurrentHashMap; @Path("/VirtualFireAlarmDeviceManager") @API( name="virtual_firealarm", version="1.0.0", context="/virtual_firealarm") +@DeviceType( value = "virtual_firealarm") public class VirtualFireAlarmService { private static Log log = LogFactory.getLog(VirtualFireAlarmService.class); diff --git a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/webapp/WEB-INF/web.xml b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/webapp/WEB-INF/web.xml index 50447398be..0689ffaf06 100644 --- a/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/webapp/WEB-INF/web.xml +++ b/components/device-mgt-iot-virtualfirealarm/org.wso2.carbon.device.mgt.iot.virtualfirealarm.service.impl/src/main/webapp/WEB-INF/web.xml @@ -37,22 +37,6 @@ managed-api-owner admin - - managed-api-name - virtual_firealarm - - - managed-api-endpoint - http://localhost:9763/virtual_firealarm - - - managed-api-version - 1.0.0 - - - managed-api-context - /virtual_firealarm - managed-api-context-template /virtual_firealarm/{version}