Package com.suse.coco.attestation
Class AttestationQueueProcessor
- java.lang.Object
-
- com.suse.coco.attestation.AttestationQueueProcessor
-
- All Implemented Interfaces:
java.lang.Runnable
public class AttestationQueueProcessor extends java.lang.Object implements java.lang.RunnableProcess entry in the table suseAttestationResult and executes the proper based on the result type.
-
-
Field Summary
Fields Modifier and Type Field Description private intbatchSizeprivate java.lang.ObjectdataAvailableprivate java.util.concurrent.ExecutorServiceexecutorServiceprivate java.util.concurrent.atomic.AtomicBooleanlistenerRunningprivate static org.apache.logging.log4j.LoggerLOGGERprivate AttestationModuleLoadermoduleLoaderprivate AttestationResultServiceserviceprivate org.apache.ibatis.session.SqlSessionFactorysessionFactory
-
Constructor Summary
Constructors Modifier Constructor Description protectedAttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn, AttestationResultService serviceIn, java.util.concurrent.ExecutorService executorServiceIn, AttestationModuleLoader moduleLoaderIn, int batchSizeIn)Create an attestation queue processor.AttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn, Configuration configurationIn, AttestationModuleLoader moduleLoaderIn)Create an attestation queue processor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.lang.ThreadcreateListenerThread()private voidlistenForAttestationResults()voidrun()private voidshutdownExecutor()private static voidstopListenerThread(java.lang.Thread listenerThread)
-
-
-
Field Detail
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER
-
dataAvailable
private final java.lang.Object dataAvailable
-
listenerRunning
private final java.util.concurrent.atomic.AtomicBoolean listenerRunning
-
sessionFactory
private final org.apache.ibatis.session.SqlSessionFactory sessionFactory
-
moduleLoader
private final AttestationModuleLoader moduleLoader
-
service
private final AttestationResultService service
-
executorService
private final java.util.concurrent.ExecutorService executorService
-
batchSize
private final int batchSize
-
-
Constructor Detail
-
AttestationQueueProcessor
public AttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn, Configuration configurationIn, AttestationModuleLoader moduleLoaderIn)Create an attestation queue processor.- Parameters:
sessionFactoryIn- the session factory to access the databaseconfigurationIn- the current application configurationmoduleLoaderIn- the attestation module loader
-
AttestationQueueProcessor
protected AttestationQueueProcessor(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn, AttestationResultService serviceIn, java.util.concurrent.ExecutorService executorServiceIn, AttestationModuleLoader moduleLoaderIn, int batchSizeIn)Create an attestation queue processor.- Parameters:
sessionFactoryIn- the session factoryserviceIn- the attestation result serviceexecutorServiceIn- the executor to perform the processmoduleLoaderIn- the attestation module loaderbatchSizeIn- the batch size
-
-
Method Detail
-
run
public void run()
- Specified by:
runin interfacejava.lang.Runnable
-
createListenerThread
private java.lang.Thread createListenerThread()
-
stopListenerThread
private static void stopListenerThread(java.lang.Thread listenerThread)
-
shutdownExecutor
private void shutdownExecutor()
-
listenForAttestationResults
private void listenForAttestationResults()
-
-