&& linkNamePattern.matcher(link.getName()).matches()) getLink().setSource(new Source(link.getSource())); return true;
@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); }
@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); }
getLink().getHighestSupportedTerminusDurability())); source.setExpiryPolicy(attachSource.getExpiryPolicy()); source.setDistributionMode(attachSource.getDistributionMode()); source.setFilter(attachSource.getFilter()); source.setCapabilities(attachSource.getCapabilities()); final SendingDestination destination = getSession().getSendingDestination(getLink(), source); source.setCapabilities(destination.getCapabilities()); getLink().setSource(source); prepareConsumerOptionsAndFilters(destination); getLink().setTarget(target);