diff options
author | 2016-08-08 10:26:37 +0300 | |
---|---|---|
committer | 2016-08-08 10:26:37 +0300 | |
commit | 64824ed6dddf776ce3ed36fe96ffc300d4127e29 (patch) | |
tree | b6dbdbac997d6c8a6eb9b2bcdc286ee802e47515 /juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | |
parent | 351a61da81baccae4392fc65bb09e5e19860eaa5 (diff) |
juick-ws: read component jids and ports from config
Diffstat (limited to 'juick-ws/src/main/java/com/juick/ws/XMPPConnection.java')
-rw-r--r-- | juick-ws/src/main/java/com/juick/ws/XMPPConnection.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java index 8a55dc7e..da064726 100644 --- a/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java +++ b/juick-ws/src/main/java/com/juick/ws/XMPPConnection.java @@ -8,6 +8,7 @@ import com.juick.xmpp.Message; import com.juick.xmpp.Stream; import com.juick.xmpp.StreamComponent; import com.juick.xmpp.extensions.JuickMessage; +import org.apache.commons.lang3.math.NumberUtils; import org.springframework.beans.factory.InitializingBean; import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; @@ -45,8 +46,8 @@ public class XMPPConnection implements InitializingBean, Stream.StreamListener, xmppPassword = env.getProperty("xmpp_password"); ms = new MessageSerializer(); try { - Socket socket = new Socket("localhost", 5347); - xmpp = new StreamComponent(new JID("", "ws.juick.com", ""), socket.getInputStream(), socket.getOutputStream(), xmppPassword); + Socket socket = new Socket("localhost", NumberUtils.toInt(env.getProperty("xmpp_port", ""), 5347)); + xmpp = new StreamComponent(new JID(env.getProperty("ws_jid", "ws.juick.local")), socket.getInputStream(), socket.getOutputStream(), xmppPassword); xmpp.addChildParser(new JuickMessage()); xmpp.addListener((Stream.StreamListener) this); xmpp.addListener((Message.MessageListener) this); |