Interface CompatibilityMetadataProvider

All Known Implementing Classes:
CachingCompatibilityMetadataProvider, KeycloakCompatibilityMetadataProvider

public interface CompatibilityMetadataProvider
Provides the metadata used by the "update-compatibility" command.

Implementations should return all metadata required to determine if it is possible to update from one Keycloak deployment to another in a compatible manner. Metadata key/value pairs may be added or removed in a subsequent version, so it's necessary for implementations to handle missing metadata gracefully.

The CompatibilityResult determines if a rolling update is possible. Factory methods are present with default implementations of CompatibilityResult.

  • Field Details

  • Method Details

    • metadata

      Map<String,String> metadata()
      Provides the metadata to be persisted.

      If an empty Map is returned, no information about this implementation will be persisted. A null return value is not supported, and it will interrupt the process.

      Returns:
      The metadata required by this provider to determine if a rolling update is possible.
    • isCompatible

      default CompatibilityResult isCompatible(Map<String,String> other)
      It compares the current metadata with other from another deployment.

      The default implementation will allow a rolling update if the metadata from the current server is equal to the other. Implementations can overwrite this method as required.

      Parameters:
      other - The other deployment metadata. It only contains the metadata from this implementation.
      Returns:
      The CompatibilityResult with the outcome.
      See Also:
    • priority

      default int priority()
      Returns:
      The priority. Only relevant is multiple implementation has the same getId() and/or to replace the default implementation shipped in Keycloak.
    • getId

      String getId()
      Returns:
      The ID of this implementation. It should be unique as implementation with the same ID and priority is not valid.