Interface SecurityMigrations.SecurityMigration

All Known Implementing Classes:
SecurityMigrations.CleanupRoleMappingDuplicatesMigration, SecurityMigrations.RoleMetadataFlattenedMigration
Enclosing class:
SecurityMigrations

public static interface SecurityMigrations.SecurityMigration
Interface for creating SecurityMigrations that will be automatically applied once to existing .security indices IMPORTANT: A new index version needs to be added to IndexVersions for the migration to be triggered
  • Method Details

    • migrate

      void migrate(SecurityIndexManager indexManager, Client client, ActionListener<Void> listener)
      Method that will execute the actual migration - needs to be idempotent and non-blocking
      Parameters:
      indexManager - for the security index
      client - the index client
      listener - listener to provide updates back to caller
    • nodeFeaturesRequired

      Set<NodeFeature> nodeFeaturesRequired()
      Any node features that are required for this migration to run. This makes sure that all nodes in the cluster can handle any changes in behaviour introduced by the migration.
      Returns:
      a set of features needed to be supported or an empty set if no change in behaviour is expected
    • checkPreConditions

      default boolean checkPreConditions(SecurityIndexManager.IndexState securityIndexManagerState)
      Check that any pre-conditions are met before launching migration
      Parameters:
      securityIndexManagerState - current state of the security index
      Returns:
      true if pre-conditions met, otherwise false
    • minMappingVersion

      int minMappingVersion()
      The min mapping version required to support this migration. This makes sure that the index has at least the min mapping that is required to support the migration.
      Returns:
      the minimum mapping version required to apply this migration