From bb17bb3d03c94bd561d1bfc5b011b49340c2fbfa Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Tue, 30 Jan 2018 17:27:08 +0300 Subject: notifications: drop xmpp --- .../NotificationsAppConfiguration.java | 14 ++++++++- .../configuration/XMPPConfiguration.java | 33 ---------------------- 2 files changed, 13 insertions(+), 34 deletions(-) delete mode 100644 juick-notifications/src/main/java/com/juick/components/configuration/XMPPConfiguration.java (limited to 'juick-notifications/src/main/java/com/juick/components/configuration') diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java index 19d56d59..5cd2b3cd 100644 --- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java +++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java @@ -2,7 +2,10 @@ package com.juick.components.configuration; import com.juick.components.CleanUp; import com.juick.components.Notifications; +import com.juick.server.component.JuickServerComponent; +import com.juick.server.component.JuickServerReconnectManager; import com.juick.server.configuration.BaseWebConfiguration; +import com.juick.server.configuration.JuickServerComponentConfiguration; import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.*; import org.springframework.http.client.ClientHttpRequestInterceptor; @@ -24,13 +27,22 @@ import java.util.List; @PropertySource("classpath:juick.conf") @ComponentScan(basePackages = "com.juick.components.service") @Import({ APNSConfiguration.class, MPNSConfiguration.class, - GCMConfiguration.class, XMPPConfiguration.class }) + GCMConfiguration.class, JuickServerComponentConfiguration.class}) public class NotificationsAppConfiguration extends BaseWebConfiguration { @Value("${api_user:juick}") private String apiUser; @Value("${api_password:secret}") private String apiSecret; + @Bean + public JuickServerComponent juickServerComponent() { + return new JuickServerComponent(); + } + @Bean + public JuickServerReconnectManager juickServerReconnectManager() { + return new JuickServerReconnectManager(); + } + @Bean public RestTemplate rest() { RestTemplate rest = new RestTemplate(); diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/XMPPConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/XMPPConfiguration.java deleted file mode 100644 index 0073b502..00000000 --- a/juick-notifications/src/main/java/com/juick/components/configuration/XMPPConfiguration.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.juick.components.configuration; - -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -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; - -/** - * Created by vital on 29.03.2017. - */ -@Configuration -public class XMPPConfiguration { - @Value("${push_jid}") - private String pushJid; - @Value("${xmpp_host:localhost}") - private String xmppHost; - @Value("${xmpp_port:5347}") - private int xmppPort; - @Value("${push_xmpp_password:secret}") - private String xmppPushPassword; - - @Bean - public ExternalComponent xmpp() { - XmppSessionConfiguration configuration = XmppSessionConfiguration.builder() - .extensions(Extension.of(com.juick.Message.class)) - .debugger(LogbackDebugger.class) - .build(); - return ExternalComponent.create(pushJid, xmppPushPassword, configuration, xmppHost, xmppPort); - } -} -- cgit v1.2.3