Class OpenSearchIndexManager
- java.lang.Object
-
- org.apache.syncope.ext.opensearch.client.OpenSearchIndexManager
-
public class OpenSearchIndexManager extends Object
Listen to any create / update and delete in order to keep the OpenSearch indexes consistent.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.opensearch.client.opensearch.OpenSearchClientclientprotected StringnumberOfReplicasprotected StringnumberOfShardsprotected OpenSearchUtilsopenSearchUtils
-
Constructor Summary
Constructors Constructor Description OpenSearchIndexManager(org.opensearch.client.opensearch.OpenSearchClient client, OpenSearchUtils ppenSearchUtils, String numberOfShards, String numberOfReplicas)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaudit(String domain, long instant, JsonNode message)voidcreateAnyIndex(String domain, AnyTypeKind kind, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings)voidcreateAuditIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings)voidcreateRealmIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings)org.opensearch.client.opensearch._types.mapping.TypeMappingdefaultAnyMapping()org.opensearch.client.opensearch._types.mapping.TypeMappingdefaultAuditMapping()org.opensearch.client.opensearch._types.mapping.TypeMappingdefaultRealmMapping()org.opensearch.client.opensearch.indices.IndexSettingsdefaultSettings()protected org.opensearch.client.opensearch.indices.CreateIndexResponsedoCreateAnyIndex(String domain, AnyTypeKind kind, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings)protected org.opensearch.client.opensearch.indices.CreateIndexResponsedoCreateAuditIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings)protected org.opensearch.client.opensearch.indices.CreateIndexResponsedoCreateRealmIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._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 Detail
-
client
protected final org.opensearch.client.opensearch.OpenSearchClient client
-
openSearchUtils
protected final OpenSearchUtils openSearchUtils
-
numberOfShards
protected final String numberOfShards
-
numberOfReplicas
protected final String numberOfReplicas
-
-
Constructor Detail
-
OpenSearchIndexManager
public OpenSearchIndexManager(org.opensearch.client.opensearch.OpenSearchClient client, OpenSearchUtils ppenSearchUtils, 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 org.opensearch.client.opensearch.indices.IndexSettings defaultSettings() throws IOException- Throws:
IOException
-
defaultAnyMapping
public org.opensearch.client.opensearch._types.mapping.TypeMapping defaultAnyMapping() throws IOException- Throws:
IOException
-
defaultRealmMapping
public org.opensearch.client.opensearch._types.mapping.TypeMapping defaultRealmMapping() throws IOException- Throws:
IOException
-
defaultAuditMapping
public org.opensearch.client.opensearch._types.mapping.TypeMapping defaultAuditMapping() throws IOException- Throws:
IOException
-
doCreateAnyIndex
protected org.opensearch.client.opensearch.indices.CreateIndexResponse doCreateAnyIndex(String domain, AnyTypeKind kind, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings) throws IOException
- Throws:
IOException
-
createAnyIndex
public void createAnyIndex(String domain, AnyTypeKind kind, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings) throws IOException
- Throws:
IOException
-
removeAnyIndex
public void removeAnyIndex(String domain, AnyTypeKind kind) throws IOException
- Throws:
IOException
-
doCreateRealmIndex
protected org.opensearch.client.opensearch.indices.CreateIndexResponse doCreateRealmIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings) throws IOException
- Throws:
IOException
-
createRealmIndex
public void createRealmIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings) throws IOException
- Throws:
IOException
-
removeRealmIndex
public void removeRealmIndex(String domain) throws IOException
- Throws:
IOException
-
doCreateAuditIndex
protected org.opensearch.client.opensearch.indices.CreateIndexResponse doCreateAuditIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._types.mapping.TypeMapping mappings) throws IOException
- Throws:
IOException
-
createAuditIndex
public void createAuditIndex(String domain, org.opensearch.client.opensearch.indices.IndexSettings settings, org.opensearch.client.opensearch._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
-
-