Package org.apache.thrift.transport.sasl
Class FixedSizeHeaderReader
java.lang.Object
org.apache.thrift.transport.sasl.FixedSizeHeaderReader
- All Implemented Interfaces:
FrameHeaderReader
- Direct Known Subclasses:
DataFrameHeaderReader,SaslNegotiationHeaderReader
Headers' size should be predefined.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the header and make it available to read a new header.protected abstract intbooleanprotected abstract voidActions (e.g. validation) to carry out when the header is complete.booleanread(TTransport transport) (Nonblocking) Read fields from underlying transport layer.byte[]toBytes()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.thrift.transport.sasl.FrameHeaderReader
payloadSize
-
Field Details
-
byteBuffer
-
-
Constructor Details
-
FixedSizeHeaderReader
public FixedSizeHeaderReader()
-
-
Method Details
-
isComplete
public boolean isComplete()- Specified by:
isCompletein interfaceFrameHeaderReader- Returns:
- true if this header has all its fields set.
-
clear
public void clear()Description copied from interface:FrameHeaderReaderClear the header and make it available to read a new header.- Specified by:
clearin interfaceFrameHeaderReader
-
toBytes
public byte[] toBytes()- Specified by:
toBytesin interfaceFrameHeaderReader- Returns:
- The received bytes for the header.
-
read
Description copied from interface:FrameHeaderReader(Nonblocking) Read fields from underlying transport layer.- Specified by:
readin interfaceFrameHeaderReader- 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.
-
headerSize
protected abstract int headerSize()- Returns:
- Size of the header.
-
onComplete
Actions (e.g. validation) to carry out when the header is complete.- Throws:
TTransportException
-