org.keycloak.exportimport.util

## Class ExportUtils

- java.lang.Object
- - org.keycloak.exportimport.util.ExportUtils

-     public class ExportUtils
      extends Object

  Author:
    Marek Posolda

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ExportUtils()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ApplicationRepresentation` | `exportApplication(ApplicationModel app)` Full export of application including claims and secret
    `static CredentialRepresentation` | `exportCredential(UserCredentialValueModel userCred)`
    `static RealmRepresentation` | `exportRealm(KeycloakSession session, RealmModel realm, boolean includeUsers)`
    `static RoleRepresentation` | `exportRole(RoleModel role)` Full export of role including composite roles
    `static List<RoleRepresentation>` | `exportRoles(Collection<RoleModel> roles)`
    `static SocialLinkRepresentation` | `exportSocialLink(SocialLinkModel socialLink)`
    `static UserRepresentation` | `exportUser(KeycloakSession session, RealmModel realm, UserModel user)` Full export of user (including role mappings and credentials)
    `static void` | `exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, org.codehaus.jackson.map.ObjectMapper mapper, OutputStream os)`
    `static List<String>` | `getRoleNames(Collection<RoleModel> roles)`

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

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

- - ### Constructor Detail

    - #### ExportUtils

          public ExportUtils()

  - ### Method Detail

    - #### exportRealm

          public static RealmRepresentation exportRealm(KeycloakSession session,
                                        RealmModel realm,
                                        boolean includeUsers)

    - #### exportApplication

          public static ApplicationRepresentation exportApplication(ApplicationModel app)

      Full export of application including claims and secret
      Parameters:
        `app` -
      Returns:
        full ApplicationRepresentation

    - #### exportRoles

          public static List<RoleRepresentation> exportRoles(Collection<RoleModel> roles)

    - #### getRoleNames

          public static List<String> getRoleNames(Collection<RoleModel> roles)

    - #### exportRole

          public static RoleRepresentation exportRole(RoleModel role)

      Full export of role including composite roles
      Parameters:
        `role` -
      Returns:
        RoleRepresentation with all stuff filled (including composite roles)

    - #### exportUser

          public static UserRepresentation exportUser(KeycloakSession session,
                                      RealmModel realm,
                                      UserModel user)

      Full export of user (including role mappings and credentials)
      Parameters:
        `user` -
      Returns:
        fully exported user representation

    - #### exportSocialLink

          public static SocialLinkRepresentation exportSocialLink(SocialLinkModel socialLink)

    - #### exportCredential

          public static CredentialRepresentation exportCredential(UserCredentialValueModel userCred)

    - #### exportUsersToStream

          public static void exportUsersToStream(KeycloakSession session,
                                 RealmModel realm,
                                 List<UserModel> usersToExport,
                                 org.codehaus.jackson.map.ObjectMapper mapper,
                                 OutputStream os)
                                          throws IOException

      Throws:
        `IOException`

Copyright © 2014. All Rights Reserved.