|
|
@ -23,6 +23,7 @@ import org.apache.commons.logging.LogFactory;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.json.JSONException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.InvalidDeviceException;
|
|
|
|
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
|
|
|
import org.wso2.carbon.device.mgt.core.operation.mgt.CommandOperation;
|
|
|
@ -109,7 +110,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
operation.setPayLoad(lock.toJSON());
|
|
|
|
operation.setPayLoad(lock.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceLockBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceLockBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -141,7 +143,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_UNLOCK);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_UNLOCK);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -172,7 +175,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_LOCATION);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_LOCATION);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -203,7 +207,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CLEAR_PASSWORD);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CLEAR_PASSWORD);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -242,7 +247,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CAMERA);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CAMERA);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setEnabled(camera.isEnabled());
|
|
|
|
operation.setEnabled(camera.isEnabled());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(cameraBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(cameraBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -273,7 +279,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_INFO);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_INFO);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -303,7 +310,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.LOGCAT);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.LOGCAT);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -333,7 +341,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.ENTERPRISE_WIPE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.ENTERPRISE_WIPE);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -372,7 +381,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.WIPE_DATA);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.WIPE_DATA);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(wipeData.toJSON());
|
|
|
|
operation.setPayLoad(wipeData.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(wipeDataBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(wipeDataBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -403,7 +413,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.APPLICATION_LIST);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.APPLICATION_LIST);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -434,7 +445,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_RING);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_RING);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -465,7 +477,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
CommandOperation operation = new CommandOperation();
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_REBOOT);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_REBOOT);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -497,7 +510,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_MUTE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.DEVICE_MUTE);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
operation.setEnabled(true);
|
|
|
|
return AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(deviceIDs, operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -542,8 +556,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.INSTALL_APPLICATION);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.INSTALL_APPLICATION);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(applicationInstallation.toJSON());
|
|
|
|
operation.setPayLoad(applicationInstallation.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(applicationInstallationBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
operation);
|
|
|
|
.getOperationResponse(applicationInstallationBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).build();
|
|
|
|
} catch (JSONException e) {
|
|
|
|
} catch (JSONException e) {
|
|
|
|
String errorMessage = "Invalid payload for the operation.";
|
|
|
|
String errorMessage = "Invalid payload for the operation.";
|
|
|
|
log.error(errorMessage);
|
|
|
|
log.error(errorMessage);
|
|
|
@ -592,8 +607,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(applicationUpdate.toJSON());
|
|
|
|
operation.setPayLoad(applicationUpdate.toJSON());
|
|
|
|
|
|
|
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(applicationUpdateBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
operation);
|
|
|
|
.getOperationResponse(applicationUpdateBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -635,9 +651,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.UNINSTALL_APPLICATION);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.UNINSTALL_APPLICATION);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(applicationUninstallation.toJSON());
|
|
|
|
operation.setPayLoad(applicationUninstallation.toJSON());
|
|
|
|
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
return AndroidAPIUtils.getOperationResponse(applicationUninstallationBeanWrapper.getDeviceIDs(),
|
|
|
|
.getOperationResponse(applicationUninstallationBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -676,8 +692,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.BLACKLIST_APPLICATIONS);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.BLACKLIST_APPLICATIONS);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(blacklistApplications.toJSON());
|
|
|
|
operation.setPayLoad(blacklistApplications.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(blacklistApplicationsBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
operation);
|
|
|
|
.getOperationResponse(blacklistApplicationsBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -718,7 +735,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.UPGRADE_FIRMWARE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.UPGRADE_FIRMWARE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(upgradeFirmware.toJSON());
|
|
|
|
operation.setPayLoad(upgradeFirmware.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(upgradeFirmwareBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
|
|
|
|
.getOperationResponse(upgradeFirmwareBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -757,8 +776,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.VPN);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.VPN);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(vpn.toJSON());
|
|
|
|
operation.setPayLoad(vpn.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(vpnConfiguration.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(vpnConfiguration.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -797,8 +816,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.NOTIFICATION);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.NOTIFICATION);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(notification.toJSON());
|
|
|
|
operation.setPayLoad(notification.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(notificationBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(notificationBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -838,8 +857,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(wifi.toJSON());
|
|
|
|
operation.setPayLoad(wifi.toJSON());
|
|
|
|
|
|
|
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(wifiBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(wifiBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -878,8 +897,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.ENCRYPT_STORAGE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.ENCRYPT_STORAGE);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setType(Operation.Type.COMMAND);
|
|
|
|
operation.setEnabled(deviceEncryption.isEncrypted());
|
|
|
|
operation.setEnabled(deviceEncryption.isEncrypted());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(encryptionBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(encryptionBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -918,8 +937,8 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CHANGE_LOCK_CODE);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.CHANGE_LOCK_CODE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(lockCode.toJSON());
|
|
|
|
operation.setPayLoad(lockCode.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(lockCodeBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(lockCodeBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
operation);
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -959,8 +978,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(passcodePolicy.toJSON());
|
|
|
|
operation.setPayLoad(passcodePolicy.toJSON());
|
|
|
|
|
|
|
|
|
|
|
|
return AndroidAPIUtils.getOperationResponse(passwordPolicyBeanWrapper.getDeviceIDs(),
|
|
|
|
Activity activity = AndroidAPIUtils
|
|
|
|
operation);
|
|
|
|
.getOperationResponse(passwordPolicyBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
@ -1000,7 +1020,9 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.WEBCLIP);
|
|
|
|
operation.setCode(AndroidConstants.OperationCodes.WEBCLIP);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setType(Operation.Type.PROFILE);
|
|
|
|
operation.setPayLoad(webClip.toJSON());
|
|
|
|
operation.setPayLoad(webClip.toJSON());
|
|
|
|
return AndroidAPIUtils.getOperationResponse(webClipBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
|
|
|
|
Activity activity = AndroidAPIUtils.getOperationResponse(webClipBeanWrapper.getDeviceIDs(), operation);
|
|
|
|
|
|
|
|
return Response.status(Response.Status.CREATED).entity(activity).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);
|
|
|
|