org.keycloak.models.utils

## Class RepresentationToModel

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

-     public class RepresentationToModel
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RepresentationToModel()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static UserCredentialModel` | `convertCredential(CredentialRepresentation cred)`
    `static ClientModel` | `createClient(KeycloakSession session, RealmModel realm, ClientRepresentation resourceRep, boolean addDefaultRoles)` Does not create scope or role mappings!
    `static void` | `createClientRoleMappings(ClientModel clientModel, UserModel user, List<String> roleNames)`
    `static void` | `createClientScopeMappings(RealmModel realm, ClientModel clientModel, List<ScopeMappingRepresentation> mappings)`
    `static ClientTemplateModel` | `createClientTemplate(KeycloakSession session, RealmModel realm, ClientTemplateRepresentation resourceRep)`
    `static void` | `createCredentials(UserRepresentation userRep, UserModel user)`
    `static void` | `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 void` | `importAuthenticationFlows(RealmModel newRealm, RealmRepresentation rep)`
    `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)`
    `static void` | `importRoles(RolesRepresentation realmRoles, RealmModel realm)`
    `static void` | `renameRealm(RealmModel realm, String name)`
    `static AuthenticationFlowModel` | `toModel(AuthenticationFlowRepresentation rep)`
    `static AuthenticatorConfigModel` | `toModel(AuthenticatorConfigRepresentation rep)`
    `static ComponentModel` | `toModel(ComponentRepresentation rep)`
    `static IdentityProviderMapperModel` | `toModel(IdentityProviderMapperRepresentation rep)`
    `static ProtocolMapperModel` | `toModel(ProtocolMapperRepresentation rep)`
    `static AuthenticationExecutionModel` | `toModel(RealmModel realm, AuthenticationExecutionExportRepresentation rep)`
    `static AuthenticationExecutionModel` | `toModel(RealmModel realm, AuthenticationExecutionRepresentation rep)`
    `static IdentityProviderModel` | `toModel(RealmModel realm, IdentityProviderRepresentation representation)`
    `static UserConsentModel` | `toModel(RealmModel newRealm, UserConsentRepresentation consentRep)`
    `static UserFederationMapperModel` | `toModel(RealmModel realm, UserFederationMapperRepresentation rep)`
    `static RequiredActionProviderModel` | `toModel(RequiredActionProviderRepresentation rep)`
    `static OTPPolicy` | `toPolicy(RealmRepresentation rep)`
    `static void` | `updateClient(ClientRepresentation rep, ClientModel resource)`
    `static void` | `updateClientTemplate(ClientTemplateRepresentation rep, ClientTemplateModel resource)`
    `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`

- - ### 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)

    - #### 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 void 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)

    - #### toModel

          public static UserFederationMapperModel toModel(RealmModel realm,
                                                          UserFederationMapperRepresentation rep)

    - #### createRole

          public static void createRole(RealmModel newRealm,
                                        RoleRepresentation roleRep)

    - #### createClient

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

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

    - #### updateClient

          public static void updateClient(ClientRepresentation rep,
                                          ClientModel resource)

    - #### createClientTemplate

          public static ClientTemplateModel createClientTemplate(KeycloakSession session,
                                                                 RealmModel realm,
                                                                 ClientTemplateRepresentation resourceRep)

    - #### updateClientTemplate

          public static void updateClientTemplate(ClientTemplateRepresentation rep,
                                                  ClientTemplateModel 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)

    - #### createCredentials

          public static void createCredentials(UserRepresentation userRep,
                                               UserModel user)

    - #### convertCredential

          public static UserCredentialModel convertCredential(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)

    - #### 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,
                                                             AuthenticationExecutionExportRepresentation 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(ComponentRepresentation rep)

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