Package com.azure.core.amqp.exception
Class LinkErrorContext
java.lang.Object
com.azure.core.amqp.exception.AmqpErrorContext
com.azure.core.amqp.exception.SessionErrorContext
com.azure.core.amqp.exception.LinkErrorContext
- All Implemented Interfaces:
Serializable
Represents the context for an AMQP link when an
AmqpException occurs.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLinkErrorContext(String namespace, String entityPath, String trackingId, Integer linkCredit) Creates a new instance with the AMQP link'snamespaceandentityPathinformation. -
Method Summary
Modifier and TypeMethodDescriptionGets the number of credits on the link when the error occurred.Gets the unique tracking identifier for this error.toString()Creates a string representation of this ErrorContext.Methods inherited from class com.azure.core.amqp.exception.SessionErrorContext
getEntityPathMethods inherited from class com.azure.core.amqp.exception.AmqpErrorContext
getErrorInfo, getNamespace
-
Constructor Details
-
LinkErrorContext
Creates a new instance with the AMQP link'snamespaceandentityPathinformation. Allows for optional information about the link if it was successfully opened such aslinkCreditandtrackingId.- Parameters:
namespace- The service namespace of the error context.entityPath- The remote container the AMQP receive link is fetching messages from.trackingId- The tracking id for the error. Tracking id can benullif the error was not thrown from the remote AMQP message broker.linkCredit- the number of link credits the current AMQP link has when this error occurred, can benullif the receive link has not opened yet.- Throws:
IllegalArgumentException- ifnamespaceorentityPathisnullor empty.
-
-
Method Details
-
getTrackingId
Gets the unique tracking identifier for this error. It is possible to benullif the error was not thrown from the AMQP message broker.- Returns:
- The unique tracking identifier for this error.
-
getLinkCredit
Gets the number of credits on the link when the error occurred. Can benullif the link is not opened.- Returns:
- The number of credits on the link when the error occurred.
-
toString
Creates a string representation of this ErrorContext.- Overrides:
toStringin classSessionErrorContext- Returns:
- A string representation of this ErrorContext.
-