org.keycloak.partialimport

## Interface PartialImport<T>

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

      public interface PartialImport<T>

  Main interface for PartialImport handlers.
  Author:
    Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `PartialImportResults` | `doImport(PartialImportRepresentation rep, RealmModel realm, KeycloakSession session)` Create (or re-create) all the imported resources.
    `void` | `prepare(PartialImportRepresentation rep, RealmModel realm, KeycloakSession session)` Find which resources will need to be skipped or overwritten.
    `void` | `removeOverwrites(RealmModel realm, KeycloakSession session)` Delete resources that will be overwritten.

- - ### Method Detail

    - #### prepare

          void prepare(PartialImportRepresentation rep,
                       RealmModel realm,
                       KeycloakSession session)
                throws ErrorResponseException

      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

          PartialImportResults doImport(PartialImportRepresentation rep,
                                        RealmModel realm,
                                        KeycloakSession session)
                                 throws ErrorResponseException

      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.

Copyright © 2021 JBoss by Red Hat. All rights reserved.