org.keycloak.models.utils

## Class RepresentationToModel

- java.lang.Object
- - org.keycloak.models.utils.RepresentationToModel

-     public class RepresentationToModel
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `OIDC`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepresentationToModel()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ComponentModel` | `convertFedMapperToComponent(RealmModel realm, ComponentModel parent, UserFederationMapperRepresentation rep, String newMapperType)`
    `static ComponentModel` | `convertFedProviderToComponent(String realmId, UserFederationProviderRepresentation fedModel)`
    `static ClientModel` | `createClient(KeycloakSession session, RealmModel realm, ClientRepresentation resourceRep)` Does not create scope or role mappings!
    `static void` | `createClientRoleMappings(ClientModel clientModel, UserModel user, List<String> roleNames)`
    `static ClientScopeModel` | `createClientScope(KeycloakSession session, RealmModel realm, ClientScopeRepresentation resourceRep)`
    `static void` | `createClientScopeMappings(RealmModel realm, ClientModel clientModel, List<ScopeMappingRepresentation> mappings)`
    `static void` | `createCredentials(UserRepresentation userRep, KeycloakSession session, RealmModel realm, UserModel user, boolean adminRequest)`
    `static void` | `createFederatedClientRoleMappings(UserFederatedStorageProvider federatedStorage, RealmModel realm, ClientModel clientModel, UserRepresentation userRep, List<String> roleNames)`
    `static void` | `createFederatedIdentities(UserRepresentation userRep, KeycloakSession session, RealmModel realm, UserModel user)`
    `static void` | `createFederatedRoleMappings(UserFederatedStorageProvider federatedStorage, UserRepresentation userRep, RealmModel realm)`
    `static void` | `createGroups(UserRepresentation userRep, RealmModel newRealm, UserModel user)`
    `static ResourceServer` | `createResourceServer(ClientModel client, KeycloakSession session, boolean addDefaultRoles)`
    `static RoleModel` | `createRole(RealmModel newRealm, RoleRepresentation roleRep)`
    `static void` | `createRoleMappings(UserRepresentation userRep, UserModel user, RealmModel realm)`
    `static UserModel` | `createUser(KeycloakSession session, RealmModel newRealm, UserRepresentation userRep)`
    `static long` | `getClaimsMask(ClaimRepresentation rep)`
    `static Map<String,String>` | `importAuthenticationFlows(RealmModel newRealm, RealmRepresentation rep)`
    `static void` | `importAuthorizationSettings(ClientRepresentation clientRepresentation, ClientModel client, KeycloakSession session)`
    `protected static void` | `importComponents(RealmModel newRealm, MultivaluedHashMap<String,ComponentExportRepresentation> components, String parentId)`
    `static void` | `importFederatedUser(KeycloakSession session, RealmModel newRealm, UserRepresentation userRep)`
    `static void` | `importGroup(RealmModel realm, GroupModel parent, GroupRepresentation group)`
    `static void` | `importGroups(RealmModel realm, RealmRepresentation rep)`
    `static void` | `importRealm(KeycloakSession session, RealmRepresentation rep, RealmModel newRealm, boolean skipUserDependent)`
    `static void` | `importRealmAuthorizationSettings(RealmRepresentation rep, RealmModel newRealm, KeycloakSession session)`
    `static void` | `importRoles(RolesRepresentation realmRoles, RealmModel realm)`
    `static void` | `importUserFederationProvidersAndMappers(KeycloakSession session, RealmRepresentation rep, RealmModel newRealm)`
    `static Map<String,String>` | `removeEmptyString(Map<String,String> map)`
    `static void` | `renameRealm(RealmModel realm, String name)`
    `static Policy` | `toModel(AbstractPolicyRepresentation representation, AuthorizationProvider authorization, Policy model)`
    `static AuthenticationFlowModel` | `toModel(AuthenticationFlowRepresentation rep)`
    `static AuthenticatorConfigModel` | `toModel(AuthenticatorConfigRepresentation rep)`
    `static CredentialModel` | `toModel(CredentialRepresentation cred)`
    `static IdentityProviderMapperModel` | `toModel(IdentityProviderMapperRepresentation rep)`
    `static ComponentModel` | `toModel(KeycloakSession session, ComponentRepresentation rep)`
    `static PermissionTicket` | `toModel(PermissionTicketRepresentation representation, String resourceServerId, AuthorizationProvider authorization)`
    `static ProtocolMapperModel` | `toModel(ProtocolMapperRepresentation rep)`
    `static AuthenticationExecutionModel` | `toModel(RealmModel realm, AuthenticationExecutionRepresentation rep)`
    `static IdentityProviderModel` | `toModel(RealmModel realm, IdentityProviderRepresentation representation, KeycloakSession session)`
    `static UserConsentModel` | `toModel(RealmModel newRealm, UserConsentRepresentation consentRep)`
    `static RequiredActionProviderModel` | `toModel(RequiredActionProviderRepresentation rep)`
    `static Resource` | `toModel(ResourceRepresentation resource, ResourceServer resourceServer, AuthorizationProvider authorization)`
    `static ResourceServer` | `toModel(ResourceServerRepresentation rep, AuthorizationProvider authorization)`
    `static Scope` | `toModel(ScopeRepresentation scope, ResourceServer resourceServer, AuthorizationProvider authorization)`
    `static Scope` | `toModel(ScopeRepresentation scope, ResourceServer resourceServer, AuthorizationProvider authorization, boolean updateIfExists)`
    `static OTPPolicy` | `toPolicy(RealmRepresentation rep)`
    `static void` | `updateClient(ClientRepresentation rep, ClientModel resource)`
    `static void` | `updateClientProtocolMappers(ClientRepresentation rep, ClientModel resource)`
    `static void` | `updateClientScope(ClientScopeRepresentation rep, ClientScopeModel resource)`
    `static void` | `updateComponent(KeycloakSession session, ComponentRepresentation rep, ComponentModel component, boolean internal)`
    `static void` | `updateRealm(RealmRepresentation rep, RealmModel realm, KeycloakSession session)`

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

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

- - ### Field Detail

    - #### OIDC

          public static final String OIDC

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RepresentationToModel

          public RepresentationToModel()

  - ### Method Detail

    - #### toPolicy

          public static OTPPolicy toPolicy(RealmRepresentation rep)

    - #### importRealm

          public static void importRealm(KeycloakSession session,
                                         RealmRepresentation rep,
                                         RealmModel newRealm,
                                         boolean skipUserDependent)

    - #### importUserFederationProvidersAndMappers

          public static void importUserFederationProvidersAndMappers(KeycloakSession session,
                                                                     RealmRepresentation rep,
                                                                     RealmModel newRealm)

    - #### importComponents

          protected static void importComponents(RealmModel newRealm,
                                                 MultivaluedHashMap<String,ComponentExportRepresentation> components,
                                                 String parentId)

    - #### importRoles

          public static void importRoles(RolesRepresentation realmRoles,
                                         RealmModel realm)

    - #### importGroups

          public static void importGroups(RealmModel realm,
                                          RealmRepresentation rep)

    - #### importGroup

          public static void importGroup(RealmModel realm,
                                         GroupModel parent,
                                         GroupRepresentation group)

    - #### importAuthenticationFlows

          public static Map<String,String> importAuthenticationFlows(RealmModel newRealm,
                                                                     RealmRepresentation rep)

    - #### renameRealm

          public static void renameRealm(RealmModel realm,
                                         String name)

    - #### updateRealm

          public static void updateRealm(RealmRepresentation rep,
                                         RealmModel realm,
                                         KeycloakSession session)

    - #### convertFedProviderToComponent

          public static ComponentModel convertFedProviderToComponent(String realmId,
                                                                     UserFederationProviderRepresentation fedModel)

    - #### convertFedMapperToComponent

          public static ComponentModel convertFedMapperToComponent(RealmModel realm,
                                                                   ComponentModel parent,
                                                                   UserFederationMapperRepresentation rep,
                                                                   String newMapperType)

    - #### createRole

          public static RoleModel createRole(RealmModel newRealm,
                                             RoleRepresentation roleRep)

    - #### createClient

          public static ClientModel createClient(KeycloakSession session,
                                                 RealmModel realm,
                                                 ClientRepresentation resourceRep)

      Does not create scope or role mappings!
      Parameters:
        `realm` -
        `resourceRep` -
      Returns:

    - #### updateClient

          public static void updateClient(ClientRepresentation rep,
                                          ClientModel resource)

    - #### updateClientProtocolMappers

          public static void updateClientProtocolMappers(ClientRepresentation rep,
                                                         ClientModel resource)

    - #### createClientScope

          public static ClientScopeModel createClientScope(KeycloakSession session,
                                                           RealmModel realm,
                                                           ClientScopeRepresentation resourceRep)

    - #### updateClientScope

          public static void updateClientScope(ClientScopeRepresentation rep,
                                               ClientScopeModel resource)

    - #### getClaimsMask

          public static long getClaimsMask(ClaimRepresentation rep)

    - #### createClientScopeMappings

          public static void createClientScopeMappings(RealmModel realm,
                                                       ClientModel clientModel,
                                                       List<ScopeMappingRepresentation> mappings)

    - #### createUser

          public static UserModel createUser(KeycloakSession session,
                                             RealmModel newRealm,
                                             UserRepresentation userRep)

    - #### createGroups

          public static void createGroups(UserRepresentation userRep,
                                          RealmModel newRealm,
                                          UserModel user)

    - #### createFederatedIdentities

          public static void createFederatedIdentities(UserRepresentation userRep,
                                                       KeycloakSession session,
                                                       RealmModel realm,
                                                       UserModel user)

    - #### createCredentials

          public static void createCredentials(UserRepresentation userRep,
                                               KeycloakSession session,
                                               RealmModel realm,
                                               UserModel user,
                                               boolean adminRequest)

    - #### toModel

          public static CredentialModel toModel(CredentialRepresentation cred)

    - #### createRoleMappings

          public static void createRoleMappings(UserRepresentation userRep,
                                                UserModel user,
                                                RealmModel realm)

    - #### createClientRoleMappings

          public static void createClientRoleMappings(ClientModel clientModel,
                                                      UserModel user,
                                                      List<String> roleNames)

    - #### toModel

          public static IdentityProviderModel toModel(RealmModel realm,
                                                      IdentityProviderRepresentation representation,
                                                      KeycloakSession session)

    - #### toModel

          public static ProtocolMapperModel toModel(ProtocolMapperRepresentation rep)

    - #### toModel

          public static IdentityProviderMapperModel toModel(IdentityProviderMapperRepresentation rep)

    - #### toModel

          public static UserConsentModel toModel(RealmModel newRealm,
                                                 UserConsentRepresentation consentRep)

    - #### toModel

          public static AuthenticationFlowModel toModel(AuthenticationFlowRepresentation rep)

    - #### toModel

          public static AuthenticationExecutionModel toModel(RealmModel realm,
                                                             AuthenticationExecutionRepresentation rep)

    - #### toModel

          public static AuthenticatorConfigModel toModel(AuthenticatorConfigRepresentation rep)

    - #### toModel

          public static RequiredActionProviderModel toModel(RequiredActionProviderRepresentation rep)

    - #### toModel

          public static ComponentModel toModel(KeycloakSession session,
                                               ComponentRepresentation rep)

    - #### updateComponent

          public static void updateComponent(KeycloakSession session,
                                             ComponentRepresentation rep,
                                             ComponentModel component,
                                             boolean internal)

    - #### importRealmAuthorizationSettings

          public static void importRealmAuthorizationSettings(RealmRepresentation rep,
                                                              RealmModel newRealm,
                                                              KeycloakSession session)

    - #### importAuthorizationSettings

          public static void importAuthorizationSettings(ClientRepresentation clientRepresentation,
                                                         ClientModel client,
                                                         KeycloakSession session)

    - #### toModel

          public static ResourceServer toModel(ResourceServerRepresentation rep,
                                               AuthorizationProvider authorization)

    - #### toModel

          public static Policy toModel(AbstractPolicyRepresentation representation,
                                       AuthorizationProvider authorization,
                                       Policy model)

    - #### toModel

          public static Resource toModel(ResourceRepresentation resource,
                                         ResourceServer resourceServer,
                                         AuthorizationProvider authorization)

    - #### toModel

          public static Scope toModel(ScopeRepresentation scope,
                                      ResourceServer resourceServer,
                                      AuthorizationProvider authorization)

    - #### toModel

          public static Scope toModel(ScopeRepresentation scope,
                                      ResourceServer resourceServer,
                                      AuthorizationProvider authorization,
                                      boolean updateIfExists)

    - #### toModel

          public static PermissionTicket toModel(PermissionTicketRepresentation representation,
                                                 String resourceServerId,
                                                 AuthorizationProvider authorization)

    - #### importFederatedUser

          public static void importFederatedUser(KeycloakSession session,
                                                 RealmModel newRealm,
                                                 UserRepresentation userRep)

    - #### createFederatedRoleMappings

          public static void createFederatedRoleMappings(UserFederatedStorageProvider federatedStorage,
                                                         UserRepresentation userRep,
                                                         RealmModel realm)

    - #### createFederatedClientRoleMappings

          public static void createFederatedClientRoleMappings(UserFederatedStorageProvider federatedStorage,
                                                               RealmModel realm,
                                                               ClientModel clientModel,
                                                               UserRepresentation userRep,
                                                               List<String> roleNames)

    - #### removeEmptyString

          public static Map<String,String> removeEmptyString(Map<String,String> map)

    - #### createResourceServer

          public static ResourceServer createResourceServer(ClientModel client,
                                                            KeycloakSession session,
                                                            boolean addDefaultRoles)

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