Class JobDetailsService
java.lang.Object
org.opensearch.jobscheduler.utils.JobDetailsService
- All Implemented Interfaces:
org.opensearch.index.shard.IndexingOperationListener
public class JobDetailsService
extends Object
implements org.opensearch.index.shard.IndexingOperationListener
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opensearch.index.shard.IndexingOperationListener
org.opensearch.index.shard.IndexingOperationListener.CompositeListener -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionJobDetailsService(org.opensearch.transport.client.Client client, org.opensearch.cluster.service.ClusterService clusterService, Set<String> indicesToListen, Map<String, ScheduledJobProvider> indexToJobProviders) -
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteJobDetails(String documentId, org.opensearch.core.action.ActionListener<Boolean> listener) Delete job details to a corresponding document Idstatic ConcurrentMap<String, JobDetails> booleanvoidpostIndex(org.opensearch.core.index.shard.ShardId shardId, org.opensearch.index.engine.Engine.Index index, org.opensearch.index.engine.Engine.IndexResult result) voidprocessJobDetails(String documentId, String jobIndexName, String jobTypeName, String jobParameterActionName, String jobRunnerActionName, String extensionUniqueId, org.opensearch.core.action.ActionListener<String> listener) Attempts to process job details with a specified documentId.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opensearch.index.shard.IndexingOperationListener
postDelete, postDelete, postIndex, preDelete, preIndex
-
Field Details
-
JOB_DETAILS_INDEX_NAME
- See Also:
-
TIME_OUT_FOR_REQUEST
-
-
Constructor Details
-
JobDetailsService
public JobDetailsService(org.opensearch.transport.client.Client client, org.opensearch.cluster.service.ClusterService clusterService, Set<String> indicesToListen, Map<String, ScheduledJobProvider> indexToJobProviders)
-
-
Method Details
-
getIndexToJobDetails
-
getIndexToJobProviders
-
jobDetailsIndexExist
public boolean jobDetailsIndexExist() -
postIndex
public void postIndex(org.opensearch.core.index.shard.ShardId shardId, org.opensearch.index.engine.Engine.Index index, org.opensearch.index.engine.Engine.IndexResult result) - Specified by:
postIndexin interfaceorg.opensearch.index.shard.IndexingOperationListener
-
processJobDetails
public void processJobDetails(String documentId, String jobIndexName, String jobTypeName, String jobParameterActionName, String jobRunnerActionName, String extensionUniqueId, org.opensearch.core.action.ActionListener<String> listener) Attempts to process job details with a specified documentId. If the job details does not exist it attempts to create the job details document. If the job details document exists, it will try to update the job details.- Parameters:
documentId- a nullable document IdjobIndexName- a non-null job index name.jobTypeName- a non-null job type name.jobParameterActionName- a non-null job parameter action name.jobRunnerActionName- a non-null job runner action name.extensionUniqueId- the extension Idlistener- anActionListenerthat has onResponse and onFailure that is used to return the job details if it was processed or else null.
-
deleteJobDetails
public void deleteJobDetails(String documentId, org.opensearch.core.action.ActionListener<Boolean> listener) Delete job details to a corresponding document Id- Parameters:
documentId- unique id to find and delete the job details document in the indexlistener- anActionListenerthat has onResponse and onFailure that is used to return the job details if it was deleted or else null.
-