Cleanup
Closes #32273 Signed-off-by: Alexander Schwartz <aschwart@redhat.com>
This commit is contained in:
parent
a7964a588b
commit
5740f8836a
1 changed files with 6 additions and 7 deletions
|
@ -190,11 +190,11 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRealmRemoved(RealmModel realm) {
|
public void onRealmRemoved(RealmModel realm) {
|
||||||
int deletedClientSessions = em.createNamedQuery("deleteClientSessionsByRealm")
|
em.createNamedQuery("deleteClientSessionsByRealm")
|
||||||
.setParameter("realmId", realm.getId())
|
.setParameter("realmId", realm.getId())
|
||||||
.executeUpdate();
|
.executeUpdate();
|
||||||
|
|
||||||
int deletedUserSessions = em.createNamedQuery("deleteUserSessionsByRealm")
|
em.createNamedQuery("deleteUserSessionsByRealm")
|
||||||
.setParameter("realmId", realm.getId())
|
.setParameter("realmId", realm.getId())
|
||||||
.executeUpdate();
|
.executeUpdate();
|
||||||
}
|
}
|
||||||
|
@ -205,12 +205,11 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onClientRemoved(String clientUUID) {
|
private void onClientRemoved(String clientUUID) {
|
||||||
int num = 0;
|
|
||||||
StorageId clientStorageId = new StorageId(clientUUID);
|
StorageId clientStorageId = new StorageId(clientUUID);
|
||||||
if (clientStorageId.isLocal()) {
|
if (clientStorageId.isLocal()) {
|
||||||
num = em.createNamedQuery("deleteClientSessionsByClient").setParameter("clientId", clientUUID).executeUpdate();
|
em.createNamedQuery("deleteClientSessionsByClient").setParameter("clientId", clientUUID).executeUpdate();
|
||||||
} else {
|
} else {
|
||||||
num = em.createNamedQuery("deleteClientSessionsByExternalClient")
|
em.createNamedQuery("deleteClientSessionsByExternalClient")
|
||||||
.setParameter("clientStorageProvider", clientStorageId.getProviderId())
|
.setParameter("clientStorageProvider", clientStorageId.getProviderId())
|
||||||
.setParameter("externalClientId", clientStorageId.getExternalId())
|
.setParameter("externalClientId", clientStorageId.getExternalId())
|
||||||
.executeUpdate();
|
.executeUpdate();
|
||||||
|
@ -223,8 +222,8 @@ public class JpaUserSessionPersisterProvider implements UserSessionPersisterProv
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onUserRemoved(RealmModel realm, String userId) {
|
private void onUserRemoved(RealmModel realm, String userId) {
|
||||||
int num = em.createNamedQuery("deleteClientSessionsByUser").setParameter("userId", userId).executeUpdate();
|
em.createNamedQuery("deleteClientSessionsByUser").setParameter("userId", userId).executeUpdate();
|
||||||
num = em.createNamedQuery("deleteUserSessionsByUser").setParameter("userId", userId).executeUpdate();
|
em.createNamedQuery("deleteUserSessionsByUser").setParameter("userId", userId).executeUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue