Package org.keycloak.partialimport
Class AbstractPartialImport<T>
java.lang.Object
org.keycloak.partialimport.AbstractPartialImport<T>
- All Implemented Interfaces:
PartialImport<T>
- Direct Known Subclasses:
ClientsPartialImport,GroupsPartialImport,IdentityProviderMappersPartialImport,IdentityProvidersPartialImport,RealmRolesPartialImport,UsersPartialImport
Base PartialImport for most resource types.
- Author:
- Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected PartialImportResultabstract voidcreate(RealmModel realm, KeycloakSession session, T resourceRep) doImport(PartialImportRepresentation partialImportRep, RealmModel realm, KeycloakSession session) Create (or re-create) all the imported resources.abstract booleanexists(RealmModel realm, KeycloakSession session, T resourceRep) protected ErrorResponseExceptionexistsError(String message) abstract StringexistsMessage(RealmModel realm, T resourceRep) abstract StringgetModelId(RealmModel realm, KeycloakSession session, T resourceRep) abstract StringgetRepList(PartialImportRepresentation partialImportRep) abstract ResourceTypeprotected PartialImportResultoverwritten(String modelId, T resourceRep) voidprepare(PartialImportRepresentation partialImportRep, RealmModel realm, KeycloakSession session) Find which resources will need to be skipped or overwritten.abstract voidremove(RealmModel realm, KeycloakSession session, T resourceRep) voidremoveOverwrites(RealmModel realm, KeycloakSession session) Delete resources that will be overwritten.protected PartialImportResult
-
Field Details
-
toOverwrite
-
toSkip
-
-
Constructor Details
-
AbstractPartialImport
public AbstractPartialImport()
-
-
Method Details
-
getRepList
-
getName
-
getModelId
-
exists
-
existsMessage
-
getResourceType
-
remove
-
create
-
prepare
public void prepare(PartialImportRepresentation partialImportRep, RealmModel realm, KeycloakSession session) Description copied from interface:PartialImportFind which resources will need to be skipped or overwritten. Also, do a preliminary check for errors.- Specified by:
preparein interfacePartialImport<T>- Parameters:
partialImportRep- Everything in the PartialImport request.realm- Realm to be imported into.session- The KeycloakSession.
-
existsError
-
overwritten
-
skipped
-
added
-
removeOverwrites
Description copied from interface:PartialImportDelete resources that will be overwritten. This is done separately so that it can be called for all resource types before calling all the doImports. It was found that doing delete/add per resource causes errors because of cascading deletes.- Specified by:
removeOverwritesin interfacePartialImport<T>- Parameters:
realm- Realm to be imported into.session- The KeycloakSession
-
doImport
public PartialImportResults doImport(PartialImportRepresentation partialImportRep, RealmModel realm, KeycloakSession session) Description copied from interface:PartialImportCreate (or re-create) all the imported resources.- Specified by:
doImportin interfacePartialImport<T>- Parameters:
partialImportRep- Everything in the PartialImport request.realm- Realm to be imported into.session- The KeycloakSession.- Returns:
- The final results of the PartialImport request.
-