aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-12-14 17:26:29 +0300
committerGravatar Vitaly Takmazov2016-12-14 17:26:29 +0300
commit91ee5d2578868125fcaf35d6fe08ef3604640cd6 (patch)
treea3f022ba5bc6d5fee3fcf14d5ac312d398e2a6b2
parentf5285b6724ca0dee8dab876f097ac2b691dfe4a6 (diff)
juick-notifications: components should not depend on database
-rw-r--r--juick-notifications/build.gradle10
-rw-r--r--juick-notifications/src/main/java/com/juick/components/Notifications.java6
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java3
3 files changed, 12 insertions, 7 deletions
diff --git a/juick-notifications/build.gradle b/juick-notifications/build.gradle
index 9aa98fc2..1e81e6fc 100644
--- a/juick-notifications/build.gradle
+++ b/juick-notifications/build.gradle
@@ -4,12 +4,18 @@ apply plugin: 'org.akhikhl.gretty'
apply plugin: 'com.github.ben-manes.versions'
dependencies {
- compile project(':juick-server')
+ compile project(':juick-core')
compile 'com.ganyo:gcm-server:1.1.0'
compile 'com.notnoop.apns:apns:1.0.0.Beta6'
compile "org.springframework:spring-webmvc:${rootProject.springFrameworkVersion}"
+ compile "com.fasterxml.jackson.datatype:jackson-datatype-jdk8:${rootProject.jacksonVersion}"
- providedRuntime 'mysql:mysql-connector-java:5.1.40'
+ compile "javax.inject:javax.inject:1"
+
+ compile "org.apache.httpcomponents:httpclient:4.5.2"
+ compile "org.apache.commons:commons-lang3:3.5"
+ compile "org.bitbucket.sco0ter.babbler:xmpp-core-client:0ba6c0e2f9"
+ compile "org.bitbucket.sco0ter.babbler:xmpp-extensions-client:0ba6c0e2f9"
testCompile "junit:junit:${rootProject.junitVersion}"
testCompile "org.hamcrest:hamcrest-all:${rootProject.hamcrestVersion}"
diff --git a/juick-notifications/src/main/java/com/juick/components/Notifications.java b/juick-notifications/src/main/java/com/juick/components/Notifications.java
index f98fdcce..b06e0abf 100644
--- a/juick-notifications/src/main/java/com/juick/components/Notifications.java
+++ b/juick-notifications/src/main/java/com/juick/components/Notifications.java
@@ -55,6 +55,7 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
+import java.util.stream.Collectors;
/**
* @author Ugnich Anton
@@ -277,10 +278,9 @@ public class Notifications implements AutoCloseable {
}
static String stringifyWnsHttpHeaders(final Header[] allHeaders) {
- String[] wnsHeaders = Arrays.stream(allHeaders)
+ return Arrays.stream(allHeaders)
.filter(x -> x.getName().startsWith("X-WNS-") || x.getName().startsWith("WWW-"))
.map(x -> x.getName() + ": " + x.getValue())
- .toArray(String[]::new);
- return String.join("\n", wnsHeaders);
+ .collect(Collectors.joining("\n"));
}
}
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java
index 48ff52c2..ddd734d1 100644
--- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java
+++ b/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java
@@ -1,6 +1,5 @@
package com.juick.components.configuration;
-import com.juick.configuration.DataConfiguration;
import org.springframework.web.filter.CharacterEncodingFilter;
import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
@@ -13,7 +12,7 @@ public class NotificationsInitializer extends AbstractAnnotationConfigDispatcher
@Override
protected Class<?>[] getRootConfigClasses() {
- return new Class<?>[]{NotificationsAppConfiguration.class, DataConfiguration.class};
+ return new Class<?>[]{NotificationsAppConfiguration.class};
}
@Override