Establishing(final String serviceType, final Channel.Receiver receiver, final ProtocolConnectionConfiguration configuration) { this.serviceType = serviceType; this.receiver = receiver; this.channelOptions = configuration.getOptionMap(); this.connectionManager = ProtocolConnectionManager.create(configuration, this); }
private Establishing(final ProtocolConnectionConfiguration configuration, final Channel.Receiver receiver, final CloseHandler<Channel> closeHandler) { this.receiver = receiver; this.channelOptions = configuration.getOptionMap(); this.connectionManager = ProtocolConnectionManager.create(configuration, this); this.closeHandler = closeHandler; this.timeout = configuration.getConnectionTimeout(); }
private Establishing(final ProtocolConnectionConfiguration configuration, final Channel.Receiver receiver, final CloseHandler<Channel> closeHandler) { this.receiver = receiver; this.channelOptions = configuration.getOptionMap(); this.connectionManager = ProtocolConnectionManager.create(configuration, this); this.closeHandler = closeHandler; this.timeout = configuration.getConnectionTimeout(); }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); } else { channel.closeAsync(); } }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); } else { channel.closeAsync(); } }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); } else { channel.closeAsync(); } }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, SERVER_CHANNEL_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); } else { channel.closeAsync(); } }
private static OptionMap getOptions(final ProtocolConnectionConfiguration configuration) { final Map<String, String> saslOptions = configuration.getSaslOptions(); final OptionMap.Builder builder = OptionMap.builder(); builder.addAll(configuration.getOptionMap()); builder.set(SASL_POLICY_NOANONYMOUS, Boolean.FALSE); builder.set(SASL_POLICY_NOPLAINTEXT, Boolean.FALSE); if (isLocal(configuration.getUri()) == false) { builder.set(Options.SASL_DISALLOWED_MECHANISMS, Sequence.of(JBOSS_LOCAL_USER)); } List<Property> tempProperties = new ArrayList<Property>(saslOptions != null ? saslOptions.size() : 1); tempProperties.add(Property.of("jboss.sasl.local-user.quiet-auth", "true")); if (saslOptions != null) { for (String currentKey : saslOptions.keySet()) { tempProperties.add(Property.of(currentKey, saslOptions.get(currentKey))); } } builder.set(Options.SASL_PROPERTIES, Sequence.of(tempProperties)); builder.set(Options.SSL_ENABLED, true); builder.set(Options.SSL_STARTTLS, true); return builder.getMap(); }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); try { if (runningMode == RunningMode.ADMIN_ONLY) { // Fetch the domain configuration channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get(); } else { // Start the registration process channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get(); } } catch (Exception e) { if(e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } // Registered registered(); } else { channel.closeAsync(); } }
@Override public void connectionOpened(final Connection connection) throws IOException { final Channel channel = openChannel(connection, CHANNEL_SERVICE_TYPE, configuration.getOptionMap()); if(setChannel(channel)) { channel.receiveMessage(channelHandler.getReceiver()); channel.addCloseHandler(channelHandler); try { if (runningMode == RunningMode.ADMIN_ONLY) { // Fetch the domain configuration channelHandler.executeRequest(new FetchDomainConfigurationRequest(), null).getResult().get(); } else { // Start the registration process channelHandler.executeRequest(new RegisterHostControllerRequest(), null).getResult().get(); } } catch (Exception e) { if(e.getCause() instanceof IOException) { throw (IOException) e.getCause(); } throw new IOException(e); } // Registered registered(); } else { channel.closeAsync(); } }
OptionMap optionMap = configuration.getOptionMap(); for (Option option : optionMap) { builder.set(option, optionMap.get(option));
OptionMap optionMap = configuration.getOptionMap(); for (Option option : optionMap) { builder.set(option, optionMap.get(option));