Class HttpTunnelPayload
java.lang.Object
org.springframework.boot.devtools.tunnel.payload.HttpTunnelPayload
Encapsulates a payload data sent over a HTTP tunnel.
- Since:
- 1.3.0
- Author:
- Phillip Webb
-
Constructor Summary
ConstructorsConstructorDescriptionHttpTunnelPayload(long sequence, ByteBuffer data) Create a newHttpTunnelPayloadinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidassignTo(HttpOutputMessage message) Assign this payload to the givenHttpOutputMessage.static HttpTunnelPayloadget(HttpInputMessage message) Return theHttpTunnelPayloadfor the given message ornullif there is no payload.static ByteBuffergetPayloadData(ReadableByteChannel channel) Return the payload data for the given sourceReadableByteChannelor null if the channel timed out whilst reading.longReturn the sequence number of the payload.voidLog incoming payload information at trace level to aid diagnostics.voidLog incoming payload information at trace level to aid diagnostics.Return the payload as a hexadecimal string.voidwriteTo(WritableByteChannel channel) Write the content of this payload to the given target channel.
-
Constructor Details
-
HttpTunnelPayload
Create a newHttpTunnelPayloadinstance.- Parameters:
sequence- the sequence number of the payloaddata- the payload data
-
-
Method Details
-
getSequence
public long getSequence()Return the sequence number of the payload.- Returns:
- the sequence
-
assignTo
Assign this payload to the givenHttpOutputMessage.- Parameters:
message- the message to assign this payload to- Throws:
IOException- in case of I/O errors
-
writeTo
Write the content of this payload to the given target channel.- Parameters:
channel- the channel to write to- Throws:
IOException- in case of I/O errors
-
get
Return theHttpTunnelPayloadfor the given message ornullif there is no payload.- Parameters:
message- the HTTP message- Returns:
- the payload or
null - Throws:
IOException- in case of I/O errors
-
getPayloadData
Return the payload data for the given sourceReadableByteChannelor null if the channel timed out whilst reading.- Parameters:
channel- the source channel- Returns:
- payload data or
null - Throws:
IOException- in case of I/O errors
-
logIncoming
public void logIncoming()Log incoming payload information at trace level to aid diagnostics. -
logOutgoing
public void logOutgoing()Log incoming payload information at trace level to aid diagnostics. -
toHexString
Return the payload as a hexadecimal string.- Returns:
- the payload as a hex string
-