From a2ae12f9d18349a7ee0951fea3f1ab398e0a5245 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Fri, 13 Jan 2017 16:08:58 +0530 Subject: [PATCH] adding windows 10 updates 1607/1511 changes --- .../impl/DeviceManagementServiceImpl.java | 19 +++++++++++++------ .../wstep/CertificateEnrollmentService.java | 19 +------------------ 2 files changed, 14 insertions(+), 24 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/impl/DeviceManagementServiceImpl.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/DeviceManagementServiceImpl.java index f754ff80cb..38dfde51de 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/DeviceManagementServiceImpl.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/DeviceManagementServiceImpl.java @@ -89,7 +89,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { if (modifyEnrollWithMoreDetail(request)) { pendingOperations = operationHandler.getPendingOperations(syncmlDocument); - response = operationReply.generateReply(syncmlDocument,pendingOperations); + response = operationReply.generateReply(syncmlDocument, pendingOperations); return Response.status(Response.Status.OK).entity(response).build(); } else { String msg = "Error occurred in while modify the enrollment."; @@ -101,7 +101,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { log.error(msg); return Response.status(Response.Status.UNAUTHORIZED).entity(msg).build(); } - } else { + } else { if ((syncmlDocument.getBody().getAlert() != null)) { if (!syncmlDocument.getBody().getAlert().getData().equals(Constants.DISENROLL_ALERT_DATA)) { pendingOperations = operationHandler.getPendingOperations(syncmlDocument); @@ -155,8 +155,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { private boolean modifyEnrollWithMoreDetail(Document request) throws WindowsDeviceEnrolmentException, WindowsOperationException { - String devMan; - String devMod; + String devMan = null; + String devMod = null; boolean status = false; String user; SyncmlDocument syncmlDocument; @@ -165,8 +165,15 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { syncmlDocument = SyncmlParser.parseSyncmlPayload(request); ReplaceTag replace = syncmlDocument.getBody().getReplace(); List itemList = replace.getItems(); - devMan = itemList.get(PluginConstants.SyncML.DEVICE_MAN_POSITION).getData(); - devMod = itemList.get(PluginConstants.SyncML.DEVICE_MODEL_POSITION).getData(); + for (ItemTag itemTag : itemList) { + String locURI = itemTag.getSource().getLocURI(); + if (OperationCode.Info.MANUFACTURER.getCode().equals(locURI)) { + devMan = itemTag.getData(); + } + if (OperationCode.Info.DEVICE_MODEL.getCode().equals(locURI)) { + devMod = itemTag.getData(); + } + } user = syncmlDocument.getHeader().getSource().getLocName(); AuthenticationInfo authenticationInfo = new AuthenticationInfo(); authenticationInfo.setUsername(user); 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/wstep/CertificateEnrollmentService.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/wstep/CertificateEnrollmentService.java index eb6f7001a6..1b29298b35 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/wstep/CertificateEnrollmentService.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/wstep/CertificateEnrollmentService.java @@ -41,24 +41,7 @@ import java.io.UnsupportedEncodingException; /** * Interface of WSTEP implementation. */ -@SwaggerDefinition( - info = @Info( - version = "1.0.0", - title = "", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = "name", value = "Windows 8.1 Enrollment Service"), - @ExtensionProperty(name = "context", - value = "/api/device-mgt/windows/v1.0/deviceenrolment/wstep"), - }) - } - ), - tags = { - @Tag(name = "windows", description = "") - } -) -@Api(value = "Windows Enrollment service Management", - description = "This carries all the resources related to Windows enrollment service.") + @WebService(targetNamespace = PluginConstants.DEVICE_ENROLLMENT_SERVICE_TARGET_NAMESPACE, name = "wstep") @BindingType(value = SOAPBinding.SOAP12HTTP_BINDING) public interface CertificateEnrollmentService {