Package org.apache.thrift.transport.sasl
Interface FrameHeaderReader
-
- All Known Implementing Classes:
DataFrameHeaderReader,FixedSizeHeaderReader,SaslNegotiationHeaderReader
public interface FrameHeaderReaderRead headers for a frame. For each frame, the header contains payload size and other metadata.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclear()Clear the header and make it available to read a new header.booleanisComplete()intpayloadSize()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.booleanread(TTransport transport)(Nonblocking) Read fields from underlying transport layer.byte[]toBytes()
-
-
-
Method Detail
-
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:
java.lang.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
boolean read(TTransport transport) throws TSaslNegotiationException, TTransportException
(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.
-
-