mirror of
https://repository.entgra.net/community/device-mgt-plugins.git
synced 2025-09-16 23:42:15 +00:00
Removing the mistakenly added getAllDevices from the andriod sense API
This commit is contained in:
parent
96e0ef92d7
commit
aa423787e8
@ -79,13 +79,5 @@ public interface AndroidSenseService {
|
|||||||
@Scope(key = "device:android-sense:enroll", name = "", description = "")
|
@Scope(key = "device:android-sense:enroll", name = "", description = "")
|
||||||
Response register(@PathParam("device_id") String deviceId, @QueryParam("deviceName") String deviceName);
|
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();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -299,28 +299,4 @@ public class AndroidSenseServiceImpl implements AndroidSenseService {
|
|||||||
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(false).build();
|
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<Device> userDevices =
|
|
||||||
APIUtil.getDeviceManagementService().getDevicesOfUser(APIUtil.getAuthenticatedUser());
|
|
||||||
ArrayList<Device> 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();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user