Re-enabling retrieval of device info

4.x.x
prabathabey 9 years ago
parent dada719486
commit e002ffb54a

@ -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 = "If-Modified-Since",
// name = "deviceIds", value = "Timestamp of the last modified date",
// value = "List of device identifiers", required = false)
// required = true) List<DeviceIdentifier> deviceIds, @HeaderParam("If-Modified-Since") String timestamp,
// @ApiParam( @ApiParam(
// name = "If-Modified-Since", name = "deviceIds",
// value = "Timestamp of the last modified date", value = "List of device identifiers",
// required = false) required = true) List<DeviceIdentifier> deviceIds);
// @HeaderParam("If-Modified-Since") String timestamp);
@GET @GET

@ -131,28 +131,29 @@ 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 @Path("/get-info")
// public Response getDevicesInfo( @Override
// List<DeviceIdentifier> deviceIds, public Response getDevicesInfo(
// @HeaderParam("If-Modified-Since") String timestamp) { @HeaderParam("If-Modified-Since") String timestamp,
// DeviceInformationManager informationManager; List<DeviceIdentifier> deviceIds) {
// List<DeviceInfo> deviceInfo; DeviceInformationManager informationManager;
// try { List<DeviceInfo> deviceInfo;
// informationManager = DeviceMgtAPIUtils.getDeviceInformationManagerService(); try {
// deviceInfo = informationManager.getDevicesInfo(deviceIds); informationManager = DeviceMgtAPIUtils.getDeviceInformationManagerService();
// if (deviceInfo == null) { deviceInfo = informationManager.getDevicesInfo(deviceIds);
// return Response.status(Response.Status.NOT_FOUND).entity("No device information is available for the " + if (deviceInfo == null) {
// "device list submitted").build(); return Response.status(Response.Status.NOT_FOUND).entity("No device information is available for the " +
// } "device list submitted").build();
// } catch (DeviceDetailsMgtException e) { }
// String msg = "Error occurred while getting the device information."; } catch (DeviceDetailsMgtException e) {
// log.error(msg, e); String msg = "Error occurred while getting the device information.";
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); log.error(msg, e);
// } 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