Class KeycloakIndexSchemaUtil

java.lang.Object
org.keycloak.marshalling.KeycloakIndexSchemaUtil

public class KeycloakIndexSchemaUtil extends Object
  • Constructor Details

    • KeycloakIndexSchemaUtil

      public KeycloakIndexSchemaUtil()
  • Method Details

    • uploadAndReindexCaches

      public static void uploadAndReindexCaches(org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, org.infinispan.protostream.GeneratedSchema schema, List<KeycloakIndexSchemaUtil.IndexedEntity> indexedEntities)
      Uploads the GeneratedSchema to the Infinispan cluster.

      If indexing is enabled for one or more entities present in the GeneratedSchema, users may add a list of entities, and the caches where they live. This method will update the indexing schema and perform the reindexing for the new schema. Note that reindexing may be an expensive operation, depending on the amount of data.

      Parameters:
      remoteCacheManager - The RemoteCacheManager connected to the Infinispan server.
      schema - The GeneratedSchema instance to upload.
      indexedEntities - The List of indexed entities and their caches. Duplicates are allowed if the same entity is stored in multiple caches.
      Throws:
      NullPointerException - if remoteCacheManager or schema is null.
    • configureAnnotationProcessor

      public static void configureAnnotationProcessor(org.infinispan.protostream.config.Configuration.Builder builder)
      Adds the annotations to the ProtoStream parser.
    • isIndexSchemaChanged

      public static boolean isIndexSchemaChanged(org.infinispan.protostream.descriptors.Descriptor oldDescriptor, org.infinispan.protostream.descriptors.Descriptor newDescriptor)
      Compares two entities and returns true if any indexing related annotation were changed, added or removed.