diff options
author | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-21 18:51:23 +0200 |
---|---|---|
committer | Jannis Harder <harder@informatik.uni-luebeck.de> | 2011-06-21 18:51:23 +0200 |
commit | d09041304bee53b86c3ddd098a6ff39db85889f3 (patch) | |
tree | 8f26224cf51fe07f7452f99b9b6c51ae8c12fbce /src/jrummikub/server | |
parent | 2a553fe6a56edcd3ccbb9b39a26a828034d80c5c (diff) | |
download | JRummikub-d09041304bee53b86c3ddd098a6ff39db85889f3.tar JRummikub-d09041304bee53b86c3ddd098a6ff39db85889f3.zip |
Fixed some comment and metrics warnings
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@552 72836036-5685-4462-b002-a69064685172
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(); |