Package org.apache.vysper.xmpp.authorization

Examples of org.apache.vysper.xmpp.authorization.AccountManagement


    }

    private void startServer(int port) throws Exception {
        StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();

        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);
View Full Code Here


        // choose the storage you want to use
        //StorageProviderRegistry providerRegistry = new JcrStorageProviderRegistry();
        StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();

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

        if (!accountManagement.verifyAccountExists(EntityImpl.parse("user1@vysper.org"))) {
            accountManagement.addUser("user1@vysper.org", "password1");
        }
        if (!accountManagement.verifyAccountExists(EntityImpl.parse("user2@vysper.org"))) {
            accountManagement.addUser("user2@vysper.org", "password1");
        }
        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());
View Full Code Here

        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");
                accountManagement.addUser(user, "secret");

                Entity user2 = EntityImpl.parseUnchecked("camel_producer@apache.camel");
                accountManagement.addUser(user2, "secret");
               
                Entity user3 = EntityImpl.parseUnchecked("camel_producer1@apache.camel");
                accountManagement.addUser(user3, "secret");

                xmppServer.setStorageProviderRegistry(providerRegistry);

                if (endpoint == null) {
                    endpoint = new TCPEndpoint();
View Full Code Here

TOP

Related Classes of org.apache.vysper.xmpp.authorization.AccountManagement

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.