Search in sources :

Example 16 with AuthenticatedClientSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setTimestamp.

@Override
public void setTimestamp(int timestamp) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

        @Override
        public void runUpdate(AuthenticatedClientSessionEntity entity) {
            entity.setTimestamp(timestamp);
        }

        @Override
        public CrossDCMessageStatus getCrossDCMessageStatus(SessionEntityWrapper<AuthenticatedClientSessionEntity> sessionWrapper) {
            return new CrossDCLastSessionRefreshChecker(provider.getLastSessionRefreshStore(), provider.getOfflineLastSessionRefreshStore()).shouldSaveClientSessionToRemoteCache(kcSession, client.getRealm(), sessionWrapper, userSession, offline, timestamp);
        }

        @Override
        public String toString() {
            return "setTimestamp(" + timestamp + ')';
        }
    };
    update(task);
}
Also used : AuthenticatedClientSessionEntity(org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity) ClientSessionUpdateTask(org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask) SessionEntityWrapper(org.keycloak.models.sessions.infinispan.changes.SessionEntityWrapper) CrossDCLastSessionRefreshChecker(org.keycloak.models.sessions.infinispan.changes.sessions.CrossDCLastSessionRefreshChecker)

Example 17 with AuthenticatedClientSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setRedirectUri.

@Override
public void setRedirectUri(String uri) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

        @Override
        public void runUpdate(AuthenticatedClientSessionEntity entity) {
            entity.setRedirectUri(uri);
        }
    };
    update(task);
}
Also used : AuthenticatedClientSessionEntity(org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity) ClientSessionUpdateTask(org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)

Example 18 with AuthenticatedClientSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method removeNote.

@Override
public void removeNote(String name) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

        @Override
        public void runUpdate(AuthenticatedClientSessionEntity entity) {
            entity.getNotes().remove(name);
        }
    };
    update(task);
}
Also used : AuthenticatedClientSessionEntity(org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity) ClientSessionUpdateTask(org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)

Example 19 with AuthenticatedClientSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setNote.

@Override
public void setNote(String name, String value) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

        @Override
        public void runUpdate(AuthenticatedClientSessionEntity entity) {
            entity.getNotes().put(name, value);
        }
    };
    update(task);
}
Also used : AuthenticatedClientSessionEntity(org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity) ClientSessionUpdateTask(org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)

Example 20 with AuthenticatedClientSessionEntity

use of org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setCurrentRefreshToken.

@Override
public void setCurrentRefreshToken(String currentRefreshToken) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

        @Override
        public void runUpdate(AuthenticatedClientSessionEntity entity) {
            entity.setCurrentRefreshToken(currentRefreshToken);
        }
    };
    update(task);
}
Also used : AuthenticatedClientSessionEntity(org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity) ClientSessionUpdateTask(org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)

Aggregations

AuthenticatedClientSessionEntity (org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity)20 UserSessionEntity (org.keycloak.models.sessions.infinispan.entities.UserSessionEntity)9 SessionEntityWrapper (org.keycloak.models.sessions.infinispan.changes.SessionEntityWrapper)8 UUID (java.util.UUID)7 ClientSessionUpdateTask (org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)7 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)3 RemoteCache (org.infinispan.client.hotrod.RemoteCache)3 SessionUpdateTask (org.keycloak.models.sessions.infinispan.changes.SessionUpdateTask)3 Serializable (java.io.Serializable)2 Collection (java.util.Collection)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 Iterator (java.util.Iterator)2 Map (java.util.Map)2 Objects (java.util.Objects)2 Set (java.util.Set)2 Future (java.util.concurrent.Future)2 TimeUnit (java.util.concurrent.TimeUnit)2 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)2 BiFunction (java.util.function.BiFunction)2