diff options
Diffstat (limited to 'src/jrummikub/server')
-rw-r--r-- | src/jrummikub/server/DedicatedServer.java | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/jrummikub/server/DedicatedServer.java b/src/jrummikub/server/DedicatedServer.java index 42345a6..e27c74c 100644 --- a/src/jrummikub/server/DedicatedServer.java +++ b/src/jrummikub/server/DedicatedServer.java @@ -1,6 +1,5 @@ package jrummikub.server; -import java.io.IOException; import java.net.InetAddress; import org.apache.vysper.mina.TCPEndpoint; @@ -13,7 +12,9 @@ import org.apache.vysper.xmpp.modules.extension.xep0045_muc.storage.InMemoryRoom import org.apache.vysper.xmpp.modules.roster.persistence.MemoryRosterManager; import org.apache.vysper.xmpp.server.XMPPServer; -@SuppressWarnings("deprecation") +/** + * Implements a simple XMPP server with a global server password + */ public class DedicatedServer { String serverPassword; String hostName; @@ -44,6 +45,12 @@ public class DedicatedServer { return hostName; } + /** + * Start the server, this blocks + * + * @throws Exception + * when there is an error during startup + */ public void start() throws Exception { XMPPServer server = new XMPPServer(hostName); @@ -67,6 +74,9 @@ public class DedicatedServer { } + /** + * Allow authorization using a single password for all users + */ public class ServerPasswordAuthorization implements UserAuthorization { @Override public boolean verifyCredentials(Entity entity, String password, @@ -81,9 +91,16 @@ public class DedicatedServer { } } + /** + * Main for a simple command line dedicated server + * + * @param args + * first argument specifies the server password, it is "jrummikub" + * when none is specified + */ public static void main(String[] args) { - - DedicatedServer server = new DedicatedServer("password"); + DedicatedServer server = new DedicatedServer(args.length >= 1 ? args[0] + : "jrummikub"); System.out.println("Server hostname is " + server.getHostName()); try { server.start(); |