From ad8bbf8863a80568c2489d2829473e19672d1db2 Mon Sep 17 00:00:00 2001 From: hasuniea Date: Mon, 11 Jul 2016 19:07:13 +0530 Subject: [PATCH] removing notnull constraint from android device type --- .../services/android/bean/wrapper/AndroidDevice.java | 1 - .../android/services/DeviceManagementAdminService.java | 3 +-- .../android/services/DeviceManagementService.java | 1 - .../services/impl/DeviceManagementServiceImpl.java | 10 +++++----- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java index cbd0f0339..4ec09db9c 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/bean/wrapper/AndroidDevice.java @@ -46,7 +46,6 @@ public class AndroidDevice implements Serializable { value = "The OS type of the device.", required = true ) - @NotNull @Size(min = 2, max = 45) @Pattern(regexp = "^[A-Za-z]*$") private String type; diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java index 20dee4b56..1ef39dcc6 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementAdminService.java @@ -22,7 +22,6 @@ import io.swagger.annotations.*; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.mdm.services.android.bean.wrapper.*; -import javax.validation.Valid; import javax.ws.rs.Consumes; import javax.ws.rs.POST; import javax.ws.rs.Path; @@ -1153,7 +1152,7 @@ public interface DeviceManagementAdminService { }) Response configureWifi( @ApiParam(name = "wifiBeanWrapper", - value = "WifiConfigurations and Device Ids") @Valid WifiBeanWrapper wifiBeanWrapper); + value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper); @POST @Path("/encrypt-storage") diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java index b97f1843a..3c8bbe585 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/DeviceManagementService.java @@ -92,7 +92,6 @@ public interface DeviceManagementService { @ApiParam( name = "applications", value = "List of applications that need to be persisted against the device") - @Valid List androidApplications); @PUT diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java index c2a73600a..3ac5afa55 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/services/impl/DeviceManagementServiceImpl.java @@ -64,10 +64,10 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @Path("/{id}/applications") @Override public Response updateApplicationList(@PathParam("id") - @NotNull - @Size(min = 2 , max = 45) - @Pattern(regexp = "^[A-Za-z0-9]*$") - String id,@Valid List androidApplications) { + @NotNull + @Size(min = 2, max = 45) + @Pattern(regexp = "^[A-Za-z0-9]*$") + String id, List androidApplications) { Application application; List applications = new ArrayList<>(); for (AndroidApplication androidApplication : androidApplications) { @@ -259,7 +259,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { @PUT @Path("/{id}") @Override - public Response modifyEnrollment(@PathParam("id") String id, AndroidDevice androidDevice) { + public Response modifyEnrollment(@PathParam("id") String id, @Valid AndroidDevice androidDevice) { Device device = new Device(); device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); device.setEnrolmentInfo(androidDevice.getEnrolmentInfo());