Package org.apache.vysper.xmpp.authorization

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


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


    public static void main(String[] args) throws AccountCreationException, EntityFormatException {

        StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();

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

        ResourceRegistry resourceRegistry = new ResourceRegistry();

        EntityImpl serverEntity = new EntityImpl(null, serverDomain, null);

        AccountManagement accountManagement = (AccountManagement) storageProviderRegistry.retrieve(AccountManagement.class);
        DeliveringInboundStanzaRelay internalStanzaRelay = new DeliveringInboundStanzaRelay(serverEntity, resourceRegistry, accountManagement);
        RecordingStanzaRelay externalStanzaRelay = new RecordingStanzaRelay();

        StanzaRelayBroker stanzaRelayBroker = new StanzaRelayBroker();
        stanzaRelayBroker.setInternalRelay(internalStanzaRelay);
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

    public AddUserHelper(Map<String, String> userPasswordMap) {
        this.userPasswordMap.putAll(userPasswordMap);
    }

    public void setStorageProviderRegistry(StorageProviderRegistry storageProviderRegistry) throws AccountCreationException, EntityFormatException {
        AccountManagement accountManagement = (AccountManagement)storageProviderRegistry.retrieve(AccountManagement.class);
        if (accountManagement == null) throw new IllegalStateException("no account manager accessible.");

        for (String user : userPasswordMap.keySet()) {
            if (!accountManagement.verifyAccountExists(EntityImpl.parse(user))) {
                accountManagement.addUser(user, userPasswordMap.get(user));
            }
        }
    }
View Full Code Here

    }

    private void startServer(int port) throws Exception {
        StorageProviderRegistry providerRegistry = new MemoryStorageProviderRegistry();
       
        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);
View Full Code Here

   
    @Before
    public void startServer() throws Exception {
        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");
        }
       
        server = new XMPPServer("vysper.org");
        server.setStorageProviderRegistry(providerRegistry);
View Full Code Here

        this.userPasswordMap.putAll(userPasswordMap);
    }

    public void setStorageProviderRegistry(StorageProviderRegistry storageProviderRegistry)
            throws AccountCreationException, EntityFormatException {
        AccountManagement accountManagement = (AccountManagement) storageProviderRegistry
                .retrieve(AccountManagement.class);
        if (accountManagement == null)
            throw new IllegalStateException("no account manager accessible.");

        for (String user : userPasswordMap.keySet()) {
            if (!accountManagement.verifyAccountExists(EntityImpl.parse(user))) {
                accountManagement.addUser(user, userPasswordMap.get(user));
            }
        }
    }
View Full Code Here

        ResourceRegistry resourceRegistry = new ResourceRegistry();

        EntityImpl serverEntity = new EntityImpl(null, serverDomain, null);

        AccountManagement accountManagement = (AccountManagement) storageProviderRegistry
                .retrieve(AccountManagement.class);
        DeliveringInboundStanzaRelay internalStanzaRelay = new DeliveringInboundStanzaRelay(serverEntity,
                resourceRegistry, accountManagement);
        RecordingStanzaRelay externalStanzaRelay = new RecordingStanzaRelay();
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

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.