removing notnull constraint from android device type

revert-dabc3590
hasuniea 9 years ago
parent e84a868069
commit ad8bbf8863

@ -46,7 +46,6 @@ public class AndroidDevice implements Serializable {
value = "The OS type of the device.", value = "The OS type of the device.",
required = true required = true
) )
@NotNull
@Size(min = 2, max = 45) @Size(min = 2, max = 45)
@Pattern(regexp = "^[A-Za-z]*$") @Pattern(regexp = "^[A-Za-z]*$")
private String type; private String type;

@ -22,7 +22,6 @@ import io.swagger.annotations.*;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity; import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
import org.wso2.carbon.mdm.services.android.bean.wrapper.*; import org.wso2.carbon.mdm.services.android.bean.wrapper.*;
import javax.validation.Valid;
import javax.ws.rs.Consumes; import javax.ws.rs.Consumes;
import javax.ws.rs.POST; import javax.ws.rs.POST;
import javax.ws.rs.Path; import javax.ws.rs.Path;
@ -1153,7 +1152,7 @@ public interface DeviceManagementAdminService {
}) })
Response configureWifi( Response configureWifi(
@ApiParam(name = "wifiBeanWrapper", @ApiParam(name = "wifiBeanWrapper",
value = "WifiConfigurations and Device Ids") @Valid WifiBeanWrapper wifiBeanWrapper); value = "WifiConfigurations and Device Ids") WifiBeanWrapper wifiBeanWrapper);
@POST @POST
@Path("/encrypt-storage") @Path("/encrypt-storage")

@ -92,7 +92,6 @@ public interface DeviceManagementService {
@ApiParam( @ApiParam(
name = "applications", name = "applications",
value = "List of applications that need to be persisted against the device") value = "List of applications that need to be persisted against the device")
@Valid
List<AndroidApplication> androidApplications); List<AndroidApplication> androidApplications);
@PUT @PUT

@ -67,7 +67,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@NotNull @NotNull
@Size(min = 2, max = 45) @Size(min = 2, max = 45)
@Pattern(regexp = "^[A-Za-z0-9]*$") @Pattern(regexp = "^[A-Za-z0-9]*$")
String id,@Valid List<AndroidApplication> androidApplications) { String id, List<AndroidApplication> androidApplications) {
Application application; Application application;
List<Application> applications = new ArrayList<>(); List<Application> applications = new ArrayList<>();
for (AndroidApplication androidApplication : androidApplications) { for (AndroidApplication androidApplication : androidApplications) {
@ -259,7 +259,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@PUT @PUT
@Path("/{id}") @Path("/{id}")
@Override @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 device = new Device();
device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID); device.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
device.setEnrolmentInfo(androidDevice.getEnrolmentInfo()); device.setEnrolmentInfo(androidDevice.getEnrolmentInfo());

Loading…
Cancel
Save