Package org.keycloak.models.sessions.infinispan.entities

Examples of org.keycloak.models.sessions.infinispan.entities.ClientSessionEntity


        if (!(e instanceof ClientSessionEntity)) {
            return;
        }

        ClientSessionEntity entity = (ClientSessionEntity) e;

        if (client != null && !entity.getClient().equals(client)) {
            return;
        }

        if (userSession != null && !userSession.equals(entity.getUserSession())) {
            return;
        }

        if (requireNullUserSession && entity.getUserSession() != null) {
            return;
        }

        if (expiredRefresh != null && entity.getTimestamp() > expiredRefresh) {
            return;
        }

        switch (emit) {
            case KEY:
                collector.emit(key, key);
                break;
            case ENTITY:
                collector.emit(key, entity);
                break;
            case USER_SESSION_AND_TIMESTAMP:
                if (entity.getUserSession() != null) {
                    collector.emit(entity.getUserSession(), entity.getTimestamp());
                }
                break;
        }
    }
View Full Code Here


    @Override
    public List<ClientSessionModel> getClientSessions() {
        if (entity.getClientSessions() != null) {
            List<ClientSessionEntity> clientSessions = new LinkedList<ClientSessionEntity>();
            for (String c : entity.getClientSessions()) {
                ClientSessionEntity clientSession = (ClientSessionEntity) cache.get(c);
                if (clientSession != null) {
                    clientSessions.add(clientSession);
                }
            }
            return provider.wrapClientSessions(realm, clientSessions);
View Full Code Here

    @Override
    public ClientSessionModel createClientSession(RealmModel realm, ClientModel client) {
        String id = KeycloakModelUtils.generateId();

        ClientSessionEntity entity = new ClientSessionEntity();
        entity.setId(id);
        entity.setRealm(realm.getId());
        entity.setTimestamp(Time.currentTime());
        entity.setClient(client.getId());

        tx.put(sessionCache, id, entity);

        return wrap(realm, entity);
    }
View Full Code Here

        return wrap(realm, entity);
    }

    @Override
    public ClientSessionModel getClientSession(RealmModel realm, String id) {
        ClientSessionEntity entity = (ClientSessionEntity) sessionCache.get(id);
        return wrap(realm, entity);
    }
View Full Code Here

        return wrap(realm, entity);
    }

    @Override
    public ClientSessionModel getClientSession(String id) {
        ClientSessionEntity entity = (ClientSessionEntity) sessionCache.get(id);
        if (entity != null) {
            RealmModel realm = session.realms().getRealm(entity.getRealm());
            return wrap(realm, entity);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.keycloak.models.sessions.infinispan.entities.ClientSessionEntity

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.