@Override public void registerAddressSpace(final NamedAddressSpace addressSpace) { _systemAddressSpaces.put(addressSpace.getName(), addressSpace); }
@Override public void removeAddressSpace(final NamedAddressSpace addressSpace) { _systemAddressSpaces.remove(addressSpace.getName(), addressSpace); }
public AbstractSystemMessageSource(String name, final NamedAddressSpace addressSpace) { _name = name; _id = UUID.nameUUIDFromBytes((getClass().getSimpleName() + "/" + addressSpace.getName() + "/" + name).getBytes( StandardCharsets.UTF_8)); _addressSpace = addressSpace; }
private URI getUriForAddressSpace(URI uri, final NamedAddressSpace addressSpace) { try { String vhostName = URLEncoder.encode(addressSpace == null ? "" : addressSpace.getName(), UTF_8.name()); final Strings.MapResolver virtualhostResolver = new Strings.MapResolver(Collections.singletonMap("virtualhost", vhostName)); String substitutedURI = Strings.expand(uri.toString(), false, virtualhostResolver); uri = new URI(substitutedURI); } catch (UnsupportedEncodingException | URISyntaxException e) { LOGGER.error("Error when attempting to build URI from address space: ", e); } return uri; }
@Override public final String getAddressSpaceName() { return getAddressSpace() == null ? null : getAddressSpace().getName(); }
@Override public String toLogString() { final AMQPConnection<?> amqpConnection = getAMQPConnection(); long connectionId = amqpConnection.getConnectionId(); String remoteAddress = amqpConnection.getRemoteAddressString(); final String authorizedPrincipal = amqpConnection.getAuthorizedPrincipal() == null ? "?" : amqpConnection.getAuthorizedPrincipal().getName(); return "[" + MessageFormat.format(CHANNEL_FORMAT, connectionId, authorizedPrincipal, remoteAddress, getAddressSpace().getName(), _sendingChannel) + "] "; }
@Override public LinkStore create(final NamedAddressSpace addressSpace) { JDBCContainer jdbcContainer = null; if (addressSpace instanceof JDBCContainer) { jdbcContainer = (JDBCContainer) addressSpace; } else if (addressSpace instanceof VirtualHost && ((VirtualHost) addressSpace).getParent() instanceof JDBCContainer) { jdbcContainer = (JDBCContainer) ((VirtualHost) addressSpace).getParent(); } else { throw new StoreException(String.format("Named address space '%s' is not support by link store of type '%s'", addressSpace.getName(), TYPE)); } return new JDBCLinkStore(jdbcContainer); }
@Override public String toLogString() { long connectionId = getConnection() instanceof ServerConnection ? getConnection().getConnectionId() : -1; String authorizedPrincipal = (getAuthorizedPrincipal() == null) ? "?" : getAuthorizedPrincipal().getName(); String remoteAddress = String.valueOf(getConnection().getRemoteSocketAddress()); return "[" + MessageFormat.format(CHANNEL_FORMAT, connectionId, authorizedPrincipal, remoteAddress, getAddressSpace().getName(), getChannel()) + "] "; }
LOGGER.debug("Connecting to: {}", virtualHost.getName());
"Virtual host '" + addressSpace.getName() + "' is not active", 0);
new ObjectProperties(exchange.getAddressSpace().getName(), exchange.getName(), (String)arguments.get("routingKey")); props.put(ObjectProperties.Property.DURABLE, exchange.isDurable()); if (exchange instanceof Exchange<?>)
+ queueName + "' not found on VirtualHost '" + virtualHost.getName() + "'.");