Package org.keycloak.exportimport.util
Class ImportUtils
- java.lang.Object
- 
- org.keycloak.exportimport.util.ImportUtils
 
- 
 public class ImportUtils extends Object - Author:
- Marek Posolda
 
- 
- 
Constructor SummaryConstructors Constructor Description ImportUtils()
 - 
Method SummaryAll Methods Static Methods Concrete Methods Modifier and Type Method Description static Map<String,RealmRepresentation>getRealmsFromStream(com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is)static voidimportFederatedUsersFromStream(KeycloakSession session, String realmName, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is)static voidimportFromStream(KeycloakSession session, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is, Strategy strategy)Fully import realm (or more realms from particular stream)static booleanimportRealm(KeycloakSession session, RealmRepresentation rep, Strategy strategy, boolean skipUserDependent)Fully import realm from representation, save it to model and return model of newly created realmstatic voidimportRealms(KeycloakSession session, Collection<RealmRepresentation> realms, Strategy strategy)static voidimportUsersFromStream(KeycloakSession session, String realmName, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is)
 
- 
- 
- 
Method Detail- 
importRealmspublic static void importRealms(KeycloakSession session, Collection<RealmRepresentation> realms, Strategy strategy) 
 - 
importRealmpublic static boolean importRealm(KeycloakSession session, RealmRepresentation rep, Strategy strategy, boolean skipUserDependent) Fully import realm from representation, save it to model and return model of newly created realm- Parameters:
- session-
- rep-
- strategy- specifies whether to overwrite or ignore existing realm or user entries
- skipUserDependent- If true, then import of any models, which needs users already imported in DB, will be skipped. For example authorization
- Returns:
- newly imported realm (or existing realm if ignoreExisting is true and realm of this name already exists)
 
 - 
importFromStreampublic static void importFromStream(KeycloakSession session, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is, Strategy strategy) throws IOException Fully import realm (or more realms from particular stream)- Parameters:
- session-
- mapper-
- is-
- strategy-
- Throws:
- IOException
 
 - 
getRealmsFromStreampublic static Map<String,RealmRepresentation> getRealmsFromStream(com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is) throws IOException - Throws:
- IOException
 
 - 
importUsersFromStreampublic static void importUsersFromStream(KeycloakSession session, String realmName, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is) throws IOException - Throws:
- IOException
 
 - 
importFederatedUsersFromStreampublic static void importFederatedUsersFromStream(KeycloakSession session, String realmName, com.fasterxml.jackson.databind.ObjectMapper mapper, InputStream is) throws IOException - Throws:
- IOException
 
 
- 
 
-