|
|
@ -995,14 +995,21 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
GlobalProxy globalProxy = globalProxyBeanWrapper.getOperation();
|
|
|
|
GlobalProxy globalProxy = globalProxyBeanWrapper.getOperation();
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
if (globalProxy.validateRequest()) {
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.GLOBAL_PROXY);
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.GLOBAL_PROXY);
|
|
|
|
operation.setPayLoad(globalProxy.toJSON());
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
|
|
|
|
operation.setPayLoad(globalProxy.toJSON());
|
|
|
|
Activity activity = AndroidDeviceUtils
|
|
|
|
|
|
|
|
.getOperationResponse(globalProxyBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
Activity activity = AndroidDeviceUtils
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).build();
|
|
|
|
.getOperationResponse(globalProxyBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).build();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
String errorMessage = "The payload of the global proxy operation is incorrect";
|
|
|
|
|
|
|
|
log.error(errorMessage);
|
|
|
|
|
|
|
|
throw new BadRequestException(
|
|
|
|
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(400L).setMessage(errorMessage).build());
|
|
|
|
|
|
|
|
}
|
|
|
|
} catch (InvalidDeviceException e) {
|
|
|
|
} catch (InvalidDeviceException e) {
|
|
|
|
String errorMessage = "Invalid Device Identifiers found.";
|
|
|
|
String errorMessage = "Invalid Device Identifiers found.";
|
|
|
|
log.error(errorMessage, e);
|
|
|
|
log.error(errorMessage, e);
|
|
|
|