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 void
configureAnnotationProcessor
(org.infinispan.protostream.config.Configuration.Builder builder) Adds the annotations to the ProtoStream parser.static boolean
isIndexSchemaChanged
(org.infinispan.protostream.descriptors.Descriptor oldDescriptor, org.infinispan.protostream.descriptors.Descriptor newDescriptor) Compares two entities and returnstrue
if any indexing related annotation were changed, added or removed.static void
uploadAndReindexCaches
(org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, org.infinispan.protostream.GeneratedSchema schema, List<KeycloakIndexSchemaUtil.IndexedEntity> indexedEntities) Uploads theGeneratedSchema
to 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 theGeneratedSchema
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
- TheRemoteCacheManager
connected to the Infinispan server.schema
- TheGeneratedSchema
instance to upload.indexedEntities
- TheList
of indexed entities and their caches. Duplicates are allowed if the same entity is stored in multiple caches.- Throws:
NullPointerException
- ifremoteCacheManager
orschema
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 returnstrue
if any indexing related annotation were changed, added or removed.
-