public class ProtonReceiverImpl extends Object implements ProtonReceiver
| Modifier and Type | Field and Description |
|---|---|
protected org.apache.qpid.proton.engine.Link |
link |
| Modifier and Type | Method and Description |
|---|---|
boolean |
advance() |
org.apache.qpid.proton.engine.Record |
attachments()
Retrieves the attachments record, upon which application items can be set/retrieved.
|
T |
close()
Closes the AMQP link, i.e.
|
T |
closeHandler(Handler<AsyncResult<T>> closeHandler)
Sets a handler for when an AMQP Detach frame with closed=true is received from the remote peer.
|
org.apache.qpid.proton.engine.Delivery |
current() |
org.apache.qpid.proton.engine.Delivery |
delivery(byte[] tag) |
org.apache.qpid.proton.engine.Delivery |
delivery(byte[] tag,
int offset,
int length) |
T |
detach()
Detaches the AMQP link, i.e.
|
boolean |
detached() |
T |
detachHandler(Handler<AsyncResult<T>> detachHandler)
Sets a handler for when an AMQP Detach frame with closed=false is received from the remote peer.
|
ProtonReceiver |
drain(long timeout,
Handler<AsyncResult<Void>> completionHandler)
Initiates a 'drain' of link credit from the remote sender.
|
int |
drained() |
boolean |
draining() |
ProtonReceiver |
flow(int credits)
Grants the given number of message credits to the sender.
|
void |
free()
Tidies up related link resources when complete with use.
|
org.apache.qpid.proton.amqp.transport.ErrorCondition |
getCondition()
Gets the local ErrorCondition object.
|
int |
getCredit()
Retrieves the current amount of credit.
|
boolean |
getDrain()
Retrieves the current value of link 'drain' flag.
|
org.apache.qpid.proton.engine.EndpointState |
getLocalState() |
org.apache.qpid.proton.amqp.UnsignedLong |
getMaxMessageSize()
Gets the local link max message size.
|
String |
getName()
Retrieves the link name
|
int |
getPrefetch()
Get the current prefetch value.
|
ProtonQoS |
getQoS()
Gets the local QOS config.
|
int |
getQueued()
Retrieves the current number of queued messages.
|
String |
getRemoteAddress()
Retrieves the remote address from the remote terminus (source for receivers, target for senders).
|
org.apache.qpid.proton.amqp.transport.ErrorCondition |
getRemoteCondition()
Gets the remote ErrorCondition object.
|
int |
getRemoteCredit() |
org.apache.qpid.proton.amqp.Symbol[] |
getRemoteDesiredCapabilities()
Gets the remote desired capabilities, as conveyed from the peer via the Attach frame
when attaching the link to the session.
|
org.apache.qpid.proton.amqp.UnsignedLong |
getRemoteMaxMessageSize()
Gets the remote link max message size, as conveyed from the peer via the Attach frame
when attaching the link to the session.
|
org.apache.qpid.proton.amqp.Symbol[] |
getRemoteOfferedCapabilities()
Gets the remote offered capabilities, as conveyed from the peer via the Attach frame
when attaching the link to the session.
|
Map<org.apache.qpid.proton.amqp.Symbol,Object> |
getRemoteProperties()
Gets the remote link properties, as conveyed from the peer via the Attach frame
when attaching the link to the session.
|
ProtonQoS |
getRemoteQoS()
Gets the remote QOS config.
|
org.apache.qpid.proton.amqp.transport.Source |
getRemoteSource()
Gets the current remote source config.
|
org.apache.qpid.proton.engine.EndpointState |
getRemoteState() |
org.apache.qpid.proton.amqp.transport.Target |
getRemoteTarget()
Gets the current remote target config.
|
ProtonSessionImpl |
getSession()
Gets the session this link is on.
|
org.apache.qpid.proton.amqp.transport.Source |
getSource()
Gets the current local source config.
|
org.apache.qpid.proton.amqp.transport.Target |
getTarget()
Gets the current local target config.
|
int |
getUnsettled() |
ProtonReceiver |
handler(ProtonMessageHandler handler)
Sets the handler to process messages as they arrive.
|
boolean |
isAutoAccept()
Get whether the receiver is auto accepting.
|
boolean |
isOpen()
Check whether the link is locally open.
|
ProtonReceiver |
open()
Opens the AMQP link, i.e.
|
T |
openHandler(Handler<AsyncResult<T>> openHandler)
Sets a handler for when an AMQP Attach frame is received from the remote peer.
|
int |
recv(byte[] bytes,
int offset,
int size) |
protected ProtonReceiverImpl |
self() |
ProtonReceiver |
setAutoAccept(boolean autoAccept)
Sets whether received deliveries should be automatically accepted (and settled) after the message handler runs for
them, if no other disposition has been applied during handling.
|
T |
setCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition condition)
Sets the local ErrorCondition object.
|
void |
setDesiredCapabilities(org.apache.qpid.proton.amqp.Symbol[] capabilities)
Sets the desired capabilities, to be conveyed to the peer via the Attach frame
when attaching the link to the session.
|
ProtonReceiver |
setDrain(boolean drain) |
void |
setMaxMessageSize(org.apache.qpid.proton.amqp.UnsignedLong maxMessageSize)
Sets the local link max message size, to be conveyed to the peer via the Attach frame
when attaching the link to the session.
|
void |
setOfferedCapabilities(org.apache.qpid.proton.amqp.Symbol[] capabilities)
Sets the offered capabilities, to be conveyed to the peer via the Attach frame
when attaching the link to the session.
|
ProtonReceiver |
setPrefetch(int messages)
Sets the number of message credits the receiver grants and replenishes automatically as messages are delivered.
|
void |
setProperties(Map<org.apache.qpid.proton.amqp.Symbol,Object> properties)
Sets the link properties, to be conveyed to the peer via the Attach frame
when attaching the link to the session.
|
T |
setQoS(ProtonQoS qos)
Sets the local QOS config.
|
T |
setSource(org.apache.qpid.proton.amqp.transport.Source source)
Sets the current local source config.
|
T |
setTarget(org.apache.qpid.proton.amqp.transport.Target target)
Sets the current local target config.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitattachments, close, closeHandler, detach, detachHandler, free, getCondition, getCredit, getDrain, getMaxMessageSize, getName, getQoS, getQueued, getRemoteCondition, getRemoteDesiredCapabilities, getRemoteMaxMessageSize, getRemoteOfferedCapabilities, getRemoteProperties, getRemoteQoS, getRemoteSource, getRemoteTarget, getSession, getSource, getTarget, isOpen, openHandler, setCondition, setDesiredCapabilities, setMaxMessageSize, setOfferedCapabilities, setProperties, setQoS, setSource, setTargetprotected ProtonReceiverImpl self()
public int recv(byte[] bytes,
int offset,
int size)
public String getRemoteAddress()
ProtonLinkgetRemoteAddress in interface ProtonLink<ProtonReceiver>public ProtonReceiver drain(long timeout, Handler<AsyncResult<Void>> completionHandler)
ProtonReceiverProtonReceiver.setPrefetch(int) has been used to disable automatic credit handling.drain in interface ProtonReceivertimeout - the delay in milliseconds before which the drain attempt should be considered failed, or 0 for no timeout.completionHandler - handler called when credit hits 0 due to messages arriving, or a 'drain response' flowpublic ProtonReceiver flow(int credits) throws IllegalStateException
ProtonReceiverProtonReceiver.setPrefetch(int) has been used to disable automatic prefetch credit handling.flow in interface ProtonReceivercredits - the credits to flowIllegalStateException - if prefetch is non-zero, or an existing drain operation is not yet completepublic boolean draining()
public ProtonReceiver setDrain(boolean drain)
public ProtonReceiver handler(ProtonMessageHandler handler)
ProtonReceiverhandler in interface ProtonReceiverhandler - the handler to process messagespublic boolean isAutoAccept()
ProtonReceiverisAutoAccept in interface ProtonReceiverProtonReceiver.setAutoAccept(boolean)public ProtonReceiver setAutoAccept(boolean autoAccept)
ProtonReceiversetAutoAccept in interface ProtonReceiverautoAccept - whether deliveries should be auto accepted after handling if no disposition was appliedpublic ProtonReceiver setPrefetch(int messages)
ProtonReceiverProtonReceiver.flow(int) as needed to manually grant credit.setPrefetch in interface ProtonReceivermessages - the message prefetchpublic int getPrefetch()
ProtonReceivergetPrefetch in interface ProtonReceiverProtonReceiver.setPrefetch(int)public ProtonReceiver open()
ProtonLinkProtonLink.openHandler(Handler) may be used to handle the peer sending their Attach
frame.open in interface ProtonLink<ProtonReceiver>public ProtonSessionImpl getSession()
ProtonLinkgetSession in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.engine.Record attachments()
ProtonLinkattachments in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.amqp.transport.ErrorCondition getCondition()
ProtonLinkgetCondition in interface ProtonLink<T extends ProtonLink<T>>public int getCredit()
ProtonLinkProtonLink.getQueued() to assess the number of credits that will be used by queued messages.getCredit in interface ProtonLink<T extends ProtonLink<T>>public boolean getDrain()
ProtonLinkgetDrain in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.engine.EndpointState getLocalState()
public String getName()
ProtonLinkgetName in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.amqp.transport.ErrorCondition getRemoteCondition()
ProtonLinkgetRemoteCondition in interface ProtonLink<T extends ProtonLink<T>>public int getRemoteCredit()
public org.apache.qpid.proton.engine.EndpointState getRemoteState()
public org.apache.qpid.proton.amqp.transport.Target getRemoteTarget()
ProtonLinkgetRemoteTarget in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.amqp.transport.Target getTarget()
ProtonLinkgetTarget in interface ProtonLink<T extends ProtonLink<T>>public T setTarget(org.apache.qpid.proton.amqp.transport.Target target)
ProtonLinksetTarget in interface ProtonLink<T extends ProtonLink<T>>target - the targetpublic org.apache.qpid.proton.amqp.transport.Source getRemoteSource()
ProtonLinkgetRemoteSource in interface ProtonLink<T extends ProtonLink<T>>public org.apache.qpid.proton.amqp.transport.Source getSource()
ProtonLinkgetSource in interface ProtonLink<T extends ProtonLink<T>>public T setSource(org.apache.qpid.proton.amqp.transport.Source source)
ProtonLinksetSource in interface ProtonLink<T extends ProtonLink<T>>source - the sourcepublic int getUnsettled()
public int getQueued()
ProtonLinkgetQueued in interface ProtonLink<T extends ProtonLink<T>>public boolean advance()
public int drained()
public boolean detached()
public org.apache.qpid.proton.engine.Delivery delivery(byte[] tag,
int offset,
int length)
public org.apache.qpid.proton.engine.Delivery current()
public T setCondition(org.apache.qpid.proton.amqp.transport.ErrorCondition condition)
ProtonLinksetCondition in interface ProtonLink<T extends ProtonLink<T>>condition - the condition to setpublic org.apache.qpid.proton.engine.Delivery delivery(byte[] tag)
public T close()
ProtonLinkProtonLink.closeHandler(Handler) should be used to handle the peer
sending their Detach frame with closed=true (and ProtonLink.detachHandler(Handler) can be used to handle the peer
sending their Detach frame with closed=false). When use of the link is complete, i.e it is locally and
remotely closed, ProtonLink.free() must be called to ensure related resources can be tidied up.close in interface ProtonLink<T extends ProtonLink<T>>public T detach()
ProtonLinkProtonLink.detachHandler(Handler) should be used to handle the peer
sending their Detach frame with closed=false (and ProtonLink.closeHandler(Handler) can be used to handle the peer
sending their Detach frame with closed=true). When use of the link is complete, i.e it is locally and
remotely detached, ProtonLink.free() must be called to ensure related resources can be tidied up.detach in interface ProtonLink<T extends ProtonLink<T>>public T openHandler(Handler<AsyncResult<T>> openHandler)
ProtonLinkProtonConnection.senderOpenHandler(Handler) and
ProtonConnection.receiverOpenHandler(Handler).openHandler in interface ProtonLink<T extends ProtonLink<T>>openHandler - the handlerpublic T closeHandler(Handler<AsyncResult<T>> closeHandler)
ProtonLinkcloseHandler in interface ProtonLink<T extends ProtonLink<T>>closeHandler - the handlerpublic T detachHandler(Handler<AsyncResult<T>> detachHandler)
ProtonLinkdetachHandler in interface ProtonLink<T extends ProtonLink<T>>detachHandler - the handlerpublic boolean isOpen()
ProtonLinkisOpen in interface ProtonLink<T extends ProtonLink<T>>public ProtonQoS getQoS()
ProtonLinkgetQoS in interface ProtonLink<T extends ProtonLink<T>>public ProtonQoS getRemoteQoS()
ProtonLinkgetRemoteQoS in interface ProtonLink<T extends ProtonLink<T>>public T setQoS(ProtonQoS qos)
ProtonLinksetQoS in interface ProtonLink<T extends ProtonLink<T>>qos - the QOS to configurepublic org.apache.qpid.proton.amqp.UnsignedLong getMaxMessageSize()
ProtonLinkgetMaxMessageSize in interface ProtonLink<T extends ProtonLink<T>>ProtonLink.setMaxMessageSize(UnsignedLong)public void setMaxMessageSize(org.apache.qpid.proton.amqp.UnsignedLong maxMessageSize)
ProtonLinkProtonLink.open() method.setMaxMessageSize in interface ProtonLink<T extends ProtonLink<T>>maxMessageSize - the local max message size value, or null to clear. 0 also means no limit.public org.apache.qpid.proton.amqp.UnsignedLong getRemoteMaxMessageSize()
ProtonLinkgetRemoteMaxMessageSize in interface ProtonLink<T extends ProtonLink<T>>public Map<org.apache.qpid.proton.amqp.Symbol,Object> getRemoteProperties()
ProtonLinkgetRemoteProperties in interface ProtonLink<T extends ProtonLink<T>>public void setProperties(Map<org.apache.qpid.proton.amqp.Symbol,Object> properties)
ProtonLinkProtonLink.open() method.setProperties in interface ProtonLink<T extends ProtonLink<T>>properties - the properties of the link to be coveyed to the remote peer.public void setOfferedCapabilities(org.apache.qpid.proton.amqp.Symbol[] capabilities)
ProtonLinkProtonLink.open() method.setOfferedCapabilities in interface ProtonLink<T extends ProtonLink<T>>capabilities - the capabilities offered to the remote peer.public org.apache.qpid.proton.amqp.Symbol[] getRemoteOfferedCapabilities()
ProtonLinkgetRemoteOfferedCapabilities in interface ProtonLink<T extends ProtonLink<T>>public void setDesiredCapabilities(org.apache.qpid.proton.amqp.Symbol[] capabilities)
ProtonLinkProtonLink.open() method.setDesiredCapabilities in interface ProtonLink<T extends ProtonLink<T>>capabilities - the capabilities desired of the remote peer.public org.apache.qpid.proton.amqp.Symbol[] getRemoteDesiredCapabilities()
ProtonLinkgetRemoteDesiredCapabilities in interface ProtonLink<T extends ProtonLink<T>>public void free()
ProtonLinkfree in interface ProtonLink<T extends ProtonLink<T>>Copyright © 2020. All rights reserved.