use of org.wildfly.swarm.config.mail.MailSession in project wildfly-swarm by wildfly-swarm.
the class SocketBindingCustomizer method customize.
@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);
}
}
}
}
}
Aggregations