aboutsummaryrefslogtreecommitdiff
path: root/juick-notifications/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-02-24 16:54:28 +0300
committerGravatar Vitaly Takmazov2018-03-15 12:05:59 +0300
commitbebe7c159f00e6d5a83bb786824d5f32e4de9270 (patch)
tree151801a2e625d4952d12630da6a4aec6a37fb76d /juick-notifications/src
parent70f481e2fe39a9029b1896d7b351293fd5de4ef8 (diff)
spring boot wip
Diffstat (limited to 'juick-notifications/src')
-rw-r--r--juick-notifications/src/main/java/com/juick/components/MPNSClient.java4
-rw-r--r--juick-notifications/src/main/java/com/juick/components/PushServer.java12
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java2
-rw-r--r--juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java39
4 files changed, 15 insertions, 42 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java
index 21286258..efa47bb1 100644
--- a/juick-notifications/src/main/java/com/juick/components/MPNSClient.java
+++ b/juick-notifications/src/main/java/com/juick/components/MPNSClient.java
@@ -34,9 +34,9 @@ public class MPNSClient {
@Inject
private ObjectMapper jsonMapper;
- @Value("${wns_application_sip}")
+ @Value("${wns_application_sip:}")
private String applicationSip;
- @Value("${wns_client_secret}")
+ @Value("${wns_client_secret:}")
private String applicationSecret;
private RestTemplate wnsService;
diff --git a/juick-notifications/src/main/java/com/juick/components/PushServer.java b/juick-notifications/src/main/java/com/juick/components/PushServer.java
new file mode 100644
index 00000000..c22f48dc
--- /dev/null
+++ b/juick-notifications/src/main/java/com/juick/components/PushServer.java
@@ -0,0 +1,12 @@
+package com.juick.components;
+
+import org.springframework.boot.SpringApplication;
+import org.springframework.boot.autoconfigure.SpringBootApplication;
+
+@SpringBootApplication
+public class PushServer {
+
+ public static void main(String[] args) {
+ SpringApplication.run(PushServer.class, args);
+ }
+}
diff --git a/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java
index 96c7716f..27e1af0f 100644
--- a/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java
+++ b/juick-notifications/src/main/java/com/juick/components/configuration/GCMConfiguration.java
@@ -11,7 +11,7 @@ import org.springframework.context.annotation.Configuration;
*/
@Configuration
public class GCMConfiguration {
- @Value("${gcm_key}")
+ @Value("${gcm_key:}")
private String gcmKey;
@Bean
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
deleted file mode 100644
index d4068d26..00000000
--- a/juick-notifications/src/main/java/com/juick/components/configuration/NotificationsInitializer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.juick.components.configuration;
-
-import org.apache.commons.codec.CharEncoding;
-import org.springframework.web.filter.CharacterEncodingFilter;
-import org.springframework.web.servlet.support.AbstractAnnotationConfigDispatcherServletInitializer;
-
-import javax.servlet.Filter;
-
-/**
- * Created by vt on 09/02/16.
- */
-public class NotificationsInitializer extends AbstractAnnotationConfigDispatcherServletInitializer {
-
- @Override
- protected Class<?>[] getRootConfigClasses() {
- return new Class<?>[] {};
- }
-
- @Override
- protected Class<?>[] getServletConfigClasses() {
- return new Class<?>[]{ NotificationsAppConfiguration.class };
- }
-
- @Override
- protected String[] getServletMappings() {
- return new String[]{"/"};
- }
-
- @Override
- protected Filter[] getServletFilters() {
- CharacterEncodingFilter characterEncodingFilter = new CharacterEncodingFilter(CharEncoding.UTF_8);
- return new Filter[]{characterEncodingFilter};
- }
-
- @Override
- protected String getServletName() {
- return "Notifications dispatcher servlet";
- }
-}