Package org.apache.thrift.transport.sasl
Interface FrameHeaderReader
- All Known Implementing Classes:
DataFrameHeaderReader,FixedSizeHeaderReader,SaslNegotiationHeaderReader
public interface FrameHeaderReader
Read headers for a frame. For each frame, the header contains payload size and other metadata.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the header and make it available to read a new header.booleanintAs the thrift sasl specification states, all sasl messages (both for negotiatiing and for sending data) should have a header to indicate the size of the payload.booleanread(TTransport transport) (Nonblocking) Read fields from underlying transport layer.byte[]toBytes()
-
Method Details
-
payloadSize
int payloadSize()As the thrift sasl specification states, all sasl messages (both for negotiatiing and for sending data) should have a header to indicate the size of the payload.- Returns:
- size of the payload.
-
toBytes
byte[] toBytes()- Returns:
- The received bytes for the header.
- Throws:
IllegalStateException- if isComplete returns false.
-
isComplete
boolean isComplete()- Returns:
- true if this header has all its fields set.
-
clear
void clear()Clear the header and make it available to read a new header. -
read
(Nonblocking) Read fields from underlying transport layer.- Parameters:
transport- underlying transport.- Returns:
- true if header is complete after read.
- Throws:
TSaslNegotiationException- if fail to read a valid header of a sasl negotiation message.TTransportException- if io error.
-