summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.classpath11
-rw-r--r--lib/smack/smack.jarbin0 -> 306803 bytes
-rw-r--r--lib/smack/smackx.jarbin0 -> 666328 bytes
-rw-r--r--lib/vysper/commons-codec-1.4.jarbin0 -> 58160 bytes
-rw-r--r--lib/vysper/commons-lang-2.5.jarbin0 -> 279193 bytes
-rw-r--r--lib/vysper/mina-core-2.0.2.jarbin0 -> 641543 bytes
-rw-r--r--lib/vysper/nbxml-0.7.jarbin0 -> 53299 bytes
-rw-r--r--lib/vysper/slf4j-api-1.6.1.jarbin0 -> 25496 bytes
-rw-r--r--lib/vysper/slf4j-simple-1.6.1.jarbin0 -> 7669 bytes
-rw-r--r--lib/vysper/vysper-core-0.7.jarbin0 -> 445619 bytes
-rw-r--r--lib/vysper/xep0045-muc-0.7.jarbin0 -> 71154 bytes
-rw-r--r--src/jrummikub/resource/bogus_mina_tls.certbin0 -> 937 bytes
-rw-r--r--src/jrummikub/server/DedicatedServer.java84
13 files changed, 94 insertions, 1 deletions
diff --git a/.classpath b/.classpath
index 713d7da..609b897 100644
--- a/.classpath
+++ b/.classpath
@@ -5,6 +5,15 @@
<classpathentry kind="src" path="mock"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
- <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Smack"/>
+ <classpathentry kind="lib" path="lib/smack/smack.jar"/>
+ <classpathentry kind="lib" path="lib/smack/smackx.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/commons-codec-1.4.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/commons-lang-2.5.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/mina-core-2.0.2.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/nbxml-0.7.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/slf4j-api-1.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/slf4j-simple-1.6.1.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/vysper-core-0.7.jar"/>
+ <classpathentry kind="lib" path="lib/vysper/xep0045-muc-0.7.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/lib/smack/smack.jar b/lib/smack/smack.jar
new file mode 100644
index 0000000..22b9780
--- /dev/null
+++ b/lib/smack/smack.jar
Binary files differ
diff --git a/lib/smack/smackx.jar b/lib/smack/smackx.jar
new file mode 100644
index 0000000..231a9aa
--- /dev/null
+++ b/lib/smack/smackx.jar
Binary files differ
diff --git a/lib/vysper/commons-codec-1.4.jar b/lib/vysper/commons-codec-1.4.jar
new file mode 100644
index 0000000..458d432
--- /dev/null
+++ b/lib/vysper/commons-codec-1.4.jar
Binary files differ
diff --git a/lib/vysper/commons-lang-2.5.jar b/lib/vysper/commons-lang-2.5.jar
new file mode 100644
index 0000000..ae491da
--- /dev/null
+++ b/lib/vysper/commons-lang-2.5.jar
Binary files differ
diff --git a/lib/vysper/mina-core-2.0.2.jar b/lib/vysper/mina-core-2.0.2.jar
new file mode 100644
index 0000000..ca90a4c
--- /dev/null
+++ b/lib/vysper/mina-core-2.0.2.jar
Binary files differ
diff --git a/lib/vysper/nbxml-0.7.jar b/lib/vysper/nbxml-0.7.jar
new file mode 100644
index 0000000..6fff5e1
--- /dev/null
+++ b/lib/vysper/nbxml-0.7.jar
Binary files differ
diff --git a/lib/vysper/slf4j-api-1.6.1.jar b/lib/vysper/slf4j-api-1.6.1.jar
new file mode 100644
index 0000000..42e0ad0
--- /dev/null
+++ b/lib/vysper/slf4j-api-1.6.1.jar
Binary files differ
diff --git a/lib/vysper/slf4j-simple-1.6.1.jar b/lib/vysper/slf4j-simple-1.6.1.jar
new file mode 100644
index 0000000..d894d96
--- /dev/null
+++ b/lib/vysper/slf4j-simple-1.6.1.jar
Binary files differ
diff --git a/lib/vysper/vysper-core-0.7.jar b/lib/vysper/vysper-core-0.7.jar
new file mode 100644
index 0000000..a311013
--- /dev/null
+++ b/lib/vysper/vysper-core-0.7.jar
Binary files differ
diff --git a/lib/vysper/xep0045-muc-0.7.jar b/lib/vysper/xep0045-muc-0.7.jar
new file mode 100644
index 0000000..d05d07c
--- /dev/null
+++ b/lib/vysper/xep0045-muc-0.7.jar
Binary files differ
diff --git a/src/jrummikub/resource/bogus_mina_tls.cert b/src/jrummikub/resource/bogus_mina_tls.cert
new file mode 100644
index 0000000..d34502d
--- /dev/null
+++ b/src/jrummikub/resource/bogus_mina_tls.cert
Binary files differ
diff --git a/src/jrummikub/server/DedicatedServer.java b/src/jrummikub/server/DedicatedServer.java
new file mode 100644
index 0000000..a31c6f5
--- /dev/null
+++ b/src/jrummikub/server/DedicatedServer.java
@@ -0,0 +1,84 @@
+package jrummikub.server;
+
+import java.io.IOException;
+import java.net.InetAddress;
+
+import org.apache.vysper.mina.TCPEndpoint;
+import org.apache.vysper.storage.OpenStorageProviderRegistry;
+import org.apache.vysper.xmpp.addressing.Entity;
+import org.apache.vysper.xmpp.authorization.UserAuthorization;
+import org.apache.vysper.xmpp.modules.extension.xep0045_muc.MUCModule;
+import org.apache.vysper.xmpp.modules.extension.xep0045_muc.storage.InMemoryOccupantStorageProvider;
+import org.apache.vysper.xmpp.modules.extension.xep0045_muc.storage.InMemoryRoomStorageProvider;
+import org.apache.vysper.xmpp.modules.roster.persistence.MemoryRosterManager;
+import org.apache.vysper.xmpp.server.XMPPServer;
+
+@SuppressWarnings("deprecation")
+public class DedicatedServer {
+ String serverPassword;
+ String hostName;
+
+ public DedicatedServer(String serverPassword) {
+ this.serverPassword = serverPassword;
+ try {
+ InetAddress addr = InetAddress.getLocalHost();
+ hostName = addr.getCanonicalHostName();
+ } catch (Exception e) {
+ hostName = "localhost";
+ }
+
+ }
+
+ public String getHostName() {
+ return hostName;
+ }
+
+ public void start() throws Exception {
+ XMPPServer server = new XMPPServer(hostName);
+
+ OpenStorageProviderRegistry providerRegistry = new OpenStorageProviderRegistry();
+ providerRegistry.add(new ServerPasswordAuthorization());
+ providerRegistry.add(new MemoryRosterManager());
+ providerRegistry.add(new InMemoryRoomStorageProvider());
+ providerRegistry.add(new InMemoryOccupantStorageProvider());
+
+ server.setStorageProviderRegistry(providerRegistry);
+ server.addEndpoint(new TCPEndpoint());
+
+ server.setTLSCertificateInfo(
+ getClass().getResource(
+ "/jrummikub/resource/bogus_mina_tls.cert").openStream(),
+ "boguspw");
+
+ server.start();
+ MUCModule muc = new MUCModule("play");
+ server.addModule(muc);
+
+ }
+
+ public class ServerPasswordAuthorization implements UserAuthorization {
+ @Override
+ public boolean verifyCredentials(Entity entity, String password,
+ Object credentials) {
+ return password.equals(serverPassword);
+ }
+
+ @Override
+ public boolean verifyCredentials(String entity, String password,
+ Object credentials) {
+ return password.equals(serverPassword);
+ }
+ }
+
+ public static void main(String[] args) {
+
+ DedicatedServer server = new DedicatedServer("password");
+ System.out.println("Server hostname is " + server.getHostName());
+ try {
+ server.start();
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+}