|
|
|
@ -221,6 +221,31 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/logcat")
|
|
|
|
|
@Override
|
|
|
|
|
public Response getDeviceLogcat(List<String> deviceIDs) {
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
log.debug("Invoking get Android device logcat operation");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.LOGCAT);
|
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
} catch (OperationManagementException e) {
|
|
|
|
|
String errorMessage = "Issue in retrieving operation management service instance";
|
|
|
|
|
log.error(errorMessage, e);
|
|
|
|
|
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(errorMessage).build();
|
|
|
|
|
} catch (DeviceManagementException e) {
|
|
|
|
|
String errorMessage = "Issue in retrieving device management service instance";
|
|
|
|
|
log.error(errorMessage, e);
|
|
|
|
|
throw new UnexpectedServerErrorException(
|
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(errorMessage).build());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/enterprise-wipe")
|
|
|
|
|
@Override
|
|
|
|
@ -568,24 +593,24 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
|
@POST
|
|
|
|
|
@Path("/configure-vpn")
|
|
|
|
|
@Override
|
|
|
|
|
public Response configureVPN(VpnBeanWrapper vpnBeanWrapper) {
|
|
|
|
|
public Response configureVPN(VpnBeanWrapper vpnConfiguration) {
|
|
|
|
|
if (log.isDebugEnabled()) {
|
|
|
|
|
log.debug("Invoking Android VPN device operation");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
if (vpnBeanWrapper == null || vpnBeanWrapper.getOperation() == null) {
|
|
|
|
|
if (vpnConfiguration == null || vpnConfiguration.getOperation() == null) {
|
|
|
|
|
String errorMessage = "The payload of the VPN operation is incorrect";
|
|
|
|
|
log.error(errorMessage);
|
|
|
|
|
throw new BadRequestException(
|
|
|
|
|
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage(errorMessage).build());
|
|
|
|
|
}
|
|
|
|
|
Vpn vpn = vpnBeanWrapper.getOperation();
|
|
|
|
|
Vpn vpn = vpnConfiguration.getOperation();
|
|
|
|
|
ProfileOperation operation = new ProfileOperation();
|
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.VPN);
|
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
|
operation.setPayLoad(vpn.toJSON());
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(vpnBeanWrapper.getDeviceIDs(),
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(vpnConfiguration.getDeviceIDs(),
|
|
|
|
|
operation);
|
|
|
|
|
} catch (OperationManagementException e) {
|
|
|
|
|
String errorMessage = "Issue in retrieving operation management service instance";
|
|
|
|
|