public class TransportImpl extends EndpointImpl implements ProtonJTransport, FrameBody.FrameBodyHandler<Integer>, FrameHandler
DEFAULT_MAX_FRAME_SIZE, END_OF_STREAM, MIN_MAX_FRAME_SIZE, SESSION_WINDOW
Constructor and Description |
---|
TransportImpl()
Deprecated.
This constructor's visibility will be reduced to the default scope in a future release.
Client code outside this module should use a
EngineFactory instead |
Modifier and Type | Method and Description |
---|---|
void |
bind(Connection conn) |
int |
capacity() |
void |
close_head() |
void |
close_tail() |
void |
closed() |
void |
free()
free the endpoint and any associated resources
|
protected ConnectionImpl |
getConnectionImpl() |
ByteBuffer |
getInputBuffer()
Get a buffer that can be used to write input data into the transport.
|
int |
getMaxFrameSize()
Get the maximum frame size for the transport
|
ByteBuffer |
getOutputBuffer()
Get a read-only byte buffer containing the transport's pending output.
|
ProtocolTracer |
getProtocolTracer() |
int |
getRemoteMaxFrameSize() |
void |
handleAttach(Attach attach,
Binary payload,
Integer channel) |
void |
handleBegin(Begin begin,
Binary payload,
Integer channel) |
void |
handleClose(Close close,
Binary payload,
Integer channel) |
void |
handleDetach(Detach detach,
Binary payload,
Integer channel) |
void |
handleDisposition(Disposition disposition,
Binary payload,
Integer channel) |
void |
handleEnd(End end,
Binary payload,
Integer channel) |
void |
handleFlow(Flow flow,
Binary payload,
Integer channel) |
boolean |
handleFrame(TransportFrame frame) |
void |
handleOpen(Open open,
Binary payload,
Integer channel) |
void |
handleTransfer(Transfer transfer,
Binary payload,
Integer channel) |
ByteBuffer |
head() |
int |
input(byte[] bytes,
int offset,
int length)
Processes the provided input.
|
boolean |
isHandlingFrames()
Returns whether I am currently able to handle frames.
|
TransportResult |
oldApiCheckStateBeforeInput(int inputLength)
This method is public as it is used by Python layer.
|
int |
output(byte[] bytes,
int offset,
int size)
Has the transport produce up to size bytes placing the result
into dest beginning at position offset.
|
void |
outputConsumed()
Informs the transport that the output buffer returned by
Transport.getOutputBuffer()
is finished with, allowing implementation-dependent steps to be performed such as
reclaiming buffer space. |
int |
pending() |
void |
pop(int bytes) |
void |
process() |
TransportResult |
processInput()
Tell the transport to process the data written to the input buffer.
|
Sasl |
sasl() |
void |
setFrameHandler(FrameHandler frameHandler)
Override the default frame handler.
|
void |
setMaxFrameSize(int maxFrameSize)
TODO propagate the new value to
_outputProcessor etc |
void |
setProtocolTracer(ProtocolTracer protocolTracer) |
Ssl |
ssl(SslDomain sslDomain)
As per
Transport.ssl(SslDomain, SslPeerDetails) but no attempt is made to resume a previous SSL session. |
Ssl |
ssl(SslDomain sslDomain,
SslPeerDetails sslPeerDetails)
Wrap this transport's output and input to apply SSL encryption and decryption respectively.
|
ByteBuffer |
tail() |
String |
toString() |
boolean |
writeInto(ByteBuffer outputBuffer)
Writes my pending output bytes into outputBuffer.
|
close, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContext
@Deprecated public TransportImpl()
EngineFactory
insteadpublic int getMaxFrameSize()
Transport
getMaxFrameSize
in interface Transport
public int getRemoteMaxFrameSize()
getRemoteMaxFrameSize
in interface Transport
public void setMaxFrameSize(int maxFrameSize)
_outputProcessor
etcsetMaxFrameSize
in interface Transport
public void bind(Connection conn)
public int input(byte[] bytes, int offset, int length)
Transport
public TransportResult oldApiCheckStateBeforeInput(int inputLength)
Transport.input(byte[], int, int)
public int output(byte[] bytes, int offset, int size)
Transport
public boolean writeInto(ByteBuffer outputBuffer)
public Ssl ssl(SslDomain sslDomain, SslPeerDetails sslPeerDetails)
Ssl
object, regardless of the parameters supplied.
Note that sslDomain must implement ProtonSslEngineProvider
. This is not possible
enforce at the API level because ProtonSslEngineProvider
is not part of the
public Proton API.
public Ssl ssl(SslDomain sslDomain)
Transport
Transport.ssl(SslDomain, SslPeerDetails)
but no attempt is made to resume a previous SSL session.protected ConnectionImpl getConnectionImpl()
getConnectionImpl
in class EndpointImpl
public void free()
Endpoint
free
in interface Endpoint
free
in class EndpointImpl
public void handleOpen(Open open, Binary payload, Integer channel)
handleOpen
in interface FrameBody.FrameBodyHandler<Integer>
public void handleBegin(Begin begin, Binary payload, Integer channel)
handleBegin
in interface FrameBody.FrameBodyHandler<Integer>
public void handleAttach(Attach attach, Binary payload, Integer channel)
handleAttach
in interface FrameBody.FrameBodyHandler<Integer>
public void handleFlow(Flow flow, Binary payload, Integer channel)
handleFlow
in interface FrameBody.FrameBodyHandler<Integer>
public void handleTransfer(Transfer transfer, Binary payload, Integer channel)
handleTransfer
in interface FrameBody.FrameBodyHandler<Integer>
public void handleDisposition(Disposition disposition, Binary payload, Integer channel)
handleDisposition
in interface FrameBody.FrameBodyHandler<Integer>
public void handleDetach(Detach detach, Binary payload, Integer channel)
handleDetach
in interface FrameBody.FrameBodyHandler<Integer>
public void handleEnd(End end, Binary payload, Integer channel)
handleEnd
in interface FrameBody.FrameBodyHandler<Integer>
public void handleClose(Close close, Binary payload, Integer channel)
handleClose
in interface FrameBody.FrameBodyHandler<Integer>
public boolean handleFrame(TransportFrame frame)
handleFrame
in interface FrameHandler
FrameHandler.isHandlingFrames()
public void closed()
closed
in interface FrameHandler
public boolean isHandlingFrames()
FrameHandler
FrameHandler.handleFrame(TransportFrame)
.isHandlingFrames
in interface FrameHandler
public ProtocolTracer getProtocolTracer()
getProtocolTracer
in interface ProtonJTransport
public void setProtocolTracer(ProtocolTracer protocolTracer)
setProtocolTracer
in interface ProtonJTransport
public ByteBuffer getInputBuffer()
Transport
Transport.processInput()
must be called.
Successive calls to this method are not guaranteed to return the same object.
Once Transport.processInput()
is called the buffer must not be used.getInputBuffer
in interface Transport
public TransportResult processInput()
Transport
Transport.processInput()
calls on this object will
throw an exception.processInput
in interface Transport
Transport.getInputBuffer()
public ByteBuffer getOutputBuffer()
Transport
Transport.outputConsumed()
must be called.
Successive calls to this method are not guaranteed to return the same object.
Once Transport.outputConsumed()
is called the buffer must not be used.
If the transport's state changes AFTER calling this method, this will not be
reflected in the output buffer.getOutputBuffer
in interface Transport
public void outputConsumed()
Transport
Transport.getOutputBuffer()
is finished with, allowing implementation-dependent steps to be performed such as
reclaiming buffer space.outputConsumed
in interface Transport
public ByteBuffer tail()
public void process() throws TransportException
process
in interface Transport
TransportException
public void close_tail()
close_tail
in interface Transport
public ByteBuffer head()
public void close_head()
close_head
in interface Transport
public String toString()
toString
in class EndpointImpl
public void setFrameHandler(FrameHandler frameHandler)
getInputBuffer()
, getOutputBuffer()
, ssl(SslDomain)
etc).Copyright © 2014 The Apache Software Foundation. All rights reserved.