public class TransportImpl extends EndpointImpl implements ProtonJTransport, FrameBody.FrameBodyHandler<Integer>, FrameHandler
Transport.Factory
DEFAULT_MAX_FRAME_SIZE, END_OF_STREAM, MIN_MAX_FRAME_SIZE, SESSION_WINDOW, TRACE_DRV, TRACE_FRM, TRACE_OFF, TRACE_RAW
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
Transport.Factory.create() instead |
Modifier and Type | Method and Description |
---|---|
void |
bind(Connection conn) |
int |
capacity() |
void |
close_head() |
void |
close_tail() |
void |
closed(TransportException error) |
int |
getChannelMax()
Gets the local channel-max value to be advertised to the remote peer
|
ErrorCondition |
getCondition() |
protected ConnectionImpl |
getConnectionImpl() |
long |
getFramesInput() |
long |
getFramesOutput() |
int |
getIdleTimeout() |
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() |
Reactor |
getReactor() |
int |
getRemoteChannelMax()
Gets the remote value of channel-max, as advertised by the peer on its
Open frame.
|
int |
getRemoteIdleTimeout() |
int |
getRemoteMaxFrameSize() |
Selectable |
getSelectable() |
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 |
isClosed() |
boolean |
isEmitFlowEventOnSend() |
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()
Signal the transport to expect SASL frames used to establish a SASL layer prior to
performing the AMQP protocol version negotiation.
|
void |
setChannelMax(int channelMax)
Set the local value of channel-max, to be advertised to the peer on the
Open frame emitted by the transport.
|
void |
setEmitFlowEventOnSend(boolean emitFlowEventOnSend)
Configure whether a synthetic Flow event should be emitted when messages are sent,
reflecting a change in the credit level on the link that may prompt other action.
|
void |
setFrameHandler(FrameHandler frameHandler)
Override the default frame handler.
|
void |
setIdleTimeout(int timeout) |
void |
setMaxFrameSize(int maxFrameSize) |
void |
setProtocolTracer(ProtocolTracer protocolTracer) |
void |
setReactor(Reactor reactor) |
void |
setSelectable(Selectable selectable) |
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() |
long |
tick(long now) |
String |
toString() |
void |
trace(int levels) |
void |
unbind() |
protected void |
writeFrame(int channel,
FrameBody frameBody,
ByteBuffer payload,
Runnable onPayloadTooLarge) |
boolean |
writeInto(ByteBuffer outputBuffer)
Writes my pending output bytes into outputBuffer.
|
attachments, close, free, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, free, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContext
attachments
@Deprecated public TransportImpl()
Transport.Factory.create()
insteadpublic int getMaxFrameSize()
Transport
getMaxFrameSize
in interface Transport
public int getRemoteMaxFrameSize()
getRemoteMaxFrameSize
in interface Transport
public void setMaxFrameSize(int maxFrameSize)
setMaxFrameSize
in interface Transport
public int getChannelMax()
Transport
getChannelMax
in interface Transport
Transport.setChannelMax(int)
public void setChannelMax(int channelMax)
Transport
Transport.getRemoteChannelMax()
.setChannelMax
in interface Transport
channelMax
- the local channel-max to advertise to the peer, in range [0 - 2^16).public int getRemoteChannelMax()
Transport
Transport.getChannelMax()
.getRemoteChannelMax
in interface Transport
public ErrorCondition getCondition()
getCondition
in interface Endpoint
getCondition
in interface Transport
getCondition
in class EndpointImpl
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 Sasl sasl()
Transport
Sasl
object.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 void writeFrame(int channel, FrameBody frameBody, ByteBuffer payload, Runnable onPayloadTooLarge)
protected ConnectionImpl getConnectionImpl()
getConnectionImpl
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(TransportException error)
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 setIdleTimeout(int timeout)
setIdleTimeout
in interface Transport
timeout
- local idle timeout in millisecondspublic int getIdleTimeout()
getIdleTimeout
in interface Transport
public int getRemoteIdleTimeout()
getRemoteIdleTimeout
in interface Transport
public long getFramesOutput()
getFramesOutput
in interface Transport
public long getFramesInput()
getFramesInput
in interface Transport
public void close_head()
close_head
in interface Transport
public void setFrameHandler(FrameHandler frameHandler)
getInputBuffer()
, getOutputBuffer()
, ssl(SslDomain)
etc).public void setSelectable(Selectable selectable)
public Selectable getSelectable()
public void setReactor(Reactor reactor)
public Reactor getReactor()
public void setEmitFlowEventOnSend(boolean emitFlowEventOnSend)
Transport
setEmitFlowEventOnSend
in interface Transport
emitFlowEventOnSend
- true if a flow event should be emitted, false otherwisepublic boolean isEmitFlowEventOnSend()
isEmitFlowEventOnSend
in interface Transport
Copyright © 2016 The Apache Software Foundation. All rights reserved.