@Override public ErrorCondition getCondition() { return connection.getCondition(); }
public boolean validateConnection(org.apache.qpid.proton.engine.Connection connection, SASLResult saslResult) { remoteContainerId = connection.getRemoteContainer(); boolean idOK = server.addClientConnection(remoteContainerId, ExtCapability.needUniqueConnection(connection)); if (!idOK) { //https://issues.apache.org/jira/browse/ARTEMIS-728 Map<Symbol, Object> connProp = new HashMap<>(); connProp.put(AmqpSupport.CONNECTION_OPEN_FAILED, "true"); connection.setProperties(connProp); connection.getCondition().setCondition(AmqpError.INVALID_FIELD); Map<Symbol, Symbol> info = new HashMap<>(); info.put(AmqpSupport.INVALID_FIELD, AmqpSupport.CONTAINER_ID); connection.getCondition().setInfo(info); return false; } registeredConnectionId.set(true); return true; }
@Override public void onConnectionLocalOpen(Event event) { final Connection connection = event.getConnection(); final ErrorCondition error = connection.getCondition(); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onConnectionLocalOpen: hostname[%s], errorCondition[%s], errorDescription[%s]", connection.getHostname(), error != null ? error.getCondition() : "n/a", error != null ? error.getDescription() : "n/a")); } }
@Override public void onConnectionFinal(Event event) { final Connection connection = event.getConnection(); final ErrorCondition error = connection.getCondition(); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onConnectionFinal: hostname[%s], errorCondition[%s], errorDescription[%s]", connection.getHostname(), error != null ? error.getCondition() : "n/a", error != null ? error.getDescription() : "n/a")); } } }
public boolean validateConnection(org.apache.qpid.proton.engine.Connection connection, SASLResult saslResult) { remoteContainerId = connection.getRemoteContainer(); boolean idOK = server.addClientConnection(remoteContainerId, ExtCapability.needUniqueConnection(connection)); if (!idOK) { //https://issues.apache.org/jira/browse/ARTEMIS-728 Map<Symbol, Object> connProp = new HashMap<>(); connProp.put(AmqpSupport.CONNECTION_OPEN_FAILED, "true"); connection.setProperties(connProp); connection.getCondition().setCondition(AmqpError.INVALID_FIELD); Map<Symbol, Symbol> info = new HashMap<>(); info.put(AmqpSupport.INVALID_FIELD, AmqpSupport.CONTAINER_ID); connection.getCondition().setInfo(info); return false; } registeredConnectionId.set(true); return true; }
@Override public void onConnectionLocalClose(Event event) { final Connection connection = event.getConnection(); final ErrorCondition error = connection.getCondition(); if (TRACE_LOGGER.isInfoEnabled()) { TRACE_LOGGER.info(String.format(Locale.US, "onConnectionLocalClose: hostname[%s], errorCondition[%s], errorDescription[%s]", connection.getHostname(), error != null ? error.getCondition() : "n/a", error != null ? error.getDescription() : "n/a")); } if (connection.getRemoteState() == EndpointState.CLOSED) { // This means that the CLOSE origin is Service final Transport transport = connection.getTransport(); if (transport != null) { transport.unbind(); // we proactively dispose IO even if service fails to close } } }