Class ElasticsearchIndexManager
java.lang.Object
org.apache.syncope.ext.elasticsearch.client.ElasticsearchIndexManager
Listen to any create / update and delete in order to keep the Elasticsearch indexes consistent.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final co.elastic.clients.elasticsearch.ElasticsearchClient
protected final ElasticsearchUtils
protected final String
protected final String
-
Constructor Summary
ConstructorDescriptionElasticsearchIndexManager
(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchUtils elasticsearchUtils, String numberOfShards, String numberOfReplicas) -
Method Summary
Modifier and TypeMethodDescriptionvoid
audit
(String domain, AuditEvent auditEvent) void
createAnyIndex
(String domain, AnyTypeKind kind, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) void
createAuditIndex
(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) void
createRealmIndex
(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) co.elastic.clients.elasticsearch._types.mapping.TypeMapping
co.elastic.clients.elasticsearch._types.mapping.TypeMapping
co.elastic.clients.elasticsearch._types.mapping.TypeMapping
co.elastic.clients.elasticsearch.indices.IndexSettings
protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse
doCreateAnyIndex
(String domain, AnyTypeKind kind, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse
doCreateAuditIndex
(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse
doCreateRealmIndex
(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) void
entity
(EntityLifecycleEvent<Entity> event) boolean
existsAnyIndex
(String domain, AnyTypeKind kind) boolean
existsAuditIndex
(String domain) boolean
existsRealmIndex
(String domain) void
removeAnyIndex
(String domain, AnyTypeKind kind) void
removeAuditIndex
(String domain) void
removeRealmIndex
(String domain)
-
Field Details
-
client
protected final co.elastic.clients.elasticsearch.ElasticsearchClient client -
elasticsearchUtils
-
numberOfShards
-
numberOfReplicas
-
-
Constructor Details
-
ElasticsearchIndexManager
public ElasticsearchIndexManager(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchUtils elasticsearchUtils, String numberOfShards, String numberOfReplicas)
-
-
Method Details
-
existsAnyIndex
- Throws:
IOException
-
existsRealmIndex
- Throws:
IOException
-
existsAuditIndex
- Throws:
IOException
-
defaultSettings
public co.elastic.clients.elasticsearch.indices.IndexSettings defaultSettings() -
defaultAnyMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAnyMapping() -
defaultRealmMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultRealmMapping() -
defaultAuditMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAuditMapping() -
doCreateAnyIndex
protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateAnyIndex(String domain, AnyTypeKind kind, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
createAnyIndex
public void createAnyIndex(String domain, AnyTypeKind kind, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
removeAnyIndex
- Throws:
IOException
-
doCreateRealmIndex
protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateRealmIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
createRealmIndex
public void createRealmIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
removeRealmIndex
- Throws:
IOException
-
doCreateAuditIndex
protected co.elastic.clients.elasticsearch.indices.CreateIndexResponse doCreateAuditIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
createAuditIndex
public void createAuditIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) throws IOException - Throws:
IOException
-
removeAuditIndex
- Throws:
IOException
-
entity
@TransactionalEventListener public void entity(EntityLifecycleEvent<Entity> event) throws IOException - Throws:
IOException
-
audit
- Throws:
IOException
-