Class JobLogService

java.lang.Object
org.codelibs.fess.app.service.JobLogService

public class JobLogService extends Object
Service class for managing job logs in the Fess application. Provides functionality to create, read, update, and delete job log entries, as well as manage job status and perform cleanup operations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected long
    Time interval in milliseconds after which jobs are considered expired.
    protected org.codelibs.fess.mylasta.direction.FessConfig
    Configuration settings for the Fess application.
    protected org.codelibs.fess.opensearch.config.exbhv.JobLogBhv
    Behavior class for job log database operations.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(org.codelibs.fess.opensearch.config.exentity.JobLog jobLog)
    Deletes a specific job log from the database.
    void
    deleteBefore(int days)
    Deletes job logs that ended before the specified number of days ago.
    void
    deleteByJobStatus(List<String> jobStatusList)
    Deletes job logs that have any of the specified job statuses.
    org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.JobLog>
    Retrieves a specific job log by its ID.
    List<org.codelibs.fess.opensearch.config.exentity.JobLog>
    Retrieves a paginated list of job logs based on the provided pager configuration.
    void
    setExpiredJobInterval(long expiredJobInterval)
    Sets the time interval after which jobs are considered expired.
    protected void
    setupListCondition(org.codelibs.fess.opensearch.config.cbean.JobLogCB cb, JobLogPager jobLogPager)
    Sets up the query conditions for retrieving job logs based on the pager configuration.
    void
    store(org.codelibs.fess.opensearch.config.exentity.JobLog jobLog)
    Stores a job log entry in the database.
    void
    Updates the status of expired jobs that haven't finished.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • jobLogBhv

      protected org.codelibs.fess.opensearch.config.exbhv.JobLogBhv jobLogBhv
      Behavior class for job log database operations.
    • fessConfig

      protected org.codelibs.fess.mylasta.direction.FessConfig fessConfig
      Configuration settings for the Fess application.
    • expiredJobInterval

      protected long expiredJobInterval
      Time interval in milliseconds after which jobs are considered expired. Default is 2 hours (2 * 60 * 60 * 1000L).
  • Constructor Details

    • JobLogService

      public JobLogService()
      Default constructor.
  • Method Details

    • getJobLogList

      public List<org.codelibs.fess.opensearch.config.exentity.JobLog> getJobLogList(JobLogPager jobLogPager)
      Retrieves a paginated list of job logs based on the provided pager configuration.
      Parameters:
      jobLogPager - the pager configuration for pagination and filtering
      Returns:
      a list of job logs matching the criteria
    • getJobLog

      public org.dbflute.optional.OptionalEntity<org.codelibs.fess.opensearch.config.exentity.JobLog> getJobLog(String id)
      Retrieves a specific job log by its ID.
      Parameters:
      id - the unique identifier of the job log
      Returns:
      an optional entity containing the job log if found
    • store

      public void store(org.codelibs.fess.opensearch.config.exentity.JobLog jobLog)
      Stores a job log entry in the database. Performs an insert or update operation based on whether the job log already exists.
      Parameters:
      jobLog - the job log to store
    • delete

      public void delete(org.codelibs.fess.opensearch.config.exentity.JobLog jobLog)
      Deletes a specific job log from the database.
      Parameters:
      jobLog - the job log to delete
    • setupListCondition

      protected void setupListCondition(org.codelibs.fess.opensearch.config.cbean.JobLogCB cb, JobLogPager jobLogPager)
      Sets up the query conditions for retrieving job logs based on the pager configuration. Configures filtering and ordering for the database query.
      Parameters:
      cb - the condition bean for building the query
      jobLogPager - the pager containing filter and search criteria
    • deleteBefore

      public void deleteBefore(int days)
      Deletes job logs that ended before the specified number of days ago. Used for cleaning up old log entries.
      Parameters:
      days - the number of days to look back from the current time
    • deleteByJobStatus

      public void deleteByJobStatus(List<String> jobStatusList)
      Deletes job logs that have any of the specified job statuses.
      Parameters:
      jobStatusList - the list of job statuses to match for deletion
    • updateStatus

      public void updateStatus()
      Updates the status of expired jobs that haven't finished. Jobs that have been running longer than the expired job interval without an end time are marked as failed.
    • setExpiredJobInterval

      public void setExpiredJobInterval(long expiredJobInterval)
      Sets the time interval after which jobs are considered expired.
      Parameters:
      expiredJobInterval - the time interval in milliseconds