diff options
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/configuration/XMPPConfiguration.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/configuration/XMPPConfiguration.java | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/juick-www/src/main/java/com/juick/www/configuration/XMPPConfiguration.java b/juick-www/src/main/java/com/juick/www/configuration/XMPPConfiguration.java deleted file mode 100644 index 8afddf2d..00000000 --- a/juick-www/src/main/java/com/juick/www/configuration/XMPPConfiguration.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.juick.www.configuration; - -import com.juick.Message; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import rocks.xmpp.core.XmppException; -import rocks.xmpp.core.session.Extension; -import rocks.xmpp.core.session.XmppSessionConfiguration; -import rocks.xmpp.core.session.debug.LogbackDebugger; -import rocks.xmpp.extensions.component.accept.ExternalComponent; - -@Configuration -public class XMPPConfiguration { - private static Logger logger = LoggerFactory.getLogger(XMPPConfiguration.class); - @Value("${xmpp_host:localhost}") - private String xmppHost; - @Value("${xmpp_password:secret}") - private String xmppPassword; - @Value("${www_xmpp_jid:www.juick.local}") - private String xmppJid; - @Value("${xmpp_port:5347}") - private int xmppPort; - @Bean - @ConditionalOnMissingBean(type = "rocks.xmpp.extensions.component.accept.ExternalComponent") - public ExternalComponent xmpp() { - XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() - .extensions(Extension.of(Message.class)) - .debugger(LogbackDebugger.class) - .build(); - ExternalComponent xmpp = ExternalComponent.create(xmppJid, xmppPassword, configuration, xmppHost, xmppPort); - xmpp.addConnectionListener(e -> logger.error(e.toString(), e.getCause())); - try { - xmpp.connect(); - } catch (XmppException e) { - logger.error("xmpp extension", e); - } - return xmpp; - } -} |