/** * Sends a request message to a device. * This call is generally used to perform remote management of resources * attached to the device such sensors and registries. * * @param scopeId The {@link ScopeId} of the {@link Device}. * @param deviceId The {@link Device} ID. * @param timeout The timeout of the request execution * @param requestMessage The input request * @return The response output. * @throws Exception Whenever something bad happens. See specific {@link KapuaService} exceptions. */ @POST @Consumes({MediaType.APPLICATION_XML}) @Produces({MediaType.APPLICATION_XML}) @ApiOperation(nickname = "deviceRequestSend", value = "Sends a request", notes = "Sends a request message to a device", response = DeviceCommandOutput.class) public GenericResponseMessage sendRequest( @ApiParam(value = "The ScopeId of the device", required = true, defaultValue = DEFAULT_SCOPE_ID) @PathParam("scopeId") ScopeId scopeId, @ApiParam(value = "The id of the device", required = true) @PathParam("deviceId") EntityId deviceId, @ApiParam(value = "The timeout of the request execution") @QueryParam("timeout") Long timeout, @ApiParam(value = "The input request", required = true) GenericRequestMessage requestMessage) throws Exception { requestMessage.setScopeId(scopeId); requestMessage.setDeviceId(deviceId); return requestService.exec(requestMessage, timeout); } }
genericRequestMessage.setDeviceId(jsonGenericRequestMessage.getDeviceId()); genericRequestMessage.setClientId(jsonGenericRequestMessage.getClientId()); genericRequestMessage.setReceivedOn(jsonGenericRequestMessage.getReceivedOn());
genericRequestMessage.setDeviceId(requestInput.getDeviceId()); genericRequestMessage.setCapturedOn(new Date()); genericRequestMessage.setChannel(genericRequestChannel);
genericRequestMessage.setDeviceId(requestInput.getDeviceId()); genericRequestMessage.setCapturedOn(new Date()); genericRequestMessage.setChannel(genericRequestChannel);
genericRequestMessage.setDeviceId(requestInput.getDeviceId()); genericRequestMessage.setCapturedOn(new Date()); genericRequestMessage.setChannel(genericRequestChannel);