protected void applyConfiguration(ConfigKey root, OutboundSocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("remote-host"), (host) -> { binding.remoteHost(host.toString()); }); applyConfiguration(key.append("remote-port"), (port) -> { binding.remotePort(port.toString()); }); }
protected void applyConfiguration(ConfigKey root, OutboundSocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("remote-host"), (host) -> { binding.remoteHost(host.toString()); }); applyConfiguration(key.append("remote-port"), (port) -> { binding.remotePort(port.toString()); }); }
protected void applyConfiguration(ConfigKey root, OutboundSocketBinding binding) { ConfigKey key = root.append(binding.name()); applyConfiguration(key.append("remote-host"), (host) -> { binding.remoteHost(host.toString()); }); applyConfiguration(key.append("remote-port"), (port) -> { binding.remotePort(port.toString()); }); }
@Override public void customize() { List<Server> servers = fraction.subresources().servers(); servers.stream() .filter(e -> e instanceof EnhancedServer) .forEach(server -> { ((EnhancedServer) server).remoteConnections() .forEach(connection -> { OutboundSocketBinding binding = new OutboundSocketBinding(connection.name()); binding.remoteHost(connection.host()) .remotePort(connection.port()); group.outboundSocketBinding(binding); }); }); } }
@Override public void customize() { if (!mailInstance.isUnsatisfied()) { MailFraction mailFraction = mailInstance.get(); for (MailSession session : mailFraction.subresources().mailSessions()) { SMTPServer server = session.subresources().smtpServer(); if (server != null && server instanceof EnhancedSMTPServer) { if (server.outboundSocketBindingRef() == null) { String ref = "mail-smtp-" + ((EnhancedSMTPServer) server).sessionKey(); this.group.outboundSocketBinding( new OutboundSocketBinding(ref) .remoteHost(((EnhancedSMTPServer) server).host()) .remotePort(((EnhancedSMTPServer) server).port())); ((EnhancedSMTPServer) server).outboundSocketBindingRef(ref); } } } } } }