use of org.apache.qpid.proton.engine.Link in project azure-iot-sdk-java by Azure.
the class ReceiverLinkHandler method onLinkRemoteClose.
@Override
public void onLinkRemoteClose(Event event) {
Link link = event.getLink();
if (link.getLocalState() == EndpointState.ACTIVE) {
log.debug("{} receiver link with link correlation id {} was closed remotely unexpectedly", getLinkInstanceType(), this.linkCorrelationId);
link.close();
} else {
log.trace("Closing amqp session now that this {} receiver link with link correlation id {} has closed remotely and locally", getLinkInstanceType(), linkCorrelationId);
event.getSession().close();
}
}
use of org.apache.qpid.proton.engine.Link in project azure-iot-sdk-java by Azure.
the class SenderLinkHandler method onLinkInit.
@Override
public void onLinkInit(Event event) {
// This function is called per sender/receiver link after it is instantiated, and before it is opened.
// It sets some properties on that link, and then opens it.
Link link = event.getLink();
Target target = new Target();
target.setAddress(this.senderLinkAddress);
link.setTarget(target);
link.setSenderSettleMode(SenderSettleMode.UNSETTLED);
link.setProperties(this.amqpProperties);
link.open();
log.trace("Opening {} sender link with correlation id {}", this.getLinkInstanceType(), this.linkCorrelationId);
}
use of org.apache.qpid.proton.engine.Link in project azure-iot-sdk-java by Azure.
the class SenderLinkHandler method onLinkLocalClose.
@Override
public void onLinkLocalClose(Event event) {
Link link = event.getLink();
if (link.getRemoteState() == EndpointState.CLOSED) {
log.trace("Closing amqp session now that this {} sender link with link correlation id {} has closed remotely and locally", getLinkInstanceType(), linkCorrelationId);
event.getSession().close();
} else {
log.trace("{} sender link with correlation id {} was closed locally", this.getLinkInstanceType(), this.linkCorrelationId);
}
}
use of org.apache.qpid.proton.engine.Link in project azure-iot-sdk-java by Azure.
the class SenderLinkHandler method onLinkRemoteClose.
@Override
public void onLinkRemoteClose(Event event) {
Link link = event.getLink();
if (link.getLocalState() == EndpointState.ACTIVE) {
log.debug("{} sender link with link correlation id {} was closed remotely unexpectedly", getLinkInstanceType(), this.linkCorrelationId);
link.close();
} else {
log.trace("Closing amqp session now that this {} sender link with link correlation id {} has closed remotely and locally", getLinkInstanceType(), linkCorrelationId);
event.getSession().close();
}
}
use of org.apache.qpid.proton.engine.Link in project azure-service-bus-java by Azure.
the class SendLinkHandler method onLinkRemoteOpen.
@Override
public void onLinkRemoteOpen(Event event) {
Link link = event.getLink();
if (link != null && link instanceof Sender) {
Sender sender = (Sender) link;
if (link.getRemoteTarget() != null) {
TRACE_LOGGER.debug("onLinkRemoteOpen: linkName:{}, remoteTarge:{}", sender.getName(), link.getRemoteTarget());
synchronized (this.firstFlow) {
this.isFirstFlow = false;
this.msgSender.onOpenComplete(null);
}
} else {
TRACE_LOGGER.debug("onLinkRemoteOpen: linkName:{}, remoteTarget:{}, remoteSource:{}, action:{}", sender.getName(), null, null, "waitingForError");
}
}
}
Aggregations