Avoid breaking change in UserSessionModel (#24134)
closes #24096 Co-authored-by: Michal Hajas <mhajas@redhat.com>
This commit is contained in:
parent
d4a5391013
commit
829b7090fa
3 changed files with 8 additions and 8 deletions
|
@ -205,8 +205,8 @@ public class InfinispanUserSessionProvider implements UserSessionProvider {
|
||||||
AuthenticatedClientSessionAdapter adapter = new AuthenticatedClientSessionAdapter(session, this, entity, client, userSession, clientSessionUpdateTx, false);
|
AuthenticatedClientSessionAdapter adapter = new AuthenticatedClientSessionAdapter(session, this, entity, client, userSession, clientSessionUpdateTx, false);
|
||||||
|
|
||||||
// For now, the clientSession is considered transient in case that userSession was transient
|
// For now, the clientSession is considered transient in case that userSession was transient
|
||||||
UserSessionModel.SessionPersistenceState persistenceState = (userSession instanceof UserSessionAdapter && ((UserSessionAdapter) userSession).getPersistenceState() != null) ?
|
UserSessionModel.SessionPersistenceState persistenceState = userSession.getPersistenceState() != null ?
|
||||||
((UserSessionAdapter) userSession).getPersistenceState() : UserSessionModel.SessionPersistenceState.PERSISTENT;
|
userSession.getPersistenceState() : UserSessionModel.SessionPersistenceState.PERSISTENT;
|
||||||
|
|
||||||
SessionUpdateTask<AuthenticatedClientSessionEntity> createClientSessionTask = Tasks.addIfAbsentSync();
|
SessionUpdateTask<AuthenticatedClientSessionEntity> createClientSessionTask = Tasks.addIfAbsentSync();
|
||||||
clientSessionUpdateTx.addTask(clientSessionId, createClientSessionTask, entity, persistenceState);
|
clientSessionUpdateTx.addTask(clientSessionId, createClientSessionTask, entity, persistenceState);
|
||||||
|
|
|
@ -232,11 +232,6 @@ public class PersistentUserSessionAdapter implements OfflineUserSessionModel {
|
||||||
return State.valueOf(state);
|
return State.valueOf(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public SessionPersistenceState getPersistenceState() {
|
|
||||||
return SessionPersistenceState.PERSISTENT;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setState(State state) {
|
public void setState(State state) {
|
||||||
String stateStr = state==null ? null : state.toString();
|
String stateStr = state==null ? null : state.toString();
|
||||||
|
|
|
@ -135,7 +135,12 @@ public interface UserSessionModel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SessionPersistenceState getPersistenceState();
|
/**
|
||||||
|
* @return Persistence state of the session
|
||||||
|
*/
|
||||||
|
default SessionPersistenceState getPersistenceState() {
|
||||||
|
return SessionPersistenceState.PERSISTENT;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Flag used when creating user session
|
* Flag used when creating user session
|
||||||
|
|
Loading…
Reference in a new issue