Examples of XMPPServer


Examples of org.apache.vysper.xmpp.server.XMPPServer

        }
        if (!accountManagement.verifyAccountExists(EntityImpl.parse("user3@vysper.org"))) {
            accountManagement.addUser("user3@vysper.org", "password1");
        }

        XMPPServer server = new XMPPServer("vysper.org");

        server.addEndpoint(new TCPEndpoint());

        BoshEndpoint boshEndpoint = new BoshEndpoint();
        boshEndpoint.setAccessControlAllowOrigin(Arrays.asList("*"));
        //        boshEndpoint.setSSLEnabled(true);
        //        boshEndpoint.setSSLCertificateInfo("src/main/resources/keystore",
        //                "password");
        server.addEndpoint(boshEndpoint);

        //server.addEndpoint(new StanzaSessionFactory());
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File("src/test/resources/bogus_mina_tls.cert"), "boguspw");

        try {
            server.start();
            System.out.println("vysper server is running...");
        } catch (Exception e) {
            e.printStackTrace();
        }

        server.addModule(new SoftwareVersionModule());
        server.addModule(new EntityTimeModule());
        server.addModule(new VcardTempModule());
        server.addModule(new XmppPingModule());
        server.addModule(new PrivateDataModule());

        if (listOfModules != null) {
            for (Module module : listOfModules) {
                server.addModule(module);
            }
        }
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        AccountManagement accountManagement = (AccountManagement)providerRegistry.retrieve(AccountManagement.class);

        accountManagement.addUser("test@vysper.org", "password");
        accountManagement.addUser("test2@vysper.org", "password");

        XMPPServer server = new XMPPServer("vysper.org");
        server.addEndpoint(new TCPEndpoint());
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File("src/main/config/bogus_mina_tls.cert"), "boguspw");

        try {
            server.start();
            System.out.println("vysper server is running...");
        } catch (Exception e) {
            e.printStackTrace();
        }

        server.addModule(new SoftwareVersionModule());
        server.addModule(new EntityTimeModule());
        server.addModule(new VcardTempModule());
        server.addModule(new XmppPingModule());
        server.addModule(new PrivateDataModule());
       
        server.addModule(new MUCModule());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

       
        AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);
        accountManagement.addUser(TEST_USERNAME1, TEST_PASSWORD1);
        accountManagement.addUser(TEST_USERNAME2, TEST_PASSWORD2);

        server = new XMPPServer(SERVER_DOMAIN);
       
        TCPEndpoint endpoint = new TCPEndpoint();
        endpoint.setPort(port);
        server.addEndpoint(endpoint);
        server.setStorageProviderRegistry(providerRegistry);
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        if (!accountManagement.verifyAccountExists(EntityImpl.parse("user1@vysper.org"))) {
            accountManagement.addUser("user1@vysper.org", "password1");
        }
       
        server = new XMPPServer("vysper.org");
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File("src/test/resources/bogus_mina_tls.cert"), "boguspw");
       
        BoshEndpoint boshEndpoint = new BoshEndpoint();
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);

        accountManagement.addUser("user1@vysper.org", "password1");
        accountManagement.addUser("user2@vysper.org", "password1");

        XMPPServer server = new XMPPServer("vysper.org");
        server.addEndpoint(new TCPEndpoint());
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File("src/main/config/bogus_mina_tls.cert"), "boguspw");

        server.start();
        System.out.println("vysper server is running...");

        server.addModule(new SoftwareVersionModule());
        server.addModule(new EntityTimeModule());
        server.addModule(new VcardTempModule());
        server.addModule(new XmppPingModule());
        server.addModule(new PrivateDataModule());

        server.addModule(new MUCModule());
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);
        accountManagement.addUser(TEST_USERNAME1, TEST_PASSWORD1);
        accountManagement.addUser(TEST_USERNAME2, TEST_PASSWORD2);

        server = new XMPPServer(SERVER_DOMAIN);

        TCPEndpoint endpoint = new TCPEndpoint();
        endpoint.setPort(port);
        server.addEndpoint(endpoint);
        server.setStorageProviderRegistry(providerRegistry);
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);
        accountManagement.addUser(TEST_USERNAME1, TEST_PASSWORD1);
        accountManagement.addUser(TEST_USERNAME2, TEST_PASSWORD2);

        server = new XMPPServer(SERVER_DOMAIN);

        TCPEndpoint endpoint = new TCPEndpoint();
        endpoint.setPort(port);
        server.addEndpoint(endpoint);
        server.setStorageProviderRegistry(providerRegistry);
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        final AccountManagement accountManagement = (AccountManagement) providerRegistry
                .retrieve(AccountManagement.class);

        accountManagement.addUser(localUser, "password1");

        XMPPServer server = new XMPPServer(localServer.getFullQualifiedName());

        // S2S endpoint
        server.addEndpoint(new S2SEndpoint());

        // C2S endpoint
        server.addEndpoint(new TCPEndpoint());
       
        //server.addEndpoint(new StanzaSessionFactory());
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File(keystorePath), keystorePassword);

        try {
            server.start();
            System.out.println("vysper server is running...");
        } catch (Exception e) {
            e.printStackTrace();
        }

        server.addModule(new SoftwareVersionModule());
        server.addModule(new EntityTimeModule());
        server.addModule(new VcardTempModule());
        server.addModule(new XmppPingModule());
        server.addModule(new PrivateDataModule());

        if (listOfModules != null) {
            for (Module module : listOfModules) {
                server.addModule(module);
            }
        }
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        } else {
            keystorePath = "src/main/config/bogus_mina_tls.cert";
            keystorePassword = "boguspw";           
        }
       
        XMPPServer server = new XMPPServer(localServer.getDomain());

        StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();
        final AccountManagement accountManagement = (AccountManagement) providerRegistry
        .retrieve(AccountManagement.class);

        if (!accountManagement.verifyAccountExists(localUser)) {
            accountManagement.addUser(localUser, "password1");
        }

        // S2S endpoint
        server.addEndpoint(new S2SEndpoint());
       
        // C2S endpoint
        server.addEndpoint(new TCPEndpoint());
       
        server.setStorageProviderRegistry(providerRegistry);
        server.setTLSCertificateInfo(new File(keystorePath), keystorePassword);
       
        server.start();
       
        // enable server connection to use ping
        //server.addModule(new XmppPingModule());

        ServerRuntimeContext serverRuntimeContext = server.getServerRuntimeContext();
       
        Thread.sleep(2000);

        XMPPServerConnectorRegistry registry = serverRuntimeContext.getServerConnectorRegistry();
       
        XMPPServerConnector connector = registry.connect(remoteServer);
       
        Stanza stanza = new StanzaBuilder("message", NamespaceURIs.JABBER_SERVER)
            .addAttribute("from", localUser.getFullQualifiedName())
            .addAttribute("to", remoteUser.getFullQualifiedName())
            .startInnerElement("body", NamespaceURIs.JABBER_SERVER)
            .addText("Hello world")
            .endInnerElement()
            .build();
           
        connector.write(stanza);
       
        //sendMessagesUsingClients(localUser, remoteServer, remoteUser, remotePassword, keystorePath, keystorePassword);
       
        Thread.sleep(50000);
       
        server.stop();
    }
