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
  • Field Details

    • JOB_DETAILS_INDEX_NAME

      public static final String JOB_DETAILS_INDEX_NAME
      See Also:
    • TIME_OUT_FOR_REQUEST

      public static Long 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

      public static ConcurrentMap<String, JobDetails> getIndexToJobDetails()
    • getIndexToJobProviders

      public Map<String, ScheduledJobProvider> 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:
      postIndex in interface org.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 Id
      jobIndexName - 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 Id
      listener - an ActionListener that 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 index
      listener - an ActionListener that has onResponse and onFailure that is used to return the job details if it was deleted or else null.