Package com.suse.coco.attestation
Class AttestationResultService
java.lang.Object
com.suse.coco.attestation.AttestationResultService
Service class to handle
AttestationResult in the database-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final org.apache.logging.log4j.Loggerprivate final org.apache.ibatis.session.SqlSessionFactory -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.AttestationResultService(org.apache.ibatis.session.SqlSessionFactory sessionFactoryIn) Build a services with the given session factory. -
Method Summary
Modifier and TypeMethodDescriptiongetPendingResultByType(Collection<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.
-
Field Details
-
LOGGER
private static final org.apache.logging.log4j.Logger LOGGER -
sessionFactory
private final org.apache.ibatis.session.SqlSessionFactory sessionFactory
-
-
Constructor Details
-
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 Details
-
getPendingResultByType
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
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)
-