Class AttestationQueueProcessor

java.lang.Object
com.suse.coco.attestation.AttestationQueueProcessor

public class AttestationQueueProcessor extends Object
Process entry in the table suseAttestationResult and executes the proper based on the result type.
  • Field Details

  • Constructor Details

    • AttestationQueueProcessor

      public AttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactory, Configuration configuration, AttestationModuleLoader moduleLoader)
      Create an attestation queue processor.
      Parameters:
      sessionFactory - the session factory to access the database
      configuration - the current application configuration
      moduleLoader - the attestation module loader
    • AttestationQueueProcessor

      protected AttestationQueueProcessor(DataSource dataSource, AttestationResultService service, ExecutorService executorService, AttestationModuleLoader moduleLoader, int batchSize)
      Create an attestation queue processor.
      Parameters:
      dataSource - the datasource to be used to listen to the database notification
      service - the attestation result service
      executorService - the executor to perform the process
      moduleLoader - the attestation module loader
      batchSize - the batch size
  • Method Details

    • start

      public void start()
      Start the execution of the queue processor. This method will start the processing asynchronously and exit immediately. Use awaitTermination() to wait for the processor to complete.
    • awaitTermination

      public void awaitTermination() throws InterruptedException
      Wait indefinitely for the processor to complete. This is the same as awaitTermination(0L)
      Throws:
      InterruptedException - if the wait for all the threads to stop is interrupted
    • stop

      public void stop()
      Interrupts the execution of this processor.
    • isRunning

      public boolean isRunning()
      Check if this attestation processor is running
      Returns:
      true if at least one of the processor threads is still running