Package org.apache.vysper.xmpp.server

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


        return client;
    }

    private XMPPServer createLocalServer(Entity localServer, Entity localUser, String password, String keystorePath,
            String keystorePassword) throws AccountCreationException, FileNotFoundException, Exception {
        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, password);
        }

        // S2S endpoint
        TCPEndpoint s2sEndpoint = new TCPEndpoint();
        s2sEndpoint.setPort(5269);
        server.addEndpoint(s2sEndpoint);
       
        // C2S endpoint
        server.addEndpoint(new TCPEndpoint());
       
        server.setStorageProviderRegistry(providerRegistry);
        server.setTLSCertificateInfo(new File(keystorePath), keystorePassword);
       
        server.start();
        return server;
    }
View Full Code Here


        AccountManagement accountManagement = (AccountManagement) providerRegistry.retrieve(AccountManagement.class);
        accountManagement.addUser(EntityImpl.parseUnchecked(TEST_USERNAME1), TEST_PASSWORD1);
        accountManagement.addUser(EntityImpl.parseUnchecked(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

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

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

        server.setTLSCertificateInfo(new File("../../core/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 PublishSubscribeModule());
    }
View Full Code Here

    }

    private void initializeXmppServer() {
        try {
            if (xmppServer == null) {
                xmppServer = new XMPPServer("apache.camel");

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

                Entity user = EntityImpl.parseUnchecked("camel_consumer@apache.camel");
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.server.XMPPServer

Copyright © 2018 www.massapicom. 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.