From aa423787e8a3e998189d796e99c43ac1b081e55c Mon Sep 17 00:00:00 2001 From: sinthuja Date: Tue, 1 Nov 2016 18:37:09 +0530 Subject: [PATCH] Removing the mistakenly added getAllDevices from the andriod sense API --- .../service/impl/AndroidSenseService.java | 8 ------- .../service/impl/AndroidSenseServiceImpl.java | 24 ------------------- 2 files changed, 32 deletions(-) diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseService.java index ebafb0139a..348a9008d6 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseService.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseService.java @@ -79,13 +79,5 @@ public interface AndroidSenseService { @Scope(key = "device:android-sense:enroll", name = "", description = "") Response register(@PathParam("device_id") String deviceId, @QueryParam("deviceName") String deviceName); - /** - * Get All Devices. - */ - @Path("devices") - @GET - @Scope(key = "device:android-sense:enroll", name = "", description = "") - Response getAllDevices(); - } diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseServiceImpl.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseServiceImpl.java index 5d49212976..1a987eb4f7 100644 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseServiceImpl.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.api/src/main/java/org/wso2/carbon/device/mgt/iot/androidsense/service/impl/AndroidSenseServiceImpl.java @@ -299,28 +299,4 @@ public class AndroidSenseServiceImpl implements AndroidSenseService { return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(false).build(); } } - - @Path("/devices") - @GET - @Consumes("application/json") - @Produces("application/json") - public Response getAllDevices() { - try { - List userDevices = - APIUtil.getDeviceManagementService().getDevicesOfUser(APIUtil.getAuthenticatedUser()); - ArrayList deviceList = new ArrayList<>(); - for (Device device : userDevices) { - if (device.getType().equals(AndroidSenseConstants.DEVICE_TYPE) && - device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.ACTIVE)) { - deviceList.add(device); - } - } - Device[] devices = deviceList.toArray(new Device[]{}); - return Response.ok().entity(devices).build(); - } catch (DeviceManagementException e) { - log.error(e.getMessage(), e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); - } - } - }