/** * Creates an empty response for a request ID that contains only the status. * * @param requestId The request ID of the command that this is the response for. * @param deviceId The device ID of the device sending the response. * @param status The HTTP status code indicating the outcome of the command. * @return The response or {@code null} if the request ID could not be parsed, the status is {@code null} or if the * status code is < 200 or >= 600. */ public static CommandResponse from(final String requestId, final String deviceId, final Integer status) { return from(requestId, deviceId, null, null, status); }
final CommandResponse commandResponse = CommandResponse.from(context.getMessagePayload(), context.getMessageContentType(), statusCode, correlationId, context.getResourceIdentifier());
tenant, deviceId, commandRequestId, responseStatus); final CommandResponse commandResponse = CommandResponse.from(commandRequestId, deviceId, payload, contentType, responseStatus);
tenant, deviceId, commandRequestId, responseStatus); final CommandResponse commandResponse = CommandResponse.from(commandRequestId, deviceId, payload, contentType, responseStatus);
final Integer status = Integer.parseInt(addressPath[CommandConstants.TOPIC_POSITION_RESPONSE_STATUS]); final String reqId = addressPath[CommandConstants.TOPIC_POSITION_RESPONSE_REQ_ID]; final CommandResponse commandResponse = CommandResponse.from( reqId, targetAddress.getResourceId(), ctx.message().payload(), ctx.contentType(), status);
final Integer status = Integer.parseInt(addressPath[CommandConstants.TOPIC_POSITION_RESPONSE_STATUS]); final String reqId = addressPath[CommandConstants.TOPIC_POSITION_RESPONSE_REQ_ID]; final CommandResponse commandResponse = CommandResponse.from( reqId, targetAddress.getResourceId(), ctx.message().payload(), ctx.contentType(), status);