public class HttpTunnelPayload extends Object
Modifier and Type | Field and Description |
---|---|
protected static char[] |
HEX_CHARS |
Constructor and Description |
---|
HttpTunnelPayload(long sequence,
ByteBuffer data)
Create a new
HttpTunnelPayload instance. |
Modifier and Type | Method and Description |
---|---|
void |
assignTo(org.springframework.http.HttpOutputMessage message)
Assign this payload to the given
HttpOutputMessage . |
static HttpTunnelPayload |
get(org.springframework.http.HttpInputMessage message)
Return the
HttpTunnelPayload for the given message or null if there
is no payload. |
static ByteBuffer |
getPayloadData(ReadableByteChannel channel)
Return the payload data for the given source
ReadableByteChannel or null if
the channel timed out whilst reading. |
long |
getSequence()
Return the sequence number of the payload.
|
void |
logIncoming()
Log incoming payload information at trace level to aid diagnostics.
|
void |
logOutgoing()
Log incoming payload information at trace level to aid diagnostics.
|
String |
toHexString()
Return the payload as a hexadecimal string.
|
void |
writeTo(WritableByteChannel channel)
Write the content of this payload to the given target channel.
|
public HttpTunnelPayload(long sequence, ByteBuffer data)
HttpTunnelPayload
instance.sequence
- the sequence number of the payloaddata
- the payload datapublic long getSequence()
public void assignTo(org.springframework.http.HttpOutputMessage message) throws IOException
HttpOutputMessage
.message
- the message to assign this payload toIOException
- in case of I/O errorspublic void writeTo(WritableByteChannel channel) throws IOException
channel
- the channel to write toIOException
- in case of I/O errorspublic static HttpTunnelPayload get(org.springframework.http.HttpInputMessage message) throws IOException
HttpTunnelPayload
for the given message or null
if there
is no payload.message
- the HTTP messagenull
IOException
- in case of I/O errorspublic static ByteBuffer getPayloadData(ReadableByteChannel channel) throws IOException
ReadableByteChannel
or null if
the channel timed out whilst reading.channel
- the source channelnull
IOException
- in case of I/O errorspublic void logIncoming()
public void logOutgoing()
public String toHexString()
Copyright © 2019 Pivotal Software, Inc.. All rights reserved.