@Override public String getType() { return getVersion().toString(); } }
public AMQPProtocolVersionWrapper(Protocol amqpProtocol) { if (!amqpProtocol.isAMQP()) { throw new IllegalArgumentException("Protocol must be of type " + Protocol.ProtocolType.AMQP); } final String[] parts = amqpProtocol.name().split(DELIMITER); for (int i = 0; i < parts.length; i++) { switch (i) { case 1: this._major = Integer.parseInt(parts[i]); break; case 2: this._minor = Integer.parseInt(parts[i]); break; case 3: this._patch = Integer.parseInt(parts[i]); break; } } }
public Protocol getProtocol() { return Protocol.valueOf(this.toString()); }
private void printVersion() { final StringBuilder protocol = new StringBuilder("AMQP version(s) [major.minor]: "); boolean first = true; Set<Protocol> protocols = new TreeSet<>(); for(ProtocolEngineCreator installedEngine : (new QpidServiceLoader()).instancesOf(ProtocolEngineCreator.class)) { protocols.add(installedEngine.getVersion()); } for(Protocol supportedProtocol : protocols) { if (first) { first = false; } else { protocol.append(", "); } protocol.append(supportedProtocol.getProtocolVersion()); } System.out.println(CommonProperties.getVersionString() + " (" + protocol + ")"); }
protocolType = protocol.getProtocolType(); else if (protocolType != protocol.getProtocolType()) + "' and '" + protocol.getProtocolType() + "' for port configuration: " + portAttributes);
private ConfiguredObjectRecord createCLIPortEntry(int port, Protocol protocol) { ConfiguredObjectRecord parent = findBroker(); Map<String, Object> attributes = new HashMap<String, Object>(); attributes.put(Port.PORT, port); attributes.put(Port.PROTOCOLS, Collections.singleton(protocol)); attributes.put(Port.NAME, MANAGEMENT_MODE_PORT_PREFIX + protocol.name()); attributes.put(Port.AUTHENTICATION_PROVIDER, BrokerImpl.MANAGEMENT_MODE_AUTHENTICATION); ConfiguredObjectRecord portEntry = new ConfiguredObjectRecordImpl(UUID.randomUUID(), PORT_TYPE, attributes, Collections.singletonMap(parent.getType(),parent.getId())); if (LOGGER.isDebugEnabled()) { LOGGER.debug("Add management mode port configuration " + portEntry + " for port " + port + " and protocol " + protocol); } return portEntry; }
@Override public Object run() { SocketAddress localAddress = _network.getLocalAddress(); final String localAddressStr; if (localAddress instanceof InetSocketAddress) { InetSocketAddress inetAddress = (InetSocketAddress) localAddress; localAddressStr = inetAddress.getAddress().getHostAddress() + ":" + inetAddress.getPort(); } else { localAddressStr = localAddress.toString(); } getEventLogger().message(ConnectionMessages.OPEN(getPort().getName(), localAddressStr, getProtocol().getProtocolVersion(), getClientId(), getClientVersion(), getClientProduct(), getTransport().isSecure(), getClientId() != null, getClientVersion() != null, getClientProduct() != null)); return null; } });
@Override public String getType() { return getVersion().toString(); } }
private void logOperationalShutdownMessage(final int localPort) { getBroker().getEventLogger().message(ManagementConsoleMessages.SHUTTING_DOWN(Protocol.HTTP.name(), localPort)); }
private Protocol getDefaultAmqpSupportedReply() { String defaultAmqpSupportedReply = getContextKeys(false).contains(AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY) ? getContextValue(String.class, AmqpPort.PROPERTY_DEFAULT_SUPPORTED_PROTOCOL_REPLY) : null; Protocol protocol = null; if (defaultAmqpSupportedReply != null && defaultAmqpSupportedReply.length() != 0) { try { protocol = Protocol.valueOf("AMQP_" + defaultAmqpSupportedReply.substring(1)); } catch(IllegalArgumentException e) { LOGGER.warn("The configured default reply ({}) is not a valid value for a protocol. This value will be ignored", defaultAmqpSupportedReply); } } final Set<Protocol> protocolSet = getProtocols(); if(protocol != null && !protocolSet.contains(protocol)) { LOGGER.warn("The configured default reply ({}) to an unsupported protocol version initiation is not" + " supported on this port. Only the following versions are supported: {}", defaultAmqpSupportedReply, protocolSet); protocol = null; } return protocol; }
@Override public String getType() { return getVersion().toString(); } }
private void logOperationalListenMessages(final HttpPort<?> port, final int localPort) { Set<Transport> transports = port.getTransports(); for (Transport transport: transports) { getBroker().getEventLogger().message(ManagementConsoleMessages.LISTENING(Protocol.HTTP.name(), transport.name(), localPort)); } }
@Override public String getType() { return getVersion().toString(); } }
@Override public String getType() { return getVersion().toString(); } }
@Override public String getType() { return getVersion().toString(); } }
supportedReplyVersion.toString()));