aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src/main/java/com/juick/components/configuration
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-01-30 17:27:08 +0300
committerGravatar Vitaly Takmazov2018-01-30 17:27:08 +0300
commitbb17bb3d03c94bd561d1bfc5b011b49340c2fbfa (patch)
tree7af3f447e4d8f682b910c5416184a7704c239df2 /juick-notifications/src/main/java/com/juick/components/configuration
parente8ccfa5c4699b00b1ac6e8790f5dad44f36d7f66 (diff)
notifications: drop xmpp
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/configuration')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/NotificationsAppConfiguration.java14
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/XMPPConfiguration.java33
2 files changed, 13 insertions, 34 deletions
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,7 +27,7 @@ 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;
@@ -32,6 +35,15 @@ public class NotificationsAppConfiguration extends BaseWebConfiguration {
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();
List<ClientHttpRequestInterceptor> interceptors = Collections.singletonList(
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);
- }
-}