Class IdentityRepository
java.lang.Object
fr.gouv.vitam.security.internal.rest.repository.IdentityRepository
- All Implemented Interfaces:
CertificateCRLCheckStateUpdater<IdentityModel>
,CertificateRepository
public class IdentityRepository
extends Object
implements CertificateRepository, CertificateCRLCheckStateUpdater<IdentityModel>
repository for identity certificate entities management in mongo.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionIdentityRepository
(MongoDbAccess mongoDbAccess) IdentityRepository
(MongoDbAccess mongoDbAccess, String collectionName) -
Method Summary
Modifier and TypeMethodDescriptionboolean
contextIsUsed
(String contextId) Check if a context is usedvoid
createIdentity
(IdentityModel identityModel) create a certificate with contextId and many informationfindAll()
com.mongodb.client.FindIterable<org.bson.Document>
findCertificate
(String issuerDN, CertificateStatus certificateStatus) return list of certificate filtered by issuerDN and certificateStatusfindIdentity
(String subjectDN, String serialNumber) return certificate according to subjectDN and serilanumbervoid
linkContextToIdentity
(String subjectDN, String contextId, String serialNumber) void
updateCertificateState
(List<String> certificatesToUpdate, CertificateStatus certificateStatus) set state for a given list of certificates
-
Field Details
-
CERTIFICATE_COLLECTION
- See Also:
-
-
Constructor Details
-
IdentityRepository
-
IdentityRepository
-
-
Method Details
-
createIdentity
create a certificate with contextId and many information- Parameters:
identityModel
-- Throws:
InvalidParseOperationException
-
findIdentity
public Optional<IdentityModel> findIdentity(String subjectDN, String serialNumber) throws InvalidParseOperationException return certificate according to subjectDN and serilanumber- Parameters:
subjectDN
-serialNumber
-- Returns:
- Throws:
InvalidParseOperationException
-
findAll
- Specified by:
findAll
in interfaceCertificateRepository
- Throws:
InvalidParseOperationException
-
linkContextToIdentity
- Parameters:
subjectDN
-contextId
-serialNumber
-
-
contextIsUsed
Check if a context is used- Parameters:
contextId
-- Returns:
- true if the context is used by Identity
-
findCertificate
public com.mongodb.client.FindIterable<org.bson.Document> findCertificate(String issuerDN, CertificateStatus certificateStatus) return list of certificate filtered by issuerDN and certificateStatus- Specified by:
findCertificate
in interfaceCertificateCRLCheckStateUpdater<IdentityModel>
- Returns:
- list of identity certificate
-
updateCertificateState
public void updateCertificateState(List<String> certificatesToUpdate, CertificateStatus certificateStatus) set state for a given list of certificates- Specified by:
updateCertificateState
in interfaceCertificateCRLCheckStateUpdater<IdentityModel>
-
getEntityModelType
- Specified by:
getEntityModelType
in interfaceCertificateCRLCheckStateUpdater<IdentityModel>
- Returns:
- certificate model class type
-