Added JPA connection provider and added basic support for multiple transactions to KeycloakSession
This commit is contained in:
1 parent
8cc7676335
commit
d625fb014c
120 files changed
+1867
-1291
No files matched your search
@@ -11,9 +11,8 @@ import java.util.Set;
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public interface KeycloakSession {
|
||||
// Note: The reason there are so many query methods here is for layering a cache on top of an persistent KeycloakSession
|
||||
|
||||
KeycloakTransaction getTransaction();
|
||||
KeycloakTransactionManager getTransaction();
|
||||
|
||||
<T extends Provider> T getProvider(Class<T> clazz);
|
||||
|
||||
@@ -43,5 +42,4 @@ public interface KeycloakSession {
|
||||
|
||||
void close();
|
||||
|
||||
void enlist(KeycloakTransaction transaction);
|
||||
}
|
||||
@@ -10,4 +10,5 @@ public interface KeycloakTransaction {
|
||||
void rollback();
|
||||
void setRollbackOnly();
|
||||
boolean getRollbackOnly();
|
||||
boolean isActive();}
|
||||
boolean isActive();
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
package org.keycloak.models;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
*/
|
||||
public interface KeycloakTransactionManager extends KeycloakTransaction {
|
||||
|
||||
void enlist(KeycloakTransaction transaction);
|
||||
|
||||
}
|
||||
@@ -13,8 +13,6 @@ import java.util.Set;
|
||||
public interface ModelProvider extends Provider {
|
||||
// Note: The reason there are so many query methods here is for layering a cache on top of an persistent KeycloakSession
|
||||
|
||||
KeycloakTransaction getTransaction();
|
||||
|
||||
RealmModel createRealm(String name);
|
||||
RealmModel createRealm(String id, String name);
|
||||
RealmModel getRealm(String id);
|
||||
|
||||
@@ -12,12 +12,10 @@ import java.util.Set;
|
||||
*/
|
||||
public interface UserSessionProvider extends Provider {
|
||||
|
||||
KeycloakTransaction getTransaction();
|
||||
|
||||
UserSessionModel createUserSession(RealmModel realm, UserModel user, String ipAddress);
|
||||
UserSessionModel getUserSession(RealmModel realm, String id);
|
||||
List<UserSessionModel> getUserSessions(RealmModel realm, UserModel user);
|
||||
Set<UserSessionModel> getUserSessions(RealmModel realm, ClientModel client);
|
||||
List<UserSessionModel> getUserSessions(RealmModel realm, ClientModel client);
|
||||
int getActiveUserSessions(RealmModel realm, ClientModel client);
|
||||
void removeUserSession(RealmModel realm, UserSessionModel session);
|
||||
void removeUserSessions(RealmModel realm, UserModel user);
|
||||
|
||||
@@ -9,9 +9,11 @@ import org.keycloak.provider.Spi;
|
||||
*/
|
||||
public class UserSessionSpi implements Spi {
|
||||
|
||||
public static final String NAME = "userSessions";
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "userSessions";
|
||||
return NAME;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user