Package 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 Description ExportUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClientRepresentation
exportClient(KeycloakSession session, ClientModel client)
Full export of application including claims and secretstatic MultivaluedHashMap<String,ComponentExportRepresentation>
exportComponents(RealmModel realm, String parentId)
static CredentialRepresentation
exportCredential(CredentialModel userCred)
static UserRepresentation
exportFederatedUser(KeycloakSession session, RealmModel realm, String id, ExportOptions options)
Full export of user data stored in federated storage (including role mappings and credentials)static void
exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os)
static void
exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options)
static RealmRepresentation
exportRealm(KeycloakSession session, RealmModel realm, boolean includeUsers, boolean internal)
static RealmRepresentation
exportRealm(KeycloakSession session, RealmModel realm, ExportOptions options, boolean internal)
static RoleRepresentation
exportRole(RoleModel role)
Full export of role including composite rolesstatic List<RoleRepresentation>
exportRoles(Stream<RoleModel> roles)
static FederatedIdentityRepresentation
exportSocialLink(FederatedIdentityModel socialLink)
static UserRepresentation
exportUser(KeycloakSession session, RealmModel realm, UserModel user, ExportOptions options, boolean internal)
Full export of user (including role mappings and credentials)static void
exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os)
static void
exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options)
-
-
-
Method Detail
-
exportRealm
public static RealmRepresentation exportRealm(KeycloakSession session, RealmModel realm, boolean includeUsers, boolean internal)
-
exportRealm
public static RealmRepresentation exportRealm(KeycloakSession session, RealmModel realm, ExportOptions options, boolean internal)
-
exportComponents
public static MultivaluedHashMap<String,ComponentExportRepresentation> exportComponents(RealmModel realm, String parentId)
-
exportClient
public static ClientRepresentation exportClient(KeycloakSession session, ClientModel client)
Full export of application including claims and secret- Parameters:
client
-- Returns:
- full ApplicationRepresentation
-
exportRoles
public static List<RoleRepresentation> exportRoles(Stream<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, ExportOptions options, boolean internal)
Full export of user (including role mappings and credentials)- Parameters:
user
-- Returns:
- fully exported user representation
-
exportSocialLink
public static FederatedIdentityRepresentation exportSocialLink(FederatedIdentityModel socialLink)
-
exportCredential
public static CredentialRepresentation exportCredential(CredentialModel userCred)
-
exportUsersToStream
public static void exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) throws IOException
- Throws:
IOException
-
exportUsersToStream
public static void exportUsersToStream(KeycloakSession session, RealmModel realm, List<UserModel> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options) throws IOException
- Throws:
IOException
-
exportFederatedUsersToStream
public static void exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os) throws IOException
- Throws:
IOException
-
exportFederatedUsersToStream
public static void exportFederatedUsersToStream(KeycloakSession session, RealmModel realm, List<String> usersToExport, com.fasterxml.jackson.databind.ObjectMapper mapper, OutputStream os, ExportOptions options) throws IOException
- Throws:
IOException
-
exportFederatedUser
public static UserRepresentation exportFederatedUser(KeycloakSession session, RealmModel realm, String id, ExportOptions options)
Full export of user data stored in federated storage (including role mappings and credentials)- Parameters:
id
-- Returns:
- fully exported user representation
-
-