@Override protected void establishLink(final Attach attach) throws AmqpErrorException { if (getSource() != null || getTarget() != null) { throw new IllegalStateException("LinkEndpoint and Termini should be null when establishing a Link."); } Coordinator target = new Coordinator(); Source source = (Source) attach.getSource(); getLink().setTermini(source, target); attachReceived(attach); }
@Override protected void reattachLink(final Attach attach) throws AmqpErrorException { if (getSource() == null) { throw new IllegalStateException("Terminus should be set when resuming a Link."); } if (attach.getSource() == null) { throw new IllegalStateException("Attach.getSource should not be null when resuming a Link. That would be recovering the Link."); } Source newSource = (Source) attach.getSource(); Source oldSource = getSource(); final SendingDestination destination = getSession().getSendingDestination(getLink(), oldSource); prepareConsumerOptionsAndFilters(destination); if (getDestination() instanceof ExchangeSendingDestination && !Boolean.TRUE.equals(newSource.getDynamic())) { final SendingDestination newDestination = getSession().getSendingDestination(getLink(), newSource); if (getSession().updateSourceForSubscription(this, newSource, newDestination)) { setDestination(newDestination); } } attachReceived(attach); }
@Override protected void resumeLink(final Attach attach) throws AmqpErrorException { if (getSource() == null) { throw new IllegalStateException("Terminus should be set when resuming a Link."); } if (attach.getSource() == null) { throw new IllegalStateException("Attach.getSource should not be null when resuming a Link. That would be recovering the Link."); } Source newSource = (Source) attach.getSource(); Source oldSource = getSource(); final SendingDestination destination = getSession().getSendingDestination(getLink(), oldSource); prepareConsumerOptionsAndFilters(destination); if (getDestination() instanceof ExchangeSendingDestination && !Boolean.TRUE.equals(newSource.getDynamic())) { final SendingDestination newDestination = getSession().getSendingDestination(getLink(), newSource); if (getSession().updateSourceForSubscription(this, newSource, newDestination)) { setDestination(newDestination); } } attachReceived(attach); }
Source source = (Source) attach.getSource(); Target target = new Target(); Target attachTarget = (Target) attach.getTarget();
boolean isAttachingRemoteTerminusNull = (attach.getRole() == Role.SENDER ? attach.getSource() == null : attach.getTarget() == null); boolean isAttachingLocalTerminusNull = (attach.getRole() == Role.SENDER ? attach.getTarget() == null : attach.getSource() == null); boolean isLocalTerminusNull = (attach.getRole() == Role.SENDER ? getTarget() == null : getSource() == null);
Source attachSource = (Source) attach.getSource();
if( _value.getSource() != null)