Re-enabling retrieval of device info

revert-70aa11f8
prabathabey 8 years ago
parent 3cb9b5bae2
commit 9ebf705323

@ -201,69 +201,68 @@ public interface DeviceManagementService {
required = false) required = false)
@HeaderParam("If-Modified-Since") String ifModifiedSince); @HeaderParam("If-Modified-Since") String ifModifiedSince);
// @POST @POST
// @ApiOperation( @Path("/get-info")
// consumes = MediaType.APPLICATION_JSON, @ApiOperation(
// produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON,
// httpMethod = "POST", produces = MediaType.APPLICATION_JSON,
// value = "Retrieve devices information from the supplied device identifies.", httpMethod = "POST",
// notes = "This will return device information such as CPU usage, memory usage etc for supplied device " + value = "Retrieve devices information from the supplied device identifies.",
// "identifiers.", notes = "This will return device information such as CPU usage, memory usage etc for supplied device " +
// response = DeviceInfo.class, "identifiers.",
// responseContainer = "List", tags = "Device Management")
// tags = "Device Management") @ApiResponses(
// @ApiResponses( value = {
// value = { @ApiResponse(
// @ApiResponse( code = 200,
// code = 200, message = "OK. \n Information of the submitted list of devices is returned",
// message = "OK. \n Information of the submitted list of devices is returned", response = DeviceInfo.class,
// response = DeviceInfo.class, responseContainer = "List",
// responseContainer = "List", responseHeaders = {
// responseHeaders = { @ResponseHeader(
// @ResponseHeader( name = "Content-Type",
// name = "Content-Type", description = "The content type of the body"),
// description = "The content type of the body"), @ResponseHeader(
// @ResponseHeader( name = "ETag",
// name = "ETag", description = "Entity Tag of the response resource.\n" +
// description = "Entity Tag of the response resource.\n" + "Used by caches, or in conditional requests."),
// "Used by caches, or in conditional requests."), @ResponseHeader(
// @ResponseHeader( name = "Last-Modified",
// name = "Last-Modified", description = "Date and time the resource has been modified the last time.\n" +
// description = "Date and time the resource has been modified the last time.\n" + "Used by caches, or in conditional requests.")}),
// "Used by caches, or in conditional requests.")}), @ApiResponse(
// @ApiResponse( code = 303,
// code = 303, message = "See Other. \n Source can be retrieved from the URL specified at the Location header.",
// message = "See Other. \n Source can be retrieved from the URL specified at the Location header.", responseHeaders = {
// responseHeaders = { @ResponseHeader(
// @ResponseHeader( name = "Content-Location",
// name = "Content-Location", description = "The Source URL of the document.")}),
// description = "The Source URL of the document.")}), @ApiResponse(
// @ApiResponse( code = 304,
// code = 304, message = "Not Modified. \n " +
// message = "Not Modified. \n " + "Empty body because the client already has the latest version of the requested resource."),
// "Empty body because the client already has the latest version of the requested resource."), @ApiResponse(
// @ApiResponse( code = 400,
// code = 400, message = "Bad Request. \n Invalid request or validation error."),
// message = "Bad Request. \n Invalid request or validation error."), @ApiResponse(
// @ApiResponse( code = 406,
// code = 406, message = "Not Acceptable. \n The requested media type is not supported."),
// message = "Not Acceptable. \n The requested media type is not supported."), @ApiResponse(
// @ApiResponse( code = 500,
// code = 500, message = "Internal Server ErrorResponse. \n " +
// message = "Internal Server ErrorResponse. \n " + "Server error occurred while retrieving information of the list of the devices submitted.")
// "Server error occurred while retrieving information of the list of the devices submitted.") })
// }) @Permission(scope = "device-info", permissions = {"/permission/admin/device-mgt/admin/devices/list"})
// @Permission(scope = "device-info", permissions = {"/permission/admin/device-mgt/admin/devices/list"}) Response getDevicesInfo(
// Response getDevicesInfo( @ApiParam(
// @ApiParam( name = "deviceIds",
// name = "deviceIds", value = "List of device identifiers",
// value = "List of device identifiers", required = true) List<DeviceIdentifier> deviceIds,
// required = true) List<DeviceIdentifier> deviceIds, @ApiParam(
// @ApiParam( name = "If-Modified-Since",
// name = "If-Modified-Since", value = "Timestamp of the last modified date",
// value = "Timestamp of the last modified date", required = false)
// required = false) @HeaderParam("If-Modified-Since") String timestamp);
// @HeaderParam("If-Modified-Since") String timestamp);
@GET @GET

@ -135,28 +135,28 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
} }
return Response.status(Response.Status.OK).entity(deviceInfo).build(); return Response.status(Response.Status.OK).entity(deviceInfo).build();
} }
//
// @POST @POST
// @Override @Override
// public Response getDevicesInfo( public Response getDevicesInfo(
// List<DeviceIdentifier> deviceIds, List<DeviceIdentifier> deviceIds,
// @HeaderParam("If-Modified-Since") String timestamp) { @HeaderParam("If-Modified-Since") String timestamp) {
// DeviceInformationManager informationManager; DeviceInformationManager informationManager;
// List<DeviceInfo> deviceInfo; List<DeviceInfo> deviceInfo;
// try { try {
// informationManager = DeviceMgtAPIUtils.getDeviceInformationManagerService(); informationManager = DeviceMgtAPIUtils.getDeviceInformationManagerService();
// deviceInfo = informationManager.getDevicesInfo(deviceIds); deviceInfo = informationManager.getDevicesInfo(deviceIds);
// if (deviceInfo == null) { if (deviceInfo == null) {
// return Response.status(Response.Status.NOT_FOUND).entity("No device information is available for the " + return Response.status(Response.Status.NOT_FOUND).entity("No device information is available for the " +
// "device list submitted").build(); "device list submitted").build();
// } }
// } catch (DeviceDetailsMgtException e) { } catch (DeviceDetailsMgtException e) {
// String msg = "Error occurred while getting the device information."; String msg = "Error occurred while getting the device information.";
// log.error(msg, e); log.error(msg, e);
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
// } }
// return Response.status(Response.Status.OK).entity(deviceInfo).build(); return Response.status(Response.Status.OK).entity(deviceInfo).build();
// } }
@GET @GET
@Path("/{type}/{id}") @Path("/{type}/{id}")

Loading…
Cancel
Save