public void handleEvent(final ConduitStreamSourceChannel channel) { connection.setReadListener(new Greeting(), true); }
public void handleEvent(final ConduitStreamSourceChannel channel) { final Pooled<ByteBuffer> pooled = connection.allocate(); boolean ok = false; try { ByteBuffer sendBuffer = pooled.getResource(); sendBuffer.put(Protocol.GREETING); ProtocolUtils.writeString(sendBuffer, Protocol.GRT_SERVER_NAME, serverName); sendBuffer.flip(); connection.setReadListener(new Initial(), true); connection.send(pooled); ok = true; return; } catch (BufferUnderflowException | BufferOverflowException e) { connection.handleException(log.invalidMessage(connection)); return; } finally { if (! ok) pooled.free(); } }
final SecurityIdentity identity = (SecurityIdentity) saslServer.getNegotiatedProperty(WildFlySasl.SECURITY_IDENTITY); connection.setIdentity(identity == null ? saslAuthenticationFactory.getSecurityDomain().getAnonymousSecurityIdentity() : identity); connection.setReadListener(new RemoteReadListener(connectionHandler, connection), false); return connectionHandler; }, saslAuthenticationFactory); sendBuffer.put(p, Protocol.AUTH_CHALLENGE); if (isInitial) { connection.setReadListener(new Authentication(saslServer, remoteEndpointName, behavior, maxInboundChannels, maxOutboundChannels, authCap, offeredMechanisms), false); close = true; } else if (!isInitial) { connection.setReadListener(new Initial(), false);
sendBuffer.put(Protocol.STARTTLS); sendBuffer.flip(); connection.setReadListener(new StartTls(remoteServerName), true); connection.send(pooledSendBuffer); ok = true; connection.setReadListener(authentication, true); connection.send(pooledSendBuffer); ok = true;
connection.setReadListener(new Capabilities(remoteServerName, uri), true); connection.send(pooledSendBuffer); ok = true;
saslDispose(saslServer); final Initial initial = new Initial(); connection.setReadListener(initial, true); initial.handleClientCapabilities(buffer); initial.sendCapabilities();
connection.setReadListener(new RemoteReadListener(connectionHandler, connection), false); connection.getRemoteConnectionProvider().addConnectionHandler(connectionHandler); return connectionHandler;
connection.send(pooled); ok = true; connection.setReadListener(new Initial(), true); if (starttls) { connection.send(RemoteConnection.STARTTLS_SENTINEL);
public void handleEvent(final ConnectedMessageChannel channel) { connection.setReadListener(new Greeting(), true); }
public void handleEvent(final ConduitStreamSourceChannel channel) { connection.setReadListener(new Greeting(), true); }
public ConnectionHandler createInstance(final ConnectionHandlerContext connectionContext) { final Object qop = saslServer.getNegotiatedProperty(Sasl.QOP); if (!isInitial && ("auth-int".equals(qop) || "auth-conf".equals(qop))) { connection.setSaslWrapper(SaslWrapper.create(saslServer)); } final RemoteConnectionHandler connectionHandler = new RemoteConnectionHandler( connectionContext, connection, principals, userInfo, maxInboundChannels, maxOutboundChannels, remoteEndpointName, behavior); connection.getRemoteConnectionProvider().addConnectionHandler(connectionHandler); connection.setReadListener(new RemoteReadListener(connectionHandler, connection), false); return connectionHandler; } });
connection.send(pooledSendBuffer); ok = true; connection.setReadListener(authentication, true); return; } finally {
public void handleEvent(final ConduitStreamSourceChannel channel) { final Pooled<ByteBuffer> pooled = connection.allocate(); boolean ok = false; try { ByteBuffer sendBuffer = pooled.getResource(); sendBuffer.put(Protocol.GREETING); ProtocolUtils.writeString(sendBuffer, Protocol.GRT_SERVER_NAME, serverName); sendBuffer.flip(); connection.setReadListener(new Initial(), true); connection.send(pooled); ok = true; return; } catch (BufferUnderflowException | BufferOverflowException e) { connection.handleException(log.invalidMessage(connection)); return; } finally { if (! ok) pooled.free(); } }
public void handleEvent(final ConnectedMessageChannel channel) { final Pooled<ByteBuffer> pooled = connection.allocate(); boolean ok = false; try { ByteBuffer sendBuffer = pooled.getResource(); sendBuffer.put(Protocol.GREETING); ProtocolUtils.writeString(sendBuffer, Protocol.GRT_SERVER_NAME, serverName); sendBuffer.flip(); connection.setReadListener(new Initial(), true); connection.send(pooled); ok = true; return; } catch (BufferUnderflowException e) { connection.handleException(RemoteLogger.log.invalidMessage(connection)); return; } catch (BufferOverflowException e) { connection.handleException(RemoteLogger.log.invalidMessage(connection)); return; } finally { if (! ok) pooled.free(); } }
sendBuffer.put(p, Protocol.AUTH_CHALLENGE); if (isInitial) { connection.setReadListener(new Authentication(saslServer, authorizingCallbackHandler, remoteEndpointName, behavior, maxInboundChannels, maxOutboundChannels), false); connection.setReadListener(new Initial(), false);
final SecurityIdentity identity = (SecurityIdentity) saslServer.getNegotiatedProperty(WildFlySasl.SECURITY_IDENTITY); connection.setIdentity(identity == null ? saslAuthenticationFactory.getSecurityDomain().getAnonymousSecurityIdentity() : identity); connection.setReadListener(new RemoteReadListener(connectionHandler, connection), false); return connectionHandler; }, saslAuthenticationFactory); sendBuffer.put(p, Protocol.AUTH_CHALLENGE); if (isInitial) { connection.setReadListener(new Authentication(saslServer, remoteEndpointName, behavior, maxInboundChannels, maxOutboundChannels, authCap, offeredMechanisms), false); close = true; } else if (!isInitial) { connection.setReadListener(new Initial(), false);
void sendCapRequest(final String remoteServerName) { client.trace("Client sending capabilities request"); // Prepare the request message body final Pooled<ByteBuffer> pooledSendBuffer = connection.allocate(); boolean ok = false; try { final ByteBuffer sendBuffer = pooledSendBuffer.getResource(); sendBuffer.put(Protocol.CAPABILITIES); ProtocolUtils.writeByte(sendBuffer, Protocol.CAP_VERSION, Protocol.VERSION); final String localEndpointName = connectionProviderContext.getEndpoint().getName(); if (localEndpointName != null) { ProtocolUtils.writeString(sendBuffer, Protocol.CAP_ENDPOINT_NAME, localEndpointName); } ProtocolUtils.writeEmpty(sendBuffer, Protocol.CAP_MESSAGE_CLOSE); ProtocolUtils.writeString(sendBuffer, Protocol.CAP_VERSION_STRING, Version.getVersionString()); ProtocolUtils.writeInt(sendBuffer, Protocol.CAP_CHANNELS_IN, optionMap.get(RemotingOptions.MAX_INBOUND_CHANNELS, RemotingOptions.DEFAULT_MAX_INBOUND_CHANNELS)); ProtocolUtils.writeInt(sendBuffer, Protocol.CAP_CHANNELS_OUT, optionMap.get(RemotingOptions.MAX_OUTBOUND_CHANNELS, RemotingOptions.DEFAULT_MAX_OUTBOUND_CHANNELS)); sendBuffer.flip(); connection.setReadListener(new Capabilities(remoteServerName), true); connection.send(pooledSendBuffer); ok = true; // all set return; } finally { if (! ok) { pooledSendBuffer.free(); } } }
connection.setReadListener(new Capabilities(remoteServerName, uri), true); connection.send(pooledSendBuffer); ok = true;
saslDispose(saslServer); final Initial initial = new Initial(); connection.setReadListener(initial, true); initial.handleClientCapabilities(buffer); initial.sendCapabilities();
saslDispose(saslServer); final Initial initial = new Initial(); connection.setReadListener(initial, true); initial.handleClientCapabilities(buffer); initial.sendCapabilities();