@Override public org.apache.qpid.proton.amqp.transport.Source copy() { return new Source(this); } }
@Override public org.apache.qpid.proton.amqp.transport.Source copy() { return new Source(this); } }
@Override public Source getSource(String address) { Source source = new Source(); source.setAddress(address); return source; }
private static SenderLinkSettings getControllerLinkSettings(MessagingFactory underlyingFactory) { SenderLinkSettings linkSettings = new SenderLinkSettings(); linkSettings.linkPath = "coordinator"; final Target target = new Coordinator(); linkSettings.target = target; linkSettings.source = new Source(); linkSettings.settleMode = SenderSettleMode.UNSETTLED; linkSettings.requiresAuthentication = false; Map<Symbol, Object> linkProperties = new HashMap<>(); // ServiceBus expects timeout to be of type unsignedint linkProperties.put(ClientConstants.LINK_TIMEOUT_PROPERTY, UnsignedInteger.valueOf(Util.adjustServerTimeout(underlyingFactory.getOperationTimeout()).toMillis())); linkSettings.linkProperties = linkProperties; return linkSettings; } }
protected Source createJmsSource(boolean topic) { Source source = new Source(); // Set the capability to indicate the node type being created if (!topic) { source.setCapabilities(QUEUE_CAPABILITY); } else { source.setCapabilities(TOPIC_CAPABILITY); } return source; } }
protected Source createJmsSource(boolean topic) { Source source = new Source(); // Set the capability to indicate the node type being created if (!topic) { source.setCapabilities(QUEUE_CAPABILITY); } else { source.setCapabilities(TOPIC_CAPABILITY); } return source; } }
@Override public void onLinkInit(Event event) { // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_015: [The event handler shall create a new Target (Proton) object using the given endpoint address] // Codes_SRS_SERVICE_SDK_JAVA_AMQPFEEDBACKRECEIVEDHANDLER_12_016: [The event handler shall get the Link (Proton) object and set its target to the created Target (Proton) object] Link link = event.getLink(); if (event.getLink().getName().equals(RECEIVE_TAG)) { Target t = new Target(); t.setAddress(ENDPOINT); Source source = new Source(); source.setAddress(ENDPOINT); link.setTarget(t); link.setSource(source); } }
@Override public void onLinkInit(Event event) { // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_015: [The event handler shall create a new Target (Proton) object using the given endpoint address] // Codes_SRS_SERVICE_SDK_JAVA_AMQPFILEUPLOADNOTIFICATIONRECEIVEDHANDLER_25_016: [The event handler shall get the Link (Proton) object and set its target to the created Target (Proton) object] Link link = event.getLink(); if (event.getLink().getName().equals(FILE_NOTIFICATION_RECEIVE_TAG)) { Target t = new Target(); t.setAddress(FILENOTIFICATION_ENDPOINT); Source source = new Source(); source.setAddress(FILENOTIFICATION_ENDPOINT); link.setTarget(t); link.setSource(source); } }
private Source createNonSharedSource(TerminusDurability terminusDurability) { Source source = new Source(); source.setAddress(address.toString()); source.setCapabilities(TOPIC_CAPABILITY); source.setDurable(terminusDurability); return source; }
private Source createSharedSource(TerminusDurability terminusDurability) { Source source = new Source(); source.setAddress(address.toString()); source.setCapabilities(TOPIC_CAPABILITY, SHARED); source.setDurable(terminusDurability); return source; }
private Source createSharedGlobalSource(TerminusDurability terminusDurability) { Source source = new Source(); source.setAddress(address.toString()); source.setCapabilities(TOPIC_CAPABILITY, SHARED, GLOBAL); source.setDurable(terminusDurability); return source; } }
protected Source createDynamicSource(boolean topic) { Source source = new Source(); source.setDynamic(true); source.setDurable(TerminusDurability.NONE); source.setExpiryPolicy(TerminusExpiryPolicy.LINK_DETACH); // Set the dynamic node lifetime-policy Map<Symbol, Object> dynamicNodeProperties = new HashMap<>(); dynamicNodeProperties.put(LIFETIME_POLICY, DeleteOnClose.getInstance()); source.setDynamicNodeProperties(dynamicNodeProperties); // Set the capability to indicate the node type being created if (!topic) { source.setCapabilities(TEMP_QUEUE_CAPABILITY); } else { source.setCapabilities(TEMP_TOPIC_CAPABILITY); } return source; }
private void createSender(org.apache.qpid.proton.engine.Session session) throws Exception { Sender sender = session.sender(subscriberInfo.getClientId()); Target target = new Target(); target.setAddress(subscriberInfo.getClientAddress()); sender.setTarget(target); Source source = new Source(); source.setAddress(subscriberInfo.getClientAddress()); source.setDurable(TerminusDurability.UNSETTLED_STATE); sender.setSource(source); sender.open(); } }
public Receiver create(Session session) { Receiver receiver = session.receiver(_path); Source source = new Source(); source.setAddress(_path); receiver.setSource(source); // the C implemenation does this: Target target = new Target(); target.setAddress(_path); receiver.setTarget(target); if (getIncomingWindow() > 0) { // use explicit settlement via dispositions (not pre-settled) receiver.setSenderSettleMode(SenderSettleMode.UNSETTLED); // desired receiver.setReceiverSettleMode(ReceiverSettleMode.SECOND); } return receiver; } }
public Sender create(Session session) { Sender sender = session.sender(_path); Target target = new Target(); target.setAddress(_path); sender.setTarget(target); // the C implemenation does this: Source source = new Source(); source.setAddress(_path); sender.setSource(source); if (getOutgoingWindow() > 0) { // use explicit settlement via dispositions (not pre-settled) sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.SECOND); // desired } return sender; } }
public Sender create(Session session) { Sender sender = session.sender(_path); Target target = new Target(); target.setAddress(_path); sender.setTarget(target); // the C implemenation does this: Source source = new Source(); source.setAddress(_path); sender.setSource(source); if (getOutgoingWindow() > 0) { // use explicit settlement via dispositions (not pre-settled) sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.SECOND); // desired } return sender; } }
@Override protected void doOpen() { Coordinator coordinator = new Coordinator(); coordinator.setCapabilities(TxnCapability.LOCAL_TXN); Source source = new Source(); String coordinatorName = "qpid-jms:coordinator:" + session.getConnection().getConnectionId(); Sender sender = session.getEndpoint().sender(coordinatorName); sender.setSource(source); sender.setTarget(coordinator); sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.FIRST); setEndpoint(sender); super.doOpen(); }
@Override public AMQPClientReceiverContext createReceiver(String name, String address) throws ActiveMQAMQPException { FutureRunnable futureRunnable = new FutureRunnable(1); ProtonClientReceiverContext amqpReceiver; synchronized (connection.getLock()) { Receiver receiver = session.receiver(name); Source source = new Source(); source.setAddress(address); receiver.setSource(source); amqpReceiver = new ProtonClientReceiverContext(sessionSPI, connection, this, receiver); receiver.setContext(amqpReceiver); amqpReceiver.afterInit(futureRunnable); receiver.open(); } connection.flush(); waitWithTimeout(futureRunnable); return amqpReceiver; } }
@Override protected Sender createEndpoint(JmsSessionInfo resourceInfo) { Coordinator coordinator = new Coordinator(); coordinator.setCapabilities(TxnCapability.LOCAL_TXN); Symbol[] outcomes = new Symbol[]{ Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL }; Source source = new Source(); source.setOutcomes(outcomes); String coordinatorName = "qpid-jms:coordinator:" + resourceInfo.getId().toString(); Sender sender = getParent().getSession().getEndpoint().sender(coordinatorName); sender.setSource(source); sender.setTarget(coordinator); sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.FIRST); return sender; }
@Override protected Sender createEndpoint(JmsSessionInfo resourceInfo) { Coordinator coordinator = new Coordinator(); coordinator.setCapabilities(TxnCapability.LOCAL_TXN); Symbol[] outcomes = new Symbol[]{ Accepted.DESCRIPTOR_SYMBOL, Rejected.DESCRIPTOR_SYMBOL, Released.DESCRIPTOR_SYMBOL, Modified.DESCRIPTOR_SYMBOL }; Source source = new Source(); source.setOutcomes(outcomes); String coordinatorName = "qpid-jms:coordinator:" + resourceInfo.getId().toString(); Sender sender = getParent().getSession().getEndpoint().sender(coordinatorName); sender.setSource(source); sender.setTarget(coordinator); sender.setSenderSettleMode(SenderSettleMode.UNSETTLED); sender.setReceiverSettleMode(ReceiverSettleMode.FIRST); return sender; }