Package org.keycloak.models.sessions.jpa.entities

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


        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

        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

TOP

Related Classes of org.keycloak.models.sessions.jpa.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.