Search in sources :

Example 1 with ClientSessionUpdateTask

use of org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setProtocol.

@Override
public void setProtocol(String method) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

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

Example 2 with ClientSessionUpdateTask

use of org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setAction.

@Override
public void setAction(String action) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

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

Example 3 with ClientSessionUpdateTask

use of org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask in project keycloak by keycloak.

the class AuthenticatedClientSessionAdapter method setCurrentRefreshTokenUseCount.

@Override
public void setCurrentRefreshTokenUseCount(int currentRefreshTokenUseCount) {
    ClientSessionUpdateTask task = new ClientSessionUpdateTask() {

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

Example 4 with ClientSessionUpdateTask

use of org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask 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 5 with ClientSessionUpdateTask

use of org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask 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)

Aggregations

ClientSessionUpdateTask (org.keycloak.models.sessions.infinispan.changes.ClientSessionUpdateTask)8 AuthenticatedClientSessionEntity (org.keycloak.models.sessions.infinispan.entities.AuthenticatedClientSessionEntity)8 SessionEntityWrapper (org.keycloak.models.sessions.infinispan.changes.SessionEntityWrapper)1 CrossDCLastSessionRefreshChecker (org.keycloak.models.sessions.infinispan.changes.sessions.CrossDCLastSessionRefreshChecker)1