From d82670fa94d263892df96dbc4de1a9499ac9de8d Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 15 Dec 2016 18:38:13 +0530 Subject: [PATCH] fixing windows annotation issues --- .../api/services/ConfigurationMgtService.java | 4 +-- .../DeviceManagementAdminService.java | 6 ++--- .../impl/ConfigurationMgtServiceImpl.java | 7 +++--- .../DeviceManagementAdminServiceImpl.java | 7 +++--- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 25 ++++++++++++++++--- 5 files changed, 35 insertions(+), 14 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 a5f207595..1796a637c 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 @@ -66,8 +66,8 @@ import javax.ws.rs.core.Response; description = "This carries all the resources related to Windows configurations management functionalities") @WebService @Path("/configuration") -@Produces({"application/json", "application/xml"}) -@Consumes({"application/json", "application/xml"}) +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public interface ConfigurationMgtService { @GET 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 da9d2678b..0b1b0995c 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 @@ -58,9 +58,9 @@ import java.util.List; @Api(value = "Windows Device Management Administrative Service", description = "Device management related admin APIs.") @WebService -@Path("/admin/devices") -@Consumes(MediaType.APPLICATION_JSON) -@Produces(MediaType.APPLICATION_JSON) +@Path("/operation/admin/devices") +@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) public interface DeviceManagementAdminService { @POST 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/impl/ConfigurationMgtServiceImpl.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/impl/ConfigurationMgtServiceImpl.java index c2a6607b3..f4829183e 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/impl/ConfigurationMgtServiceImpl.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/impl/ConfigurationMgtServiceImpl.java @@ -31,6 +31,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.Unexpecte import org.wso2.carbon.device.mgt.mobile.windows.api.common.exceptions.WindowsConfigurationException; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.WindowsAPIUtils; import org.wso2.carbon.device.mgt.mobile.windows.api.services.ConfigurationMgtService; +import javax.ws.rs.core.MediaType; import javax.jws.WebService; import javax.ws.rs.*; @@ -39,9 +40,9 @@ import java.util.ArrayList; import java.util.List; @WebService -@Produces({"application/json", "application/xml"}) -@Consumes({"application/json", "application/xml"}) -@Path("/") +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Path("/configuration") public class ConfigurationMgtServiceImpl implements ConfigurationMgtService { private static Log log = LogFactory.getLog( 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/impl/DeviceManagementAdminServiceImpl.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/impl/DeviceManagementAdminServiceImpl.java index 5f6e4e082..0c9164da6 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/impl/DeviceManagementAdminServiceImpl.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/impl/DeviceManagementAdminServiceImpl.java @@ -35,9 +35,7 @@ import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.Message; import org.wso2.carbon.device.mgt.mobile.windows.api.common.util.WindowsAPIUtils; import org.wso2.carbon.device.mgt.mobile.windows.api.services.DeviceManagementAdminService; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; @@ -46,6 +44,9 @@ import java.util.List; * Implementation class of operations interface. Each method in this class receives the operations comes via UI * and persists those in the correct format. */ +@Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML}) +@Path("/operation/admin/devices") public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminService { private static Log log = LogFactory.getLog(OperationImpl.class); diff --git a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/webapp/WEB-INF/cxf-servlet.xml index c61306808..0b37aab36 100644 --- a/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/mobile-plugins/windows-plugin/org.wso2.carbon.device.mgt.mobile.windows.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -118,7 +118,7 @@ - + - + + + + + + + + + + + + + + + + + + +