Class ElasticsearchReindex
- java.lang.Object
-
- org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate<SchedTask>
-
- org.apache.syncope.core.provisioning.java.job.ElasticsearchReindex
-
- All Implemented Interfaces:
JobDelegate,SchedTaskJobDelegate
public class ElasticsearchReindex extends AbstractSchedTaskJobDelegate<SchedTask>
Remove and rebuild all Elasticsearch indexes with information from existing users, groups and any objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classElasticsearchReindex.ErrorLoggingBulkListener
-
Field Summary
Fields Modifier and Type Field Description protected AnyObjectDAOanyObjectDAOprotected co.elastic.clients.elasticsearch.ElasticsearchClientclientprotected GroupDAOgroupDAOprotected ElasticsearchIndexManagerindexManagerprotected RealmDAOrealmDAOprotected UserDAOuserDAOprotected ElasticsearchUtilsutils-
Fields inherited from class org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate
auditManager, interrupt, interrupted, LOG, notificationManager, publisher, securityProperties, task, taskDAO, taskDataBinder, taskExecDAO, taskType, taskUtilsFactory
-
Fields inherited from interface org.apache.syncope.core.provisioning.api.job.JobDelegate
OPERATION_ID
-
-
Constructor Summary
Constructors Constructor Description ElasticsearchReindex()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected co.elastic.clients.elasticsearch._types.mapping.TypeMappinganyObjectMapping()protected co.elastic.clients.elasticsearch.indices.IndexSettingsanyObjectSettings()protected co.elastic.clients.elasticsearch._types.mapping.TypeMappingauditMapping()protected co.elastic.clients.elasticsearch.indices.IndexSettingsauditSettings()protected StringdoExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context)The actual execution, delegated to child classes.protected co.elastic.clients.elasticsearch._types.mapping.TypeMappinggroupMapping()protected co.elastic.clients.elasticsearch.indices.IndexSettingsgroupSettings()protected booleanhasToBeRegistered(TaskExec<?> execution)Template method to determine whether this job's task execution has to be persisted or not.protected co.elastic.clients.elasticsearch._types.mapping.TypeMappingrealmMapping()protected co.elastic.clients.elasticsearch.indices.IndexSettingsrealmSettings()protected Pair<String,Integer>reindexAnyObjects()protected StringreindexAudit()protected Pair<String,Integer>reindexGroups()protected Pair<String,Integer>reindexRealms()protected Pair<String,Integer>reindexUsers()protected co.elastic.clients.elasticsearch._types.mapping.TypeMappinguserMapping()protected co.elastic.clients.elasticsearch.indices.IndexSettingsuserSettings()-
Methods inherited from class org.apache.syncope.core.provisioning.java.job.AbstractSchedTaskJobDelegate
execute, interrupt, isInterrupted, register, setStatus
-
-
-
-
Field Detail
-
client
@Autowired protected co.elastic.clients.elasticsearch.ElasticsearchClient client
-
indexManager
@Autowired protected ElasticsearchIndexManager indexManager
-
utils
@Autowired protected ElasticsearchUtils utils
-
userDAO
@Autowired protected UserDAO userDAO
-
groupDAO
@Autowired protected GroupDAO groupDAO
-
anyObjectDAO
@Autowired protected AnyObjectDAO anyObjectDAO
-
realmDAO
@Autowired protected RealmDAO realmDAO
-
-
Method Detail
-
userSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings userSettings() throws IOException- Throws:
IOException
-
groupSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings groupSettings() throws IOException- Throws:
IOException
-
anyObjectSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings anyObjectSettings() throws IOException- Throws:
IOException
-
realmSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings realmSettings() throws IOException- Throws:
IOException
-
auditSettings
protected co.elastic.clients.elasticsearch.indices.IndexSettings auditSettings() throws IOException- Throws:
IOException
-
userMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping userMapping() throws IOException- Throws:
IOException
-
groupMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping groupMapping() throws IOException- Throws:
IOException
-
anyObjectMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping anyObjectMapping() throws IOException- Throws:
IOException
-
realmMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping realmMapping() throws IOException- Throws:
IOException
-
auditMapping
protected co.elastic.clients.elasticsearch._types.mapping.TypeMapping auditMapping() throws IOException- Throws:
IOException
-
reindexRealms
protected Pair<String,Integer> reindexRealms() throws IOException
- Throws:
IOException
-
reindexUsers
protected Pair<String,Integer> reindexUsers() throws IOException
- Throws:
IOException
-
reindexGroups
protected Pair<String,Integer> reindexGroups() throws IOException
- Throws:
IOException
-
reindexAnyObjects
protected Pair<String,Integer> reindexAnyObjects() throws IOException
- Throws:
IOException
-
reindexAudit
protected String reindexAudit() throws IOException
- Throws:
IOException
-
doExecute
protected String doExecute(boolean dryRun, String executor, org.quartz.JobExecutionContext context) throws org.quartz.JobExecutionException
Description copied from class:AbstractSchedTaskJobDelegateThe actual execution, delegated to child classes.- Specified by:
doExecutein classAbstractSchedTaskJobDelegate<SchedTask>- Parameters:
dryRun- whether to actually touch the dataexecutor- the user executing this taskcontext- Quartz' execution context, can be used to pass parameters to the job- Returns:
- the task execution status to be set
- Throws:
org.quartz.JobExecutionException- if anything goes wrong
-
hasToBeRegistered
protected boolean hasToBeRegistered(TaskExec<?> execution)
Description copied from class:AbstractSchedTaskJobDelegateTemplate method to determine whether this job's task execution has to be persisted or not.- Overrides:
hasToBeRegisteredin classAbstractSchedTaskJobDelegate<SchedTask>- Parameters:
execution- task execution- Returns:
- whether to persist or not
-
-