Package org.keycloak.marshalling
Class KeycloakIndexSchemaUtil
java.lang.Object
org.keycloak.marshalling.KeycloakIndexSchemaUtil
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigureAnnotationProcessor(org.infinispan.protostream.config.Configuration.Builder builder) Adds the annotations to the ProtoStream parser.static booleanisIndexSchemaChanged(org.infinispan.protostream.descriptors.Descriptor oldDescriptor, org.infinispan.protostream.descriptors.Descriptor newDescriptor) Compares two entities and returnstrueif any indexing related annotation were changed, added or removed.static voiduploadAndReindexCaches(org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, org.infinispan.protostream.GeneratedSchema schema, List<KeycloakIndexSchemaUtil.IndexedEntity> indexedEntities) Uploads theGeneratedSchemato the Infinispan cluster.
-
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 theGeneratedSchemato 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- TheRemoteCacheManagerconnected to the Infinispan server.schema- TheGeneratedSchemainstance to upload.indexedEntities- TheListof indexed entities and their caches. Duplicates are allowed if the same entity is stored in multiple caches.- Throws:
NullPointerException- ifremoteCacheManagerorschemais 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 returnstrueif any indexing related annotation were changed, added or removed.
-