From 5438a421de343873a2e8425948028c93463302a0 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Thu, 15 Sep 2016 07:33:00 +0530 Subject: [PATCH] Fixing Permissions are not published for Windows through WebApp Lifecycle Listener --- .../api/services/ConfigurationMgtService.java | 6 +++-- .../DeviceManagementAdminService.java | 15 ++++++++++++- .../api/services/DeviceManagementService.java | 22 ++++++++++++++----- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java index aa84ad75b..b5428ba07 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/ConfigurationMgtService.java @@ -18,6 +18,7 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.apimgt.annotations.api.Scope; @@ -35,11 +36,12 @@ import javax.ws.rs.*; @API(name = "Windows Configuration Management", version = "1.0.0", context = "api/device-mgt/windows/v1.0/services/configuration", tags = {"windows"}) - +@Api(value = "Windows Configuration Management", + description = "This carries all the resources related to Windows configurations management functionalities") @WebService +@Path("services/configuration") @Produces({"application/json", "application/xml"}) @Consumes({"application/json", "application/xml"}) -@Path("services/configuration") public interface ConfigurationMgtService { /** diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java index 4d96f8acd..c53d91417 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementAdminService.java @@ -18,10 +18,17 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.apimgt.annotations.api.Permission; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsDeviceEnrolmentException; -import javax.ws.rs.*; +import javax.jws.WebService; +import javax.ws.rs.Consumes; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; @@ -29,6 +36,12 @@ import java.util.List; /** * Interface for Admin operations persisting. This interface accepts operations added via UI. */ +@Api(value = "Windows Device Management Administrative Service", + description = "Device management related admin APIs.") +@API(name = "Windows Device Management Administrative Service", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/admin/devices", + tags = {"devicemgt_windows"}) +@WebService @Path("/admin/devices") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java index 2559fc25d..5f0f84421 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/java/org/wso2/carbon/device/mgt/mobile/windows/api/services/DeviceManagementService.java @@ -18,20 +18,31 @@ package org.wso2.carbon.device.mgt.mobile.windows.api.services; +import io.swagger.annotations.Api; +import org.wso2.carbon.apimgt.annotations.api.API; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.license.mgt.License; import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.Message; import javax.jws.WebService; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.List; /** - * Windows Device Management REST-API implementation. - * All end points supports JSON, XMl with content negotiation. + * Windows Device Management REST-API implementation. All end points supports JSON, XMl with content negotiation. */ +@Api(value = "Windows Device Management", + description = "This carries all the resources related to Windows device management functionalities") +@API(name = "Windows Device Management", version = "1.0.0", + context = "api/device-mgt/windows/v1.0/devices", + tags = {"devicemgt_windows"}) @WebService @Path("/devices") @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) @@ -61,14 +72,15 @@ public interface DeviceManagementService { /** * Update Windows device details of given device id. * - * @param deviceId Device Id. - * @param device Device details to be updated. + * @param deviceId Device Id. + * @param device Device details to be updated. * @return Returns the message whether device update or not. * @throws WindowsConfigurationException occurred while updating the Device Info. */ @PUT @Path("{id}") Message updateDevice(@PathParam("id") String deviceId, Device device) throws WindowsConfigurationException; + /** * Fetch the Licence agreement for specific windows platform. *