Examples of ClientSessionEntity


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

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

    @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

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

    @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

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

        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

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

        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

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

        this.em = em;
    }

    @Override
    public ClientSessionModel createClientSession(RealmModel realm, ClientModel client) {
        ClientSessionEntity entity = new ClientSessionEntity();
        entity.setId(KeycloakModelUtils.generateId());
        entity.setTimestamp(Time.currentTime());
        entity.setClientId(client.getId());
        entity.setRealmId(realm.getId());
        em.persist(entity);

        return new ClientSessionAdapter(session, em, realm, entity);
    }
View Full Code Here

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

        return new ClientSessionAdapter(session, em, realm, entity);
    }

    @Override
    public ClientSessionModel getClientSession(RealmModel realm, String id) {
        ClientSessionEntity clientSession = em.find(ClientSessionEntity.class, id);
        if (clientSession != null && clientSession.getRealmId().equals(realm.getId())) {
            return new ClientSessionAdapter(session, em, realm, clientSession);
        }
        return null;
    }
View Full Code Here

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

        return null;
    }

    @Override
    public ClientSessionModel getClientSession(String id) {
        ClientSessionEntity clientSession = em.find(ClientSessionEntity.class, id);
        if (clientSession != null) {
            RealmModel realm = session.realms().getRealm(clientSession.getRealmId());
            return new ClientSessionAdapter(session, em, realm, clientSession);
        }
        return null;
    }
View Full Code Here

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

        this.loginFailures = loginFailures;
    }

    @Override
    public ClientSessionModel createClientSession(RealmModel realm, ClientModel client) {
        ClientSessionEntity entity = new ClientSessionEntity();
        entity.setId(KeycloakModelUtils.generateId());
        entity.setTimestamp(Time.currentTime());
        entity.setClientId(client.getId());
        entity.setRealmId(realm.getId());
        clientSessions.put(entity.getId(), entity);
        return new ClientSessionAdapter(session, this, realm, entity);
    }
View Full Code Here

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

        return new ClientSessionAdapter(session, this, realm, entity);
    }

    @Override
    public ClientSessionModel getClientSession(RealmModel realm, String id) {
        ClientSessionEntity entity = clientSessions.get(id);
        return entity != null ? new ClientSessionAdapter(session, this, realm, entity) : null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.