protected void fixOutboundSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("outbound-socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.outboundSocketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { OutboundSocketBinding binding = new OutboundSocketBinding(name); group.outboundSocketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
protected void fixOutboundSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("outbound-socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.outboundSocketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { OutboundSocketBinding binding = new OutboundSocketBinding(name); group.outboundSocketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
protected void fixOutboundSocketBindings(SocketBindingGroup group) { ConfigKey key = ROOT.append(group.name()).append("outbound-socket-bindings"); List<SimpleKey> names = this.configView.simpleSubkeys(key); names.stream() .map(e -> e.name()) .map(name -> group.outboundSocketBindings() .stream() .filter(e -> e.name().equals(name)) .findFirst() .orElseGet(() -> { OutboundSocketBinding binding = new OutboundSocketBinding(name); group.outboundSocketBinding(binding); return binding; })) .forEach(e -> { applyConfiguration(key, e); }); }
@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); } } } } } }