Package org.keycloak.models

Examples of org.keycloak.models.UserSessionProvider


*/
public class ClearExpiredUserSessions implements ScheduledTask {

    @Override
    public void run(KeycloakSession session) {
        UserSessionProvider sessions = session.sessions();
        for (RealmModel realm : session.realms().getRealms()) {
            sessions.removeExpiredUserSessions(realm);
        }
    }
View Full Code Here


        this.realmManager = realmManager;
    }

    public boolean removeClient(RealmModel realm, OAuthClientModel client) {
        if (realm.removeOAuthClient(client.getId())) {
            UserSessionProvider sessions = realmManager.getSession().sessions();
            if (sessions != null) {
                realmManager.getSession().sessions().onClientRemoved(realm, client);
            }
            return true;
        } else {
View Full Code Here

        return KeycloakModelUtils.createApplication(realm, name);
    }

    public boolean removeApplication(RealmModel realm, ApplicationModel application) {
        if (realm.removeApplication(application.getId())) {
            UserSessionProvider sessions = realmManager.getSession().sessions();
            if (sessions != null) {
                sessions.onClientRemoved(realm, application);
            }
            return true;
        } else {
            return false;
        }
View Full Code Here

        this.session = session;
    }

    public boolean removeUser(RealmModel realm, UserModel user) {
        if (session.users().removeUser(realm, user)) {
            UserSessionProvider sessions = session.sessions();
            if (sessions != null) {
                sessions.onUserRemoved(realm, user);
            }
            return true;
        }
        return false;
    }
View Full Code Here

        boolean removed = model.removeRealm(realm.getId());
        if (removed) {
            new ApplicationManager(this).removeApplication(getKeycloakAdminstrationRealm(), realm.getMasterAdminApp());

            UserSessionProvider sessions = session.sessions();
            if (sessions != null) {
                sessions.onRealmRemoved(realm);
            }

            // Remove all periodic syncs for configured federation providers
            UsersSyncManager usersSyncManager = new UsersSyncManager();
            for (final UserFederationProviderModel fedProvider : federationProviders) {
View Full Code Here

TOP

Related Classes of org.keycloak.models.UserSessionProvider

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.