public void handleEvent(final StreamConnection connection) { try { connection.setOption(Options.TCP_NODELAY, Boolean.TRUE); } catch (IOException e) { // ignore } final SslChannel sslChannel = connection instanceof SslChannel ? (SslChannel) connection : null; final RemoteConnection remoteConnection = new RemoteConnection(connection, sslChannel, connectOptions, RemoteConnectionProvider.this); cancellableResult.addCancelHandler(new Cancellable() { @Override public Cancellable cancel() { RemoteConnectionHandler.sendCloseRequestBody(remoteConnection); remoteConnection.handlePreAuthCloseRequest(); return this; } }); if (connection.isOpen()) { remoteConnection.setResult(cancellableResult); connection.getSinkChannel().setWriteListener(remoteConnection.getWriteListener()); final ClientConnectionOpenListener openListener = new ClientConnectionOpenListener(destination, remoteConnection, connectionProviderContext, authenticationConfiguration, saslClientFactoryOperator, serverMechs, connectOptions); openListener.handleEvent(connection.getSourceChannel()); } } };
connection.handleException(allMechanismsFailed()); return; } else { connection.handleException(allMechanismsFailed()); connection.handleException(new SaslException(b.toString())); } else { connection.handleException(allMechanismsFailed()); saslDispose(usedSaslClient); failedMechs.put(mechanismName, e); sendCapRequest(remoteServerName); return;
sendCapRequest(remoteServerName); return;
connection.handleException(allMechanismsFailed()); return;
failedMechs.put(mechanismName, e); saslDispose(saslClient); sendCapRequest(serverName); return; failedMechs.put(mechanismName, e); saslDispose(saslClient); sendCapRequest(serverName); return; failedMechs.put(mechanismName, new SaslException(mechanismName + ": Server rejected authentication")); saslDispose(saslClient); sendCapRequest(serverName); return;
public void handleEvent(final ConnectedStreamChannel channel) { try { channel.setOption(Options.TCP_NODELAY, Boolean.TRUE); } catch (IOException e) { // ignore } Pool<ByteBuffer> messageBufferPool = USE_POOLING ? GLOBAL_POOL : Buffers.allocatedBufferPool(BufferAllocator.BYTE_BUFFER_ALLOCATOR, BUFFER_SIZE); if (LEAK_DEBUGGING) messageBufferPool = new DebuggingBufferPool(messageBufferPool); final RemotingMessageChannel messageChannel = new RemotingMessageChannel(channel, ByteBuffer.allocate(BUFFER_SIZE + 4), ByteBuffer.allocate(BUFFER_SIZE + 4)); final RemoteConnection remoteConnection = new RemoteConnection(messageBufferPool, channel, messageChannel, connectOptions, RemoteConnectionProvider.this); cancellableResult.addCancelHandler(new Cancellable() { @Override public Cancellable cancel() { RemoteConnectionHandler.sendCloseRequestBody(remoteConnection); remoteConnection.handlePreAuthCloseRequest(); return this; } }); if (messageChannel.isOpen()) { remoteConnection.setResult(cancellableResult); messageChannel.getWriteSetter().set(remoteConnection.getWriteListener()); final ClientConnectionOpenListener openListener = new ClientConnectionOpenListener(remoteConnection, connectionProviderContext, callbackHandler, accessControlContext , connectOptions); openListener.handleEvent(messageChannel); } } };
if (connection.getConnection() instanceof SslConnection) { connection.send(RemoteConnection.STARTTLS_SENTINEL); sendCapRequest(remoteServerName); return; } else {
connection.handleException(allMechanismsFailed()); return; } else { connection.handleException(allMechanismsFailed()); connection.handleException(new SaslException(b.toString())); } else { connection.handleException(allMechanismsFailed()); saslDispose(usedSaslClient); failedMechs.put(mechanismName, e); sendCapRequest(remoteServerName); return;
public void handleEvent(final StreamConnection connection) { try { connection.setOption(Options.TCP_NODELAY, Boolean.TRUE); } catch (IOException e) { // ignore } final SslChannel sslChannel = connection instanceof SslChannel ? (SslChannel) connection : null; final RemoteConnection remoteConnection = new RemoteConnection(connection, sslChannel, connectOptions, RemoteConnectionProvider.this); cancellableResult.addCancelHandler(new Cancellable() { @Override public Cancellable cancel() { RemoteConnectionHandler.sendCloseRequestBody(remoteConnection); remoteConnection.handlePreAuthCloseRequest(); return this; } }); if (connection.isOpen()) { remoteConnection.setResult(cancellableResult); connection.getSinkChannel().setWriteListener(remoteConnection.getWriteListener()); final ClientConnectionOpenListener openListener = new ClientConnectionOpenListener(destination, remoteConnection, connectionProviderContext, authenticationConfiguration, saslClientFactoryOperator, serverMechs, connectOptions); openListener.handleEvent(connection.getSourceChannel()); } } };
saslDispose(usedSaslClient); failedMechs.put(mechanismName, e.getCause().toString()); sendCapRequest(remoteServerName); return;
failedMechs.put(mechanismName, e.toString()); saslDispose(saslClient); sendCapRequest(serverName); return;
failedMechs.put(mechanismName, e.toString()); saslDispose(saslClient); sendCapRequest(serverName); return;
sendCapRequest(remoteServerName); return;
sendCapRequest(remoteServerName); return;
failedMechs.put(mechanismName, e); saslDispose(saslClient); sendCapRequest(serverName); return; failedMechs.put(mechanismName, e); saslDispose(saslClient); sendCapRequest(serverName); return; failedMechs.put(mechanismName, new SaslException(mechanismName + ": Server rejected authentication")); saslDispose(saslClient); sendCapRequest(serverName); return;
failedMechs.put(mechanismName, "Server rejected authentication"); saslDispose(saslClient); sendCapRequest(serverName); return;
if (connection.getConnection() instanceof SslConnection) { connection.send(RemoteConnection.STARTTLS_SENTINEL); sendCapRequest(remoteServerName); return; } else {
return; sendCapRequest(remoteServerName); return; } else if (c instanceof WrappedChannel) {