Merge branch 'rest-api-improvements' of github.com:wso2/carbon-device-mgt-plugins into rest-api-improvements

revert-dabc3590
Chatura Dilan 9 years ago
commit 9086a130c4

@ -87,11 +87,11 @@ public interface DeviceManagementService {
value = "List of applications that need to be persisted against the device")
List<Application> applications);
@GET
@PUT
@Path("/{id}/pending-operations")
@ApiOperation(
produces = MediaType.APPLICATION_JSON,
httpMethod = "GET",
httpMethod = "PUT",
value = "Get the operation list pending for the device",
responseContainer = "List",
notes = "The Android agent communicates with the server to get the operations that are queued up " +

@ -145,10 +145,9 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
notification.setOperationId(operation.getId());
notification.setStatus(org.wso2.carbon.device.mgt.common.notification.mgt.Notification.
Status.NEW.toString());
notification.setDeviceIdentifier(id);
notification.setDescription("Operation " + operation.getCode() + " failed to execute on device " +
deviceName + ". Device ID : " + deviceId);
AndroidAPIUtils.getNotificationManagementService().addNotification(notification);
AndroidAPIUtils.getNotificationManagementService().addNotification(id, notification);
}
if (log.isDebugEnabled()) {
log.debug("Updating operation '" + operation.toString() + "'");

@ -60,7 +60,6 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
PlatformConfiguration = new PlatformConfiguration();
configs = new ArrayList<>();
}
ConfigurationEntry entry = new ConfigurationEntry();
License license = AndroidAPIUtils.getDeviceManagementService().getLicense(
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, AndroidConstants.
@ -110,7 +109,7 @@ public class DeviceTypeConfigurationServiceImpl implements DeviceTypeConfigurati
AndroidAPIUtils.getDeviceManagementService().saveConfiguration(configuration);
//AndroidAPIUtils.getGCMService().resetTenantConfigCache();
Response.status(Response.Status.ACCEPTED);
responseMsg.setResponseMessage("Android platform configuration has updated successfully.");
responseMsg.setResponseMessage("Android platform configuration has been updated successfully.");
responseMsg.setResponseCode(Response.Status.ACCEPTED.toString());
} catch (DeviceManagementException e) {
msg = "Error occurred while modifying configuration settings of Android platform";

@ -45,7 +45,8 @@
<property name="resourcePackage" value="org.wso2.carbon.mdm.services.android.services"/>
<property name="version" value="1.0"/>
<property name="host" value="localhost:9443"/>
<property name="basePath" value="api/device-mgt/android/v1.0"/>
<property name="schemes" value="https" />
<property name="basePath" value="/api/device-mgt/android/v1.0"/>
<property name="title" value="Android Device Management API Definitions"/>
<property name="contact" value="dev@wso2.org"/>
<property name="license" value="Apache 2.0"/>

@ -87,10 +87,9 @@ public class OperationUtils {
Notification lockResetNotification = new Notification();
lockResetNotification.setOperationId(status.getCommandReference());
lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW));
lockResetNotification.setDeviceIdentifier(deviceIdentifier);
lockResetNotification.setDescription(
Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION);
nmService.addNotification(lockResetNotification);
nmService.addNotification(deviceIdentifier, lockResetNotification);
} catch (NotificationManagementException e) {
throw new WindowsOperationException("Failure occurred in getting notification service", e);
}
@ -156,10 +155,9 @@ public class OperationUtils {
Notification lockResetNotification = new Notification();
lockResetNotification.setOperationId(status.getCommandReference());
lockResetNotification.setStatus(String.valueOf(Notification.Status.NEW));
lockResetNotification.setDeviceIdentifier(deviceIdentifier);
lockResetNotification.setDescription(Constants.SyncMLResponseCodes.LOCKRESET_NOTIFICATION);
nmService.addNotification(lockResetNotification);
nmService.addNotification(deviceIdentifier, lockResetNotification);
} catch (NotificationManagementException e) {
String msg = "Failure occurred in getting notification service";
log.error(msg, e);
@ -404,10 +402,9 @@ public class OperationUtils {
Notification notification = new Notification();
notification.setDescription("Auto generated DevicePin : " + pinValue);
notification.setOperationId(result.getCommandReference());
notification.setDeviceIdentifier(deviceIdentifier);
notification.setStatus(String.valueOf(Notification.Status.NEW));
try {
nmService.addNotification(notification);
nmService.addNotification(deviceIdentifier, notification);
} catch (NotificationManagementException e) {
String msg = "Failure Occurred in getting notification service.";
log.error(msg, e);

Loading…
Cancel
Save