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
FieldsModifier and TypeFieldDescriptionprotected final co.elastic.clients.elasticsearch.ElasticsearchClientprotected final ElasticsearchUtilsprotected final Stringprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionElasticsearchIndexManager(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchUtils elasticsearchUtils, String numberOfShards, String numberOfReplicas) -
Method Summary
Modifier and TypeMethodDescriptionvoidaudit(String domain, AuditEvent auditEvent) voidcreateAnyIndex(String domain, AnyTypeKind kind, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) voidcreateAuditIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) voidcreateRealmIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) co.elastic.clients.elasticsearch._types.mapping.TypeMappingco.elastic.clients.elasticsearch._types.mapping.TypeMappingco.elastic.clients.elasticsearch._types.mapping.TypeMappingco.elastic.clients.elasticsearch.indices.IndexSettingsprotected co.elastic.clients.elasticsearch.indices.CreateIndexResponsedoCreateAnyIndex(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.CreateIndexResponsedoCreateAuditIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) protected co.elastic.clients.elasticsearch.indices.CreateIndexResponsedoCreateRealmIndex(String domain, co.elastic.clients.elasticsearch.indices.IndexSettings settings, co.elastic.clients.elasticsearch._types.mapping.TypeMapping mappings) voidentity(EntityLifecycleEvent<Entity> event) booleanexistsAnyIndex(String domain, AnyTypeKind kind) booleanexistsAuditIndex(String domain) booleanexistsRealmIndex(String domain) voidremoveAnyIndex(String domain, AnyTypeKind kind) voidremoveAuditIndex(String domain) voidremoveRealmIndex(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
-