diff options
author | 2018-04-12 14:32:44 +0300 | |
---|---|---|
committer | 2018-04-12 14:32:44 +0300 | |
commit | c5649915e6259e921cfd087042525b69533d53b0 (patch) | |
tree | 54e2d7bdba8a21a640b3e2a0c427b72d33c445c2 /juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java | |
parent | 9e5a6b3f2f6907f18f22718bcb6f0ac7f79c95cd (diff) |
notifications: pushserver is the only websocket component for now
Diffstat (limited to 'juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java')
-rw-r--r-- | juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java b/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java deleted file mode 100644 index 6e6c8632..00000000 --- a/juick-notifications/src/main/java/com/juick/components/service/NotificationsTokenService.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.juick.components.service; - -import com.juick.ExternalToken; -import com.juick.service.BaseRestService; -import org.springframework.core.ParameterizedTypeReference; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Service; -import org.springframework.web.client.RestTemplate; - -import javax.inject.Inject; -import java.util.List; -import java.util.stream.Collectors; - -/** - * Created by vitalyster on 15.12.2016. - */ -@Service -public class NotificationsTokenService extends BaseRestService implements TokenService { - - @Inject - public NotificationsTokenService(RestTemplate rest) { - super(rest); - } - - @Override - public void deleteTokens(String type, List<String> devices) { - if (devices.size() > 0) { - List<ExternalToken> list = devices.stream() - .map(d -> new ExternalToken(null, type, d, null)).collect(Collectors.toList()); - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.APPLICATION_JSON_UTF8); - getRest().exchange("http://api.juick.com/notifications", - HttpMethod.DELETE, new HttpEntity<>(list, headers), new ParameterizedTypeReference<Void>() { - }); - } - } -} |