Package com.suse.coco.attestation
Class AttestationResultService
- java.lang.Object
-
- com.suse.coco.attestation.AttestationResultService
-
public class AttestationResultService extends java.lang.ObjectService class to handleAttestationResultin the database
-
-
Field Summary
Fields Modifier and Type Field Description private static org.apache.logging.log4j.LoggerLOGGERprivate org.apache.ibatis.session.SqlSessionFactorysessionFactory
-
Constructor Summary
Constructors Constructor Description AttestationResultService()Default constructor.AttestationResultService(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn)Build a services with the given session factory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<java.lang.Long>getPendingResultByType(java.util.Collection<java.lang.Integer> resultTypeList, int batchSize)Retrieve the ids of the available attestation results with the given state and result type.private static AttestationResultlockAttestationResult(org.apache.ibatis.session.SqlSession session, long id)voidprocessAttestationResult(long id, AttestationWorker worker)Process an attestation result.
-
-
-
Constructor Detail
-
AttestationResultService
public AttestationResultService()
Default constructor.
-
AttestationResultService
public AttestationResultService(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn)
Build a services with the given session factory.- Parameters:
sessionFactoryIn- the sql session factory
-
-
Method Detail
-
getPendingResultByType
public java.util.List<java.lang.Long> getPendingResultByType(java.util.Collection<java.lang.Integer> resultTypeList, int batchSize)Retrieve the ids of the available attestation results with the given state and result type.- Parameters:
resultTypeList- a list of possible result types to matchbatchSize- the number of results to fetch at max- Returns:
- the ids of the attestation results matching the criteria
-
processAttestationResult
public void processAttestationResult(long id, AttestationWorker worker)Process an attestation result. The result is extracted from the database and locked for update.- Parameters:
id- the id of the attestation resultworker- the worker processing the attestation result
-
lockAttestationResult
private static AttestationResult lockAttestationResult(org.apache.ibatis.session.SqlSession session, long id)
-
-