Interface PartialImport<T>

All Known Implementing Classes:
AbstractPartialImport, ClientsPartialImport, GroupsPartialImport, IdentityProviderMappersPartialImport, IdentityProvidersPartialImport, RealmRolesPartialImport, RolesPartialImport, UsersPartialImport

public interface PartialImport<T>
Main interface for PartialImport handlers.
Author:
Stan Silvert [email protected] (C) 2016 Red Hat Inc.
  • Method Details

    • prepare

      Find which resources will need to be skipped or overwritten. Also, do a preliminary check for errors.
      Parameters:
      rep - Everything in the PartialImport request.
      realm - Realm to be imported into.
      session - The KeycloakSession.
      Throws:
      ErrorResponseException - If the PartialImport can not be performed, throw this exception.
    • removeOverwrites

      void removeOverwrites(RealmModel realm, KeycloakSession session)
      Delete 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.
      Parameters:
      realm - Realm to be imported into.
      session - The KeycloakSession
    • doImport

      Create (or re-create) all the imported resources.
      Parameters:
      rep - Everything in the PartialImport request.
      realm - Realm to be imported into.
      session - The KeycloakSession.
      Returns:
      The final results of the PartialImport request.
      Throws:
      ErrorResponseException - if an error was detected trying to doImport a resource.