Package com.suse.coco.attestation
Class AttestationQueueProcessor
java.lang.Object
com.suse.coco.attestation.AttestationQueueProcessor
Process entry in the table suseAttestationResult and executes the proper based on the result type.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAttestationQueueProcessor(DataSource dataSource, AttestationResultService service, ExecutorService executorService, AttestationModuleLoader moduleLoader, int batchSize) Create an attestation queue processor.AttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactory, Configuration configuration, AttestationModuleLoader moduleLoader) Create an attestation queue processor. -
Method Summary
-
Field Details
-
listeningThread
-
processingThread
-
-
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 databaseconfiguration- the current application configurationmoduleLoader- 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 notificationservice- the attestation result serviceexecutorService- the executor to perform the processmoduleLoader- the attestation module loaderbatchSize- 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. UseawaitTermination()to wait for the processor to complete. -
awaitTermination
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
-