Class ElasticsearchIndexManager
- java.lang.Object
-
- org.apache.syncope.ext.elasticsearch.client.ElasticsearchIndexManager
-
public class ElasticsearchIndexManager extends Object
Listen to any create / update and delete in order to keep the Elasticsearch indexes consistent.
-
-
Field Summary
Fields Modifier and Type Field Description protected co.elastic.clients.elasticsearch.ElasticsearchClient
client
protected ElasticsearchUtils
elasticsearchUtils
protected String
numberOfReplicas
protected String
numberOfShards
-
Constructor Summary
Constructors Constructor Description ElasticsearchIndexManager(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchUtils elasticsearchUtils, String numberOfShards, String numberOfReplicas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
audit(String domain, long instant, JsonNode message)
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
defaultAnyMapping()
co.elastic.clients.elasticsearch._types.mapping.TypeMapping
defaultAuditMapping()
co.elastic.clients.elasticsearch._types.mapping.TypeMapping
defaultRealmMapping()
co.elastic.clients.elasticsearch.indices.IndexSettings
defaultSettings()
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 Detail
-
client
protected final co.elastic.clients.elasticsearch.ElasticsearchClient client
-
elasticsearchUtils
protected final ElasticsearchUtils elasticsearchUtils
-
numberOfShards
protected final String numberOfShards
-
numberOfReplicas
protected final String numberOfReplicas
-
-
Constructor Detail
-
ElasticsearchIndexManager
public ElasticsearchIndexManager(co.elastic.clients.elasticsearch.ElasticsearchClient client, ElasticsearchUtils elasticsearchUtils, String numberOfShards, String numberOfReplicas)
-
-
Method Detail
-
existsAnyIndex
public boolean existsAnyIndex(String domain, AnyTypeKind kind) throws IOException
- Throws:
IOException
-
existsRealmIndex
public boolean existsRealmIndex(String domain) throws IOException
- Throws:
IOException
-
existsAuditIndex
public boolean existsAuditIndex(String domain) throws IOException
- Throws:
IOException
-
defaultSettings
public co.elastic.clients.elasticsearch.indices.IndexSettings defaultSettings() throws IOException
- Throws:
IOException
-
defaultAnyMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAnyMapping() throws IOException
- Throws:
IOException
-
defaultRealmMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultRealmMapping() throws IOException
- Throws:
IOException
-
defaultAuditMapping
public co.elastic.clients.elasticsearch._types.mapping.TypeMapping defaultAuditMapping() throws IOException
- Throws:
IOException
-
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
public void removeAnyIndex(String domain, AnyTypeKind kind) throws IOException
- 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
public void removeRealmIndex(String domain) throws IOException
- 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
public void removeAuditIndex(String domain) throws IOException
- Throws:
IOException
-
entity
@TransactionalEventListener public void entity(EntityLifecycleEvent<Entity> event) throws IOException
- Throws:
IOException
-
audit
public void audit(String domain, long instant, JsonNode message) throws IOException
- Throws:
IOException
-
-