Class LinkImpl
java.lang.Object
org.apache.qpid.proton.engine.impl.EndpointImpl
org.apache.qpid.proton.engine.impl.LinkImpl
- All Implemented Interfaces:
Endpoint,Extendable,Link,ProtonJEndpoint
- Direct Known Subclasses:
ReceiverImpl,SenderImpl
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddCredit(int credit) booleanadvance()Attempts to advance the current delivery.current()Returns the current deliverydelivery(byte[] tag) Create a delivery object based on the specified tag and adds it to the this link's delivery list and its connection work list.delivery(byte[] tag, int offset, int length) Create a delivery object based on the specified tag.voiddetach()booleandetached()intdrained()protected ConnectionImplintGets the credit balance for a link.Symbol[]Gets the local link desired capabilities.booleangetDrain()Gets the local link max message size.getName()Returns the name of the linkSymbol[]Gets the local link offered capabilities.Gets the local link properties.intGets the number of queued messages for a link.Symbol[]Gets the remote link desired capabilities, as conveyed from the peer via the Attach frame when attaching the link to the session.Gets the remote link max message size, as conveyed from the peer via the Attach frame when attaching the link to the session.Symbol[]Gets the remote link offered capabilities, as conveyed from the peer via the Attach frame when attaching the link to the session.Gets the remote link properties, as conveyed from the peer via the Attach frame when attaching the link to the session.inthead()Returns the head delivery on the link.next(EnumSet<EndpointState> local, EnumSet<EndpointState> remote) voidsetCredit(int credit) voidsetDesiredCapabilities(Symbol[] desiredCapabilities) Sets the local link desired capabilities, to be conveyed to the peer via the Attach frame when attaching the link to the session.voidsetMaxMessageSize(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.voidsetOfferedCapabilities(Symbol[] offeredCapabilities) Sets the local link offered capabilities, to be conveyed to the peer via the Attach frame when attaching the link to the session.voidsetProperties(Map<Symbol, Object> properties) Sets the local link properties, to be conveyed to the peer via the Attach frame when attaching the link to the session.voidsetReceiverSettleMode(ReceiverSettleMode receiverSettleMode) Sets the receiver settle mode.voidsetRemoteSenderSettleMode(SenderSettleMode remoteSenderSettleMode) TODO should this be part of the interface?voidsetSenderSettleMode(SenderSettleMode senderSettleMode) Sets the sender settle mode.voidSets the source for this link.voidExpected to be used in a similar manner toLink.setSource(Source)Methods inherited from class org.apache.qpid.proton.engine.impl.EndpointImpl
attachments, close, free, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.qpid.proton.engine.Endpoint
close, free, getCondition, getContext, getLocalState, getRemoteCondition, getRemoteState, open, setCondition, setContextMethods inherited from interface org.apache.qpid.proton.engine.Extendable
attachmentsMethods inherited from interface org.apache.qpid.proton.engine.Link
getRemoteCredit
-
Method Details
-
getName
Description copied from interface:LinkReturns the name of the link -
delivery
Description copied from interface:LinkCreate a delivery object based on the specified tag and adds it to the this link's delivery list and its connection work list. TODO to clarify - this adds the delivery to the connection list. It is not yet clear why this is done or if it is useful for the application to be able to discover newly created deliveries from theConnection.getWorkHead(). -
delivery
Description copied from interface:LinkCreate a delivery object based on the specified tag. This form of the method is intended to allow the tag to be formed from a subsequence of the byte array passed in. This might allow more optimisation options in future but at present is not implemented. -
current
Description copied from interface:LinkReturns the current delivery -
advance
public boolean advance()Description copied from interface:LinkAttempts to advance the current delivery. Advances it to the next delivery if one exists, else null. The behaviour of this method is different for senders and receivers. -
getConnectionImpl
- Specified by:
getConnectionImplin classEndpointImpl
-
getSession
- Specified by:
getSessionin interfaceLink
-
getRemoteSource
- Specified by:
getRemoteSourcein interfaceLink- See Also:
-
getRemoteTarget
- Specified by:
getRemoteTargetin interfaceLink- See Also:
-
getSource
-
setSource
Description copied from interface:LinkSets the source for this link. The initiator of the link must always provide a Source. An application responding to the creation of the link should perform an application specific lookup on theLink.getRemoteSource()to determine an actual Source. If it failed to determine an actual source, it should set null, and then go on toEndpoint.close()the link. -
getTarget
-
setTarget
Description copied from interface:LinkExpected to be used in a similar manner toLink.setSource(Source) -
next
-
getCredit
public int getCredit()Description copied from interface:LinkGets the credit balance for a link. Note that a sending link may still be used to send deliveries even if link credit is/reaches zero, however those deliveries will end up beingqueuedby the link until enough credit is obtained from the receiver to send them over the wire. In this case the balance reported will go negative. -
addCredit
public void addCredit(int credit) -
setCredit
public void setCredit(int credit) -
getQueued
public int getQueued()Description copied from interface:LinkGets the number of queued messages for a link. Links may queue deliveries for a number of reasons, for example there may be insufficientcreditto send them to the receiver, they may not have yet had a chance to be written to the wire, or the receiving application has simply not yet processed them. -
getUnsettled
public int getUnsettled()- Specified by:
getUnsettledin interfaceLink
-
getDrain
public boolean getDrain() -
getSenderSettleMode
- Specified by:
getSenderSettleModein interfaceLink
-
setSenderSettleMode
Description copied from interface:LinkSets the sender settle mode. Should only be called during link set-up, i.e. before callingEndpoint.open(). If this endpoint is the initiator of the link, this method can be used to set a value other than the default. If this endpoint is not the initiator, this method should be used to set a local value. According to the AMQP spec, the application may choose to accept the sender's suggestion (accessed by callingLink.getRemoteSenderSettleMode()) or choose another value. The value has no effect on Proton, but may be useful to the application at a later point. In order to be AMQP compliant the application is responsible for honouring the settlement mode. SeeLink.- Specified by:
setSenderSettleModein interfaceLink
-
getRemoteSenderSettleMode
- Specified by:
getRemoteSenderSettleModein interfaceLink- See Also:
-
setRemoteSenderSettleMode
Description copied from interface:LinkTODO should this be part of the interface?- Specified by:
setRemoteSenderSettleModein interfaceLink
-
getReceiverSettleMode
- Specified by:
getReceiverSettleModein interfaceLink
-
setReceiverSettleMode
Description copied from interface:LinkSets the receiver settle mode. Used in analogous way toLink.setSenderSettleMode(SenderSettleMode)- Specified by:
setReceiverSettleModein interfaceLink
-
getRemoteReceiverSettleMode
- Specified by:
getRemoteReceiverSettleModein interfaceLink- See Also:
-
getProperties
Description copied from interface:LinkGets the local link properties.- Specified by:
getPropertiesin interfaceLink- See Also:
-
setProperties
Description copied from interface:LinkSets the local link properties, to be conveyed to the peer via the Attach frame when attaching the link to the session. Must be called during link setup, i.e. before calling theEndpoint.open()method.- Specified by:
setPropertiesin interfaceLink
-
getRemoteProperties
Description copied from interface:LinkGets the remote link properties, as conveyed from the peer via the Attach frame when attaching the link to the session.- Specified by:
getRemotePropertiesin interfaceLink- Returns:
- the properties Map conveyed by the peer, or null if there was none.
-
getDesiredCapabilities
Description copied from interface:LinkGets the local link desired capabilities.- Specified by:
getDesiredCapabilitiesin interfaceLink- Returns:
- the desired capabilities array, or null if none was set.
- See Also:
-
setDesiredCapabilities
Description copied from interface:LinkSets the local link desired capabilities, to be conveyed to the peer via the Attach frame when attaching the link to the session. Must be called during link setup, i.e. before calling theEndpoint.open()method.- Specified by:
setDesiredCapabilitiesin interfaceLink- Parameters:
desiredCapabilities- the desired capabilities array to send, or null for none.
-
getRemoteDesiredCapabilities
Description copied from interface:LinkGets the remote link desired capabilities, as conveyed from the peer via the Attach frame when attaching the link to the session.- Specified by:
getRemoteDesiredCapabilitiesin interfaceLink- Returns:
- the desired capabilities array conveyed by the peer, or null if there was none.
-
getOfferedCapabilities
Description copied from interface:LinkGets the local link offered capabilities.- Specified by:
getOfferedCapabilitiesin interfaceLink- Returns:
- the offered capabilities array, or null if none was set.
- See Also:
-
setOfferedCapabilities
Description copied from interface:LinkSets the local link offered capabilities, to be conveyed to the peer via the Attach frame when attaching the link to the session. Must be called during link setup, i.e. before calling theEndpoint.open()method.- Specified by:
setOfferedCapabilitiesin interfaceLink- Parameters:
offeredCapabilities- the offered capabilities array to send, or null for none.
-
getRemoteOfferedCapabilities
Description copied from interface:LinkGets the remote link offered capabilities, as conveyed from the peer via the Attach frame when attaching the link to the session.- Specified by:
getRemoteOfferedCapabilitiesin interfaceLink- Returns:
- the offered capabilities array conveyed by the peer, or null if there was none.
-
getMaxMessageSize
Description copied from interface:LinkGets the local link max message size.- Specified by:
getMaxMessageSizein interfaceLink- Returns:
- the local max message size, or null if none was set. 0 also means no limit.
- See Also:
-
setMaxMessageSize
Description copied from interface:LinkSets the local link max message size, to be conveyed to the peer via the Attach frame when attaching the link to the session. Null or 0 means no limit. Must be called during link setup, i.e. before calling theEndpoint.open()method.- Specified by:
setMaxMessageSizein interfaceLink- Parameters:
maxMessageSize- the local max message size value, or null to clear. 0 also means no limit.
-
getRemoteMaxMessageSize
Description copied from interface:LinkGets the remote link max message size, as conveyed from the peer via the Attach frame when attaching the link to the session.- Specified by:
getRemoteMaxMessageSizein interfaceLink- Returns:
- the remote max message size conveyed by the peer, or null if none was set. 0 also means no limit.
-
drained
public int drained() -
head
Description copied from interface:LinkReturns the head delivery on the link. -
detach
public void detach() -
detached
public boolean detached()
-