View Full Code Here

Examples of org.apache.vysper.xmpp.server.XMPPServer

        Entity user3 = EntityImpl.parse("user3@vysper.org");
        if (!accountManagement.verifyAccountExists(user3)) {
            accountManagement.addUser(user3, "password1");
        }

        XMPPServer server = new XMPPServer("vysper.org");

        server.addEndpoint(new TCPEndpoint());

        BoshEndpoint boshEndpoint = new BoshEndpoint();
        boshEndpoint.setAccessControlAllowOrigin(Arrays.asList("*"));
        //        boshEndpoint.setSSLEnabled(true);
        //        boshEndpoint.setSSLCertificateInfo("src/main/resources/keystore",
        //                "password");
        boshEndpoint.setContextPath("/bosh");
        server.addEndpoint(boshEndpoint);

        //server.addEndpoint(new StanzaSessionFactory());
        server.setStorageProviderRegistry(providerRegistry);

        server.setTLSCertificateInfo(new File("src/test/resources/bogus_mina_tls.cert"), "boguspw");

        try {
            server.start();
            System.out.println("vysper server is running...");
        } catch (Exception e) {
            e.printStackTrace();
        }

        server.addModule(new SoftwareVersionModule());
        server.addModule(new EntityTimeModule());
        server.addModule(new VcardTempModule());
        server.addModule(new XmppPingModule());
        server.addModule(new PrivateDataModule());

        if (listOfModules != null) {
            for (Module module : listOfModules) {
                server.addModule(module);
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.