Package org.picketlink.idm

Examples of org.picketlink.idm.PartitionManager


    @Override
    public void syncChangedUsers(KeycloakSessionFactory sessionFactory, String realmId, UserFederationProviderModel model, Date lastSync) {
        logger.infof("Sync changed users from LDAP to local store: realm: %s, federation provider: %s, current time: " + new Date() + ", last sync time: " + lastSync, realmId, model.getDisplayName());

        PartitionManagerProvider idmProvider = sessionFactory.create().getProvider(PartitionManagerProvider.class);
        PartitionManager partitionMgr = idmProvider.getPartitionManager(model);

        // Sync newly created users
        IdentityManager identityManager = partitionMgr.createIdentityManager();
        IdentityQuery<User> userQuery = identityManager.createIdentityQuery(User.class)
                .setParameter(IdentityType.CREATED_AFTER, lastSync);
        syncImpl(sessionFactory, userQuery, realmId, model);

        // Sync updated users
View Full Code Here


        // Ldap config might have changed for the realm. In this case, we must re-initialize
        Map<String, String> config = model.getConfig();
        if (context == null || !config.equals(context.config)) {
            logLDAPConfig(model.getId(), config);

            PartitionManager manager = createPartitionManager(config);
            context = new PartitionManagerContext(config, manager);
            partitionManagers.put(model.getId(), context);
        }
        return context.partitionManager;
    }
View Full Code Here

    }

    @Test
    public void testSearch() {
        KeycloakSession session = keycloakRule.startSession();
        PartitionManager partitionManager = getPartitionManager(session, ldapModel);
        try {
            RealmModel appRealm = session.realms().getRealmByName("test");
            LDAPUtils.addUser(partitionManager, "username1", "John1", "Doel1", "user1@email.org");
            LDAPUtils.addUser(partitionManager, "username2", "John2", "Doel2", "user2@email.org");
            LDAPUtils.addUser(partitionManager, "username3", "John3", "Doel3", "user3@email.org");
View Full Code Here

            // wait a bit
            sleep(1000);

            // Add user to LDAP and update 'user5' in LDAP
            PartitionManager partitionManager = FederationProvidersIntegrationTest.getPartitionManager(session, ldapModel);
            LDAPUtils.addUser(partitionManager, "user6", "User6FN", "User6LN", "user6@email.org");
            LDAPUtils.updateUser(partitionManager, "user5", "User5FNUpdated", "User5LNUpdated", "user5Updated@email.org");

            // Assert still old users in local provider
            assertUserImported(userProvider, testRealm, "user5", "User5FN", "User5LN", "user5@email.org");
View Full Code Here

TOP

Related Classes of org.picketlink.idm.PartitionManager

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.