org.keycloak.storage.jpa

## Class JpaUserFederatedStorageProvider

- java.lang.Object
- - org.keycloak.storage.jpa.JpaUserFederatedStorageProvider

- All Implemented Interfaces:
    Provider, UserAttributeFederatedStorage, UserBrokerLinkFederatedStorage, UserConsentFederatedStorage, UserCredentialsFederatedStorage, UserFederatedStorageProvider, UserGroupMembershipFederatedStorage, UserRequiredActionsFederatedStorage, UserRoleMappingsFederatedStorage

      public class JpaUserFederatedStorageProvider
      extends Object
      implements UserFederatedStorageProvider, UserAttributeFederatedStorage, UserBrokerLinkFederatedStorage, UserConsentFederatedStorage, UserCredentialsFederatedStorage, UserGroupMembershipFederatedStorage, UserRequiredActionsFederatedStorage, UserRoleMappingsFederatedStorage

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected javax.persistence.EntityManager` | `em`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JpaUserFederatedStorageProvider(KeycloakSession session, javax.persistence.EntityManager em)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConsent(RealmModel realm, UserModel user, UserConsentModel consent)`
    `void` | `addFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel link)`
    `void` | `addRequiredAction(RealmModel realm, UserModel user, String action)`
    `void` | `close()`
    `void` | `deleteRoleMapping(RealmModel realm, UserModel user, RoleModel role)`
    `MultivaluedHashMap<String,String>` | `getAttributes(RealmModel realm, UserModel user)`
    `UserConsentModel` | `getConsentByClient(RealmModel realm, UserModel user, String clientInternalId)`
    `List<UserConsentModel>` | `getConsents(RealmModel realm, UserModel user)`
    `List<UserCredentialValueModel>` | `getCredentials(RealmModel realm, UserModel user)`
    `Set<FederatedIdentityModel>` | `getFederatedIdentities(UserModel user, RealmModel realm)`
    `FederatedIdentityModel` | `getFederatedIdentity(UserModel user, String socialProvider, RealmModel realm)`
    `Set<GroupModel>` | `getGroups(RealmModel realm, UserModel user)`
    `List<String>` | `getMembership(RealmModel realm, GroupModel group, int firstResult, int max)`
    `Set<String>` | `getRequiredActions(RealmModel realm, UserModel user)`
    `Set<RoleModel>` | `getRoleMappings(RealmModel realm, UserModel user)`
    `String` | `getUserByFederatedIdentity(FederatedIdentityModel link, RealmModel realm)`
    `List<String>` | `getUsersByUserAttribute(RealmModel realm, String name, String value)`
    `void` | `grantRole(RealmModel realm, UserModel user, RoleModel role)`
    `boolean` | `isMemberOf(RealmModel realm, UserModel user, GroupModel group)`
    `void` | `joinGroup(RealmModel realm, UserModel user, GroupModel group)`
    `void` | `leaveGroup(RealmModel realm, UserModel user, GroupModel group)`
    `void` | `preRemove(ProtocolMapperModel protocolMapper)`
    `void` | `preRemove(RealmModel realm)`
    `void` | `preRemove(RealmModel realm, ClientModel client)`
    `void` | `preRemove(RealmModel realm, ComponentModel model)`
    `void` | `preRemove(RealmModel realm, GroupModel group)`
    `void` | `preRemove(RealmModel realm, RoleModel role)`
    `void` | `preRemove(RealmModel realm, UserFederationProviderModel link)`
    `void` | `preRemove(RealmModel realm, UserModel user)`
    `void` | `removeAttribute(RealmModel realm, UserModel user, String name)`
    `void` | `removeCredential(RealmModel realm, UserModel user, UserCredentialValueModel cred)`
    `boolean` | `removeFederatedIdentity(RealmModel realm, UserModel user, String socialProvider)`
    `void` | `removeRequiredAction(RealmModel realm, UserModel user, String action)`
    `boolean` | `revokeConsentForClient(RealmModel realm, UserModel user, String clientInternalId)`
    `void` | `setAttribute(RealmModel realm, UserModel user, String name, List<String> values)`
    `void` | `setSingleAttribute(RealmModel realm, UserModel user, String name, String value)`
    `void` | `updateConsent(RealmModel realm, UserModel user, UserConsentModel consent)`
    `void` | `updateCredential(RealmModel realm, UserModel user, UserCredentialModel cred)`
    `void` | `updateCredential(RealmModel realm, UserModel user, UserCredentialValueModel cred)`
    `void` | `updateFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel model)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### em

          protected javax.persistence.EntityManager em

  - ### Constructor Detail

    - #### JpaUserFederatedStorageProvider

          public JpaUserFederatedStorageProvider(KeycloakSession session,
                                                 javax.persistence.EntityManager em)

  - ### Method Detail

    - #### close

          public void close()

      Specified by:
        `close` in interface `Provider`

    - #### setAttribute

          public void setAttribute(RealmModel realm,
                                   UserModel user,
                                   String name,
                                   List<String> values)

      Specified by:
        `setAttribute` in interface `UserAttributeFederatedStorage`

    - #### setSingleAttribute

          public void setSingleAttribute(RealmModel realm,
                                         UserModel user,
                                         String name,
                                         String value)

      Specified by:
        `setSingleAttribute` in interface `UserAttributeFederatedStorage`

    - #### removeAttribute

          public void removeAttribute(RealmModel realm,
                                      UserModel user,
                                      String name)

      Specified by:
        `removeAttribute` in interface `UserAttributeFederatedStorage`

    - #### getAttributes

          public MultivaluedHashMap<String,String> getAttributes(RealmModel realm,
                                                                 UserModel user)

      Specified by:
        `getAttributes` in interface `UserAttributeFederatedStorage`

    - #### getUsersByUserAttribute

          public List<String> getUsersByUserAttribute(RealmModel realm,
                                                      String name,
                                                      String value)

      Specified by:
        `getUsersByUserAttribute` in interface `UserAttributeFederatedStorage`

    - #### getUserByFederatedIdentity

          public String getUserByFederatedIdentity(FederatedIdentityModel link,
                                                   RealmModel realm)

      Specified by:
        `getUserByFederatedIdentity` in interface `UserBrokerLinkFederatedStorage`

    - #### addFederatedIdentity

          public void addFederatedIdentity(RealmModel realm,
                                           UserModel user,
                                           FederatedIdentityModel link)

      Specified by:
        `addFederatedIdentity` in interface `UserBrokerLinkFederatedStorage`

    - #### removeFederatedIdentity

          public boolean removeFederatedIdentity(RealmModel realm,
                                                 UserModel user,
                                                 String socialProvider)

      Specified by:
        `removeFederatedIdentity` in interface `UserBrokerLinkFederatedStorage`

    - #### updateFederatedIdentity

          public void updateFederatedIdentity(RealmModel realm,
                                              UserModel user,
                                              FederatedIdentityModel model)

      Specified by:
        `updateFederatedIdentity` in interface `UserBrokerLinkFederatedStorage`

    - #### getFederatedIdentities

          public Set<FederatedIdentityModel> getFederatedIdentities(UserModel user,
                                                                    RealmModel realm)

      Specified by:
        `getFederatedIdentities` in interface `UserBrokerLinkFederatedStorage`

    - #### getFederatedIdentity

          public FederatedIdentityModel getFederatedIdentity(UserModel user,
                                                             String socialProvider,
                                                             RealmModel realm)

      Specified by:
        `getFederatedIdentity` in interface `UserBrokerLinkFederatedStorage`

    - #### addConsent

          public void addConsent(RealmModel realm,
                                 UserModel user,
                                 UserConsentModel consent)

      Specified by:
        `addConsent` in interface `UserConsentFederatedStorage`

    - #### getConsentByClient

          public UserConsentModel getConsentByClient(RealmModel realm,
                                                     UserModel user,
                                                     String clientInternalId)

      Specified by:
        `getConsentByClient` in interface `UserConsentFederatedStorage`

    - #### getConsents

          public List<UserConsentModel> getConsents(RealmModel realm,
                                                    UserModel user)

      Specified by:
        `getConsents` in interface `UserConsentFederatedStorage`

    - #### updateConsent

          public void updateConsent(RealmModel realm,
                                    UserModel user,
                                    UserConsentModel consent)

      Specified by:
        `updateConsent` in interface `UserConsentFederatedStorage`

    - #### revokeConsentForClient

          public boolean revokeConsentForClient(RealmModel realm,
                                                UserModel user,
                                                String clientInternalId)

      Specified by:
        `revokeConsentForClient` in interface `UserConsentFederatedStorage`

    - #### getCredentials

          public List<UserCredentialValueModel> getCredentials(RealmModel realm,
                                                               UserModel user)

      Specified by:
        `getCredentials` in interface `UserCredentialsFederatedStorage`

    - #### updateCredential

          public void updateCredential(RealmModel realm,
                                       UserModel user,
                                       UserCredentialModel cred)

      Specified by:
        `updateCredential` in interface `UserCredentialsFederatedStorage`

    - #### updateCredential

          public void updateCredential(RealmModel realm,
                                       UserModel user,
                                       UserCredentialValueModel cred)

      Specified by:
        `updateCredential` in interface `UserCredentialsFederatedStorage`

    - #### removeCredential

          public void removeCredential(RealmModel realm,
                                       UserModel user,
                                       UserCredentialValueModel cred)

      Specified by:
        `removeCredential` in interface `UserCredentialsFederatedStorage`

    - #### getGroups

          public Set<GroupModel> getGroups(RealmModel realm,
                                           UserModel user)

      Specified by:
        `getGroups` in interface `UserGroupMembershipFederatedStorage`

    - #### joinGroup

          public void joinGroup(RealmModel realm,
                                UserModel user,
                                GroupModel group)

      Specified by:
        `joinGroup` in interface `UserGroupMembershipFederatedStorage`

    - #### isMemberOf

          public boolean isMemberOf(RealmModel realm,
                                    UserModel user,
                                    GroupModel group)

    - #### leaveGroup

          public void leaveGroup(RealmModel realm,
                                 UserModel user,
                                 GroupModel group)

      Specified by:
        `leaveGroup` in interface `UserGroupMembershipFederatedStorage`

    - #### getMembership

          public List<String> getMembership(RealmModel realm,
                                            GroupModel group,
                                            int firstResult,
                                            int max)

      Specified by:
        `getMembership` in interface `UserGroupMembershipFederatedStorage`

    - #### getRequiredActions

          public Set<String> getRequiredActions(RealmModel realm,
                                                UserModel user)

      Specified by:
        `getRequiredActions` in interface `UserRequiredActionsFederatedStorage`

    - #### addRequiredAction

          public void addRequiredAction(RealmModel realm,
                                        UserModel user,
                                        String action)

      Specified by:
        `addRequiredAction` in interface `UserRequiredActionsFederatedStorage`

    - #### removeRequiredAction

          public void removeRequiredAction(RealmModel realm,
                                           UserModel user,
                                           String action)

      Specified by:
        `removeRequiredAction` in interface `UserRequiredActionsFederatedStorage`

    - #### grantRole

          public void grantRole(RealmModel realm,
                                UserModel user,
                                RoleModel role)

      Specified by:
        `grantRole` in interface `UserRoleMappingsFederatedStorage`

    - #### getRoleMappings

          public Set<RoleModel> getRoleMappings(RealmModel realm,
                                                UserModel user)

      Specified by:
        `getRoleMappings` in interface `UserRoleMappingsFederatedStorage`

    - #### deleteRoleMapping

          public void deleteRoleMapping(RealmModel realm,
                                        UserModel user,
                                        RoleModel role)

      Specified by:
        `deleteRoleMapping` in interface `UserRoleMappingsFederatedStorage`

    - #### preRemove

          public void preRemove(RealmModel realm)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                UserFederationProviderModel link)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                RoleModel role)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                GroupModel group)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                ClientModel client)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(ProtocolMapperModel protocolMapper)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                UserModel user)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                                ComponentModel model)

      Specified by:
        `preRemove` in interface `UserFederatedStorageProvider`

Copyright © 2016 JBoss by Red Hat. All rights reserved.