ClusterState contains Enrich Policy metadata information, that can be useful to other plugins.
As of now, ClusterState metadata contains [EnrichMetadata](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichMetadata.java) objects, that contain [EnrichPolicy](https://github.com/elastic/elasticsearch/blob/main/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/enrich/EnrichPolicy.java) objects.
While `EnrichPolicy` class is in `core`, `EnrichMetadata` is in `enrich` plugin, so it's practically impossible to access EnrichPolicy information without creating a dependency from `enrich` plugin.
It would be good to have an interface in core to avoid this dependency.
x-pack/plugin/enrich/src/main/java/org/elasticsearch/xpack/enrich/EnrichStore.java
import org.elasticsearch.common.Strings;
import org.elasticsearch.core.SuppressForbidden;
import org.elasticsearch.xpack.core.enrich.EnrichPolicy;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.function.Consumer;
import java.util.function.Function;
/**
 * Helper methods for access and storage of an enrich policy.
 */
public final class EnrichStore {
    private EnrichStore() {}
    /**
     * Adds a new enrich policy. If a policy already exists with the same name then
     * this method throws an {@link IllegalArgumentException}.
     * This method can only be invoked on the elected master node.
     *
     * @param name      The unique name of the policy
     * @param policy    The policy to store
     * @param handler   The handler that gets invoked if policy has been stored or a failure has occurred.
     */
    public static void putPolicy(
        final String name,
        final EnrichPolicy policy,
        final ClusterService clusterService,
        final IndexNameExpressionResolver indexNameExpressionResolver,
        final Consumer<Exception> handler