Interface Link<L extends Link<L>>
- 
- All Superinterfaces:
- Endpoint<L>
 - All Known Implementing Classes:
- ProtonLink,- ProtonReceiver,- ProtonSender
 
 public interface Link<L extends Link<L>> extends Endpoint<L> 
- 
- 
Method SummaryAll Methods Instance Methods Abstract Methods Modifier and Type Method Description LcreditStateUpdateHandler(EventHandler<L> handler)Handler for link credit updates that occur after a remoteFlowarrives.Ldetach()Detach this end of the link.LdetachHandler(EventHandler<L> remoteDetachHandler)Sets aEventHandlerfor when an AMQP Detach frame is received from the remote peer for thisLinkwhich would have been locally opened previously, the Detach from would have been marked as not having been closed.ConnectiongetConnection()intgetCredit()Get the credit that is currently available or assigned to this link.UnsignedLonggetMaxMessageSize()Gets the local link max message size.java.lang.StringgetName()SessiongetParent()Gets the parent of thisEndpointwhich can be itself forConnectioninstance.ReceiverSettleModegetReceiverSettleMode()Gets the local link receiver settlement mode.UnsignedLonggetRemoteMaxMessageSize()Gets the remote link max message size, as conveyed from the peer via the Attach frame when attaching the link to the session.ReceiverSettleModegetRemoteReceiverSettleMode()Gets the remote link receiver settlement mode, as conveyed from the peer via the Attach frame when attaching the link to the session.SenderSettleModegetRemoteSenderSettleMode()Gets the remote link sender settlement mode, as conveyed from the peer via the Attach frame when attaching the link to the session.SourcegetRemoteSource()LinkStategetRemoteState()<T extends Terminus>
 TgetRemoteTarget()Returns the remote targetTerminuscast to the given type.RolegetRole()SenderSettleModegetSenderSettleMode()Gets the local link sender settlement mode.SessiongetSession()SourcegetSource()LinkStategetState()<T extends Terminus>
 TgetTarget()Returns the currently set Target for thisLink.booleanisDraining()Indicates if the link is draining.booleanisLocallyClosedOrDetached()Returns true if thisLinkis currently locally detached or locally closed meaning the state returned fromgetState()is equal toLinkState.DETACHEDorLinkState.CLOSED.booleanisLocallyDetached()Returns true if thisLinkis currently locally detached meaning the state returned fromgetState()is equal toLinkState.DETACHED.booleanisReceiver()booleanisRemotelyClosed()Returns true if thisLinkis currently remotely closed meaning the state returned fromgetRemoteState()is equal toLinkState.CLOSED.booleanisRemotelyClosedOrDetached()Returns true if thisLinkis currently remotely detached or closed meaning the state returned fromgetRemoteState()is equal toLinkState.DETACHEDorLinkState.CLOSED.booleanisRemotelyDetached()Returns true if thisLinkis currently remotely detached meaning the state returned fromgetRemoteState()is equal toLinkState.DETACHED.booleanisRemotelyOpen()Returns true if thisLinkis currently remotely open meaning the state returned fromgetRemoteState()is equal toLinkState.ACTIVE.booleanisSender()LlocalDetachHandler(EventHandler<L> localDetachHandler)Sets aEventHandlerfor when an this link is detached locally via a call todetach()This is a convenience event that supplements the normalEndpoint.localCloseHandler(EventHandler)event point if set.LparentEndpointClosedHandler(EventHandler<L> handler)LsetMaxMessageSize(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.LsetReceiverSettleMode(ReceiverSettleMode receiverSettleMode)Sets the receiver settle mode.LsetSenderSettleMode(SenderSettleMode senderSettleMode)Sets the sender settle mode.LsetSource(Source source)LsetTarget(Target target)LsetTarget(Coordinator coordinator)Sets theCoordinatortarget to assign to the local end of thisLink.- 
Methods inherited from interface org.apache.qpid.protonj2.engine.Endpointclose, closeHandler, engineShutdownHandler, getAttachments, getCondition, getDesiredCapabilities, getEngine, getLinkedResource, getLinkedResource, getOfferedCapabilities, getProperties, getRemoteCondition, getRemoteDesiredCapabilities, getRemoteOfferedCapabilities, getRemoteProperties, isLocallyClosed, isLocallyOpen, localCloseHandler, localOpenHandler, open, openHandler, setCondition, setDesiredCapabilities, setLinkedResource, setOfferedCapabilities, setProperties
 
- 
 
- 
- 
- 
Method Detail- 
detachL detach() Detach this end of the link.- Returns:
- this Link.
- Throws:
- EngineStateException- if an error occurs detaching the- Linkor the Engine is shutdown.
 
 - 
isLocallyDetachedboolean isLocallyDetached() Returns true if thisLinkis currently locally detached meaning the state returned fromgetState()is equal toLinkState.DETACHED. A link is locally detached after a call todetach().- Returns:
- true if the link is locally closed.
- See Also:
- Endpoint.isLocallyOpen(),- Endpoint.isLocallyClosed()
 
 - 
isLocallyClosedOrDetachedboolean isLocallyClosedOrDetached() Returns true if thisLinkis currently locally detached or locally closed meaning the state returned fromgetState()is equal toLinkState.DETACHEDorLinkState.CLOSED. A link is locally detached after a call todetach()and is locally closed after a call toEndpoint.close().- Returns:
- true if the link is locally closed or detached.
- See Also:
- Endpoint.isLocallyOpen(),- isLocallyDetached(),- Endpoint.isLocallyClosed()
 
 - 
getStateLinkState getState() - Returns:
- the local link state
 
 - 
getCreditint getCredit() Get the credit that is currently available or assigned to this link.- Returns:
- the current link credit.
 
 - 
isDrainingboolean isDraining() Indicates if the link is draining. For aSenderlink this indicates that the remote has requested that the Sender transmit deliveries up to the currently available credit or indicate that it has no more to send. For aReceiverthis indicates that the Receiver has requested that the Sender consume its outstanding credit.- Returns:
- true if the Linkis currently marked as draining.
 
 - 
isSenderboolean isSender() - Returns:
- true if this link is acting in a sender Role.
 
 - 
isReceiverboolean isReceiver() - Returns:
- true if this link is acting in a receiver Role.
 
 - 
getConnectionConnection getConnection() - Returns:
- the parent Connectionfor theLink
 
 - 
getParentSession getParent() Description copied from interface:EndpointGets the parent of thisEndpointwhich can be itself forConnectioninstance.
 - 
getNamejava.lang.String getName() - Returns:
- the link name that is assigned to this Link
 
 - 
setSenderSettleModeL setSenderSettleMode(SenderSettleMode senderSettleMode) throws java.lang.IllegalStateException Sets the sender settle mode.Should only be called during link set-up, i.e. before calling Endpoint.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 calling 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 honoring the settlement mode. See Link.- Parameters:
- senderSettleMode- The- SenderSettleModethat will be set on the local end of this link.
- Returns:
- this Link.
- Throws:
- java.lang.IllegalStateException- if the- Linkhas already been opened.
 
 - 
getSenderSettleModeSenderSettleMode getSenderSettleMode() Gets the local link sender settlement mode.- Returns:
- the local sender settlement mode, or null if none was set.
- See Also:
- setSenderSettleMode(SenderSettleMode)
 
 - 
setReceiverSettleModeL setReceiverSettleMode(ReceiverSettleMode receiverSettleMode) throws java.lang.IllegalStateException Sets the receiver settle mode.Should only be called during link set-up, i.e. before calling Endpoint.open(). If this endpoint is the initiator of the link, this method can be used to set a value other than the default. Used in analogous way tosetSenderSettleMode(SenderSettleMode)- Parameters:
- receiverSettleMode- The- ReceiverSettleModethat will be set on the local end of this link.
- Returns:
- this Link.
- Throws:
- java.lang.IllegalStateException- if the- Linkhas already been opened.
 
 - 
getReceiverSettleModeReceiverSettleMode getReceiverSettleMode() Gets the local link receiver settlement mode.- Returns:
- the local receiver settlement mode, or null if none was set.
- See Also:
- setReceiverSettleMode(ReceiverSettleMode)
 
 - 
setSourceL setSource(Source source) throws java.lang.IllegalStateException Sets theSourceto assign to the local end of thisLink.Must be called during link setup, i.e. before calling the Endpoint.open()method.
 - 
setTargetL setTarget(Target target) throws java.lang.IllegalStateException Sets theTargetto assign to the local end of thisLink. Must be called during link setup, i.e. before calling theEndpoint.open()method.
 - 
setTargetL setTarget(Coordinator coordinator) throws java.lang.IllegalStateException Sets theCoordinatortarget to assign to the local end of thisLink.Must be called during link setup, i.e. before calling the Endpoint.open()method.- Parameters:
- coordinator- The- Coordinatortarget that will be set on the local end of this link.
- Returns:
- this Link.
- Throws:
- java.lang.IllegalStateException- if the- Linkhas already been opened.
 
 - 
getTarget<T extends Terminus> T getTarget() Returns the currently set Target for thisLink. A link target can be either aTargettype for aSenderorReceiverlink or if the link is to be transaction resource then the target type will be aCoordinatorinstance.- Type Parameters:
- T- The terminus type that the target should be cast to on return.
- Returns:
- the link target Terminusfor the local end of this link.
 
 - 
setMaxMessageSizeL setMaxMessageSize(UnsignedLong maxMessageSize) throws java.lang.IllegalStateException Sets 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 the Endpoint.open()method.- Parameters:
- maxMessageSize- the local max message size value, or null to clear. 0 also means no limit.
- Returns:
- this Link.
- Throws:
- java.lang.IllegalStateException- if the- Linkhas already been opened.
 
 - 
getMaxMessageSizeUnsignedLong getMaxMessageSize() Gets the local link max message size.- Returns:
- the local max message size, or null if none was set. 0 also means no limit.
- See Also:
- setMaxMessageSize(UnsignedLong)
 
 - 
isRemotelyOpenboolean isRemotelyOpen() Returns true if thisLinkis currently remotely open meaning the state returned fromgetRemoteState()is equal toLinkState.ACTIVE. A link is remotely opened after anAttachhas been received from the remote and before aDetachhas been received from the remote.- Specified by:
- isRemotelyOpenin interface- Endpoint<L extends Link<L>>
- Returns:
- true if the link is remotely open.
- See Also:
- isRemotelyClosed(),- isRemotelyDetached()
 
 - 
isRemotelyClosedboolean isRemotelyClosed() Returns true if thisLinkis currently remotely closed meaning the state returned fromgetRemoteState()is equal toLinkState.CLOSED. A link is remotely closed after anDetachhas been received from the remote with the close flag equal to true.- Specified by:
- isRemotelyClosedin interface- Endpoint<L extends Link<L>>
- Returns:
- true if the link is remotely closed.
- See Also:
- isRemotelyOpen(),- isRemotelyDetached()
 
 - 
isRemotelyDetachedboolean isRemotelyDetached() Returns true if thisLinkis currently remotely detached meaning the state returned fromgetRemoteState()is equal toLinkState.DETACHED. A link is remotely detached after anDetachhas been received from the remote with the close flag equal to false.- Returns:
- true if the link is remotely detached.
- See Also:
- isRemotelyOpen(),- isRemotelyClosed()
 
 - 
isRemotelyClosedOrDetachedboolean isRemotelyClosedOrDetached() Returns true if thisLinkis currently remotely detached or closed meaning the state returned fromgetRemoteState()is equal toLinkState.DETACHEDorLinkState.CLOSED. A link is remotely detached or closed after aDetachhas been received from the remote.- Returns:
- true if the link is remotely detached or closed.
- See Also:
- isRemotelyOpen(),- isRemotelyClosed(),- isRemotelyDetached()
 
 - 
getRemoteSourceSource getRemoteSource() - Returns:
- the source Terminusfor the remote end of this link.
 
 - 
getRemoteTarget<T extends Terminus> T getRemoteTarget() Returns the remote targetTerminuscast to the given type. This can be used when the underlying type is known by the caller or as a control to validate the assumption of the underlying type.the currently set Target for this Link. A link target can be either aTargettype for aSenderorReceiverlink or if the link is to be transaction resource then the target type will be aCoordinatorinstance.
 - 
getRemoteSenderSettleModeSenderSettleMode getRemoteSenderSettleMode() Gets the remote link sender settlement mode, as conveyed from the peer via the Attach frame when attaching the link to the session.- Returns:
- the sender settlement mode conveyed by the peer, or null if there was none.
- See Also:
- setSenderSettleMode(SenderSettleMode)
 
 - 
getRemoteReceiverSettleModeReceiverSettleMode getRemoteReceiverSettleMode() Gets the remote link receiver settlement mode, as conveyed from the peer via the Attach frame when attaching the link to the session.- Returns:
- the sender receiver mode conveyed by the peer, or null if there was none.
- See Also:
- setReceiverSettleMode(ReceiverSettleMode)
 
 - 
getRemoteMaxMessageSizeUnsignedLong getRemoteMaxMessageSize() Gets the remote link max message size, as conveyed from the peer via the Attach frame when attaching the link to the session.- Returns:
- the remote max message size conveyed by the peer, or null if none was set. 0 also means no limit.
 
 - 
getRemoteStateLinkState getRemoteState() - Returns:
- the remote link state (as last communicated)
 
 - 
localDetachHandlerL localDetachHandler(EventHandler<L> localDetachHandler) Sets aEventHandlerfor when an this link is detached locally via a call todetach()This is a convenience event that supplements the normalEndpoint.localCloseHandler(EventHandler)event point if set. If no local detached event handler is set the endpoint will route the detached event to the local closed event handler if set and allow it to process the event in one location.Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined. - Parameters:
- localDetachHandler- The- EventHandlerto notify when this link is locally detached.
- Returns:
- the link for chaining.
 
 - 
detachHandlerL detachHandler(EventHandler<L> remoteDetachHandler) Sets aEventHandlerfor when an AMQP Detach frame is received from the remote peer for thisLinkwhich would have been locally opened previously, the Detach from would have been marked as not having been closed.This is a convenience event that supplements the normal Endpoint.closeHandler(EventHandler)event point if set. If no detached event handler is set the endpoint will route the detached event to the closed event handler if set and allow it to process the event in one location.- Parameters:
- remoteDetachHandler- The- EventHandlerto notify when this link is remotely closed.
- Returns:
- the Linkfor chaining.
 
 - 
creditStateUpdateHandlerL creditStateUpdateHandler(EventHandler<L> handler) Handler for link credit updates that occur after a remoteFlowarrives.- Parameters:
- handler- An event handler that will be signaled when the link credit is updated by a remote flow.
- Returns:
- the Linkfor chaining.
 
 - 
parentEndpointClosedHandlerL parentEndpointClosedHandler(EventHandler<L> handler) Sets aEventHandlerfor when the parentSessionorConnectionof this link is locally closed.Typically used by clients for logging or other state update event processing. Clients should not perform any blocking calls within this context. It is an error for the handler to throw an exception and the outcome of doing so is undefined. - Parameters:
- handler- The- EventHandlerto notify when this link's parent Session is locally closed.
- Returns:
- the link for chaining.
 
 
- 
 
-