@Override public ProtonConnectionImpl setContainer(String container) { connection.setContainer(container); return this; }
@Override public void setContainer(String containerID) { handler.getConnection().setContainer(containerID); }
@Override public void onConnectionInit(Event event) { final Connection connection = event.getConnection(); final String hostName = new StringBuilder(messagingFactory.getHostName()) .append(":") .append(String.valueOf(this.getProtocolPort())) .toString(); TRACE_LOGGER.debug("onConnectionInit: hostname:{}", hostName); connection.setHostname(hostName); connection.setContainer(StringUtil.getShortRandomString()); final Map<Symbol, Object> connectionProperties = new HashMap<Symbol, Object>(); connectionProperties.put(AmqpConstants.PRODUCT, ClientConstants.PRODUCT_NAME); connectionProperties.put(AmqpConstants.VERSION, ClientConstants.CURRENT_JAVACLIENT_VERSION); connectionProperties.put(AmqpConstants.PLATFORM, ClientConstants.PLATFORM_INFO); connection.setProperties(connectionProperties); connection.open(); }
@Override public void onConnectionInit(Event event) { if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onConnectionInit hostname[%s]", this.amqpConnection.getHostName())); } final Connection connection = event.getConnection(); final String hostName = new StringBuilder(this.amqpConnection.getHostName()) .append(":") .append(String.valueOf(this.getProtocolPort())) .toString(); connection.setHostname(hostName); connection.setContainer(StringUtil.getRandomString()); final Map<Symbol, Object> connectionProperties = new HashMap<>(); connectionProperties.put(AmqpConstants.PRODUCT, ClientConstants.PRODUCT_NAME); connectionProperties.put(AmqpConstants.VERSION, ClientConstants.CURRENT_JAVACLIENT_VERSION); connectionProperties.put(AmqpConstants.PLATFORM, ClientConstants.PLATFORM_INFO); connectionProperties.put(AmqpConstants.FRAMEWORK, ClientConstants.FRAMEWORK_INFO); final String userAgent = EventHubClientImpl.USER_AGENT; if (userAgent != null) { connectionProperties.put(AmqpConstants.USER_AGENT, userAgent.length() < AmqpConstants.MAX_USER_AGENT_LENGTH ? userAgent : userAgent.substring(0, AmqpConstants.MAX_USER_AGENT_LENGTH)); } connection.setProperties(connectionProperties); connection.open(); }
ProtonConnectionImpl(Vertx vertx, String hostname, ContextInternal connCtx) { this.vertx = vertx; this.connCtx = connCtx; this.connection.setContext(this); this.connection.setContainer("vert.x-" + UUID.randomUUID()); this.connection.setHostname(hostname); Map<Symbol, Object> props = createInitialPropertiesMap(); connection.setProperties(props); }
public void open(String containerId, Map<Symbol, Object> connectionProperties) { this.transport.open(); this.connection.setContainer(containerId); this.connection.setProperties(connectionProperties); this.connection.open(); flush(); }
public void open(String containerId, Map<Symbol, Object> connectionProperties) { this.transport.open(); this.connection.setContainer(containerId); this.connection.setProperties(connectionProperties); this.connection.open(); flush(); }
@Override protected Connection createEndpoint(JmsConnectionInfo resourceInfo) { String hostname = getParent().getVhost(); if (hostname == null) { hostname = getParent().getRemoteURI().getHost(); } else if (hostname.isEmpty()) { hostname = null; } Map<Symbol, Object> props = new LinkedHashMap<Symbol, Object>(); props.put(AmqpSupport.PRODUCT, MetaDataSupport.PROVIDER_NAME); props.put(AmqpSupport.VERSION, MetaDataSupport.PROVIDER_VERSION); props.put(AmqpSupport.PLATFORM, MetaDataSupport.PLATFORM_DETAILS); Connection connection = getParent().getProtonConnection(); connection.setHostname(hostname); connection.setContainer(resourceInfo.getClientId()); connection.setDesiredCapabilities(new Symbol[] { SOLE_CONNECTION_CAPABILITY, DELAYED_DELIVERY, ANONYMOUS_RELAY, SHARED_SUBS}); connection.setProperties(props); return connection; }
@Override protected Connection createEndpoint(JmsConnectionInfo resourceInfo) { String hostname = getParent().getVhost(); if (hostname == null) { hostname = getParent().getRemoteURI().getHost(); } else if (hostname.isEmpty()) { hostname = null; } Map<Symbol, Object> props = new LinkedHashMap<Symbol, Object>(); props.put(AmqpSupport.PRODUCT, MetaDataSupport.PROVIDER_NAME); props.put(AmqpSupport.VERSION, MetaDataSupport.PROVIDER_VERSION); props.put(AmqpSupport.PLATFORM, MetaDataSupport.PLATFORM_DETAILS); Connection connection = getParent().getProtonConnection(); connection.setHostname(hostname); connection.setContainer(resourceInfo.getClientId()); connection.setDesiredCapabilities(new Symbol[] { SOLE_CONNECTION_CAPABILITY, DELAYED_DELIVERY, ANONYMOUS_RELAY, SHARED_SUBS}); connection.setProperties(props); return connection; }
@Override public void onRemoteOpen(Connection connection) throws Exception { synchronized (getLock()) { connection.setContext(AbstractConnectionContext.this); connection.setContainer(containerId); connection.setProperties(connectionProperties); connection.open(); } initialise(); /* * This can be null which is in effect an empty map, also we really dont need to check this for in bound connections * but its here in case we add support for outbound connections. * */ if (connection.getRemoteProperties() == null || !connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) { long nextKeepAliveTime = handler.tick(true); flushBytes(); if (nextKeepAliveTime > 0 && scheduledPool != null) { scheduledPool.schedule(new Runnable() { @Override public void run() { long rescheduleAt = (handler.tick(false) - TimeUnit.NANOSECONDS.toMillis(System.nanoTime())); flushBytes(); if (rescheduleAt > 0) { scheduledPool.schedule(this, rescheduleAt, TimeUnit.MILLISECONDS); } } }, (nextKeepAliveTime - TimeUnit.NANOSECONDS.toMillis(System.nanoTime())), TimeUnit.MILLISECONDS); } } }
private void performConnectionOpen(Connection connection, InputStream in, OutputStream out) throws IOException, LoginException { connection.setHostname(saslHostname); connection.setContainer(container); connection.setDesiredCapabilities(new Symbol[] {CAPABILITY_ADDRESS_AUTHZ}); connection.open(); writeToNetwork(connection, out); readFromNetwork(connection, in, () -> connection.getRemoteState() == EndpointState.UNINITIALIZED); }
@Override public void onRemoteOpen(Connection connection) throws Exception { handler.requireHandler(); try { initInternal(); } catch (Exception e) { log.error("Error init connection", e); } if (!validateConnection(connection)) { connection.close(); } else { connection.setContext(AMQPConnectionContext.this); connection.setContainer(containerId); connection.setProperties(connectionProperties); connection.setOfferedCapabilities(getConnectionCapabilitiesOffered()); connection.open(); } initialise(); /* * This can be null which is in effect an empty map, also we really don't need to check this for in bound connections * but its here in case we add support for outbound connections. * */ if (connection.getRemoteProperties() == null || !connection.getRemoteProperties().containsKey(CONNECTION_OPEN_FAILED)) { long nextKeepAliveTime = handler.tick(true); if (nextKeepAliveTime != 0 && scheduledPool != null) { scheduledPool.schedule(new ScheduleRunnable(), (nextKeepAliveTime - TimeUnit.NANOSECONDS.toMillis(System.nanoTime())), TimeUnit.MILLISECONDS); } } }
} else { connection.setContext(AMQPConnectionContext.this); connection.setContainer(containerId); connection.setProperties(connectionProperties); connection.setOfferedCapabilities(getConnectionCapabilitiesOffered());
protonConnection.setContainer(brokerService.getBrokerName()); protonConnection.open();
protonConnection.setContainer(brokerService.getBrokerName()); protonConnection.open();
@Override public void run() { if (!noContainerID) { getEndpoint().setContainer(safeGetContainerId());
_logger.log(Level.FINE, "Connecting to " + host + ":" + port); connection = new ConnectionImpl(); connection.setContainer(_name); connection.setHostname(host); connection.setContext(service);
_logger.log(Level.FINE, "Connecting to " + host + ":" + port); connection = Proton.connection(); connection.setContainer(_name); connection.setHostname(host); connection.setContext(new ConnectionContext(service, connector));
Connector<?> c = l.accept(); Connection connection = Proton.connection(); connection.setContainer(_name); ListenerContext ctx = (ListenerContext) l.getContext(); connection.setContext(new ConnectionContext(ctx.getService(), c));
_logger.log(Level.FINE, "Connecting to " + host + ":" + port); connection = Proton.connection(); connection.setContainer(_name); connection.setHostname(host); connection.setContext(new ConnectionContext(address, connector));