diff options
author | 2018-12-31 00:02:02 +0300 | |
---|---|---|
committer | 2018-12-31 01:03:32 +0300 | |
commit | 3af1fa43a25ba844b999d0be6c1139e6a98046fb (patch) | |
tree | 35046afefe5ee1df7d2d17607660b4b0d9f2538e /src/main/java/com/juick/server/xmpp/XMPPStatusPage.java | |
parent | a201bab42facd56290195703f6847e1a29033fb4 (diff) |
Use external XMPP server
Diffstat (limited to 'src/main/java/com/juick/server/xmpp/XMPPStatusPage.java')
-rw-r--r-- | src/main/java/com/juick/server/xmpp/XMPPStatusPage.java | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/main/java/com/juick/server/xmpp/XMPPStatusPage.java b/src/main/java/com/juick/server/xmpp/XMPPStatusPage.java deleted file mode 100644 index 231696ec..00000000 --- a/src/main/java/com/juick/server/xmpp/XMPPStatusPage.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.juick.server.xmpp; - -import com.juick.server.XMPPServer; -import com.juick.server.xmpp.helpers.XMPPStatus; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; -import rocks.xmpp.addr.Jid; -import springfox.documentation.annotations.ApiIgnore; - -import javax.inject.Inject; -import java.util.stream.Collectors; - -@RestController -@ConditionalOnProperty("xmppbot_jid") -public class XMPPStatusPage { - @Inject - private XMPPServer xmpp; - @ApiIgnore - @RequestMapping(method = RequestMethod.GET, value = "/api/xmpp-status", produces = MediaType.APPLICATION_JSON_UTF8_VALUE) - public XMPPStatus xmppStatus() { - XMPPStatus status = new XMPPStatus(); - if (xmpp != null) { - status.setInbound(xmpp.getInConnections().stream().map(c -> c.from).flatMap(j -> j.stream().map(Jid::getDomain)).collect(Collectors.toList())); - status.setOutbound(xmpp.getOutConnections().keySet().stream() - .map(c -> c.to).map(Jid::getDomain).collect(Collectors.toList())); - } - return status; - } -} |