Package org.xipki.ca.gateway.acme
Class AcmeRepo
- java.lang.Object
-
- org.xipki.ca.gateway.acme.AcmeRepo
-
- All Implemented Interfaces:
AcmeDataSource.IdChecker
public class AcmeRepo extends Object implements AcmeDataSource.IdChecker
- Author:
- Lijun Liao (xipki)
-
-
Constructor Summary
Constructors Constructor Description AcmeRepo(AcmeDataSource dataSource, int cacheSize, int syncDbSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccountIdExists(long id)voidaddAccount(AcmeAccount account)voidaddOrder(AcmeOrder order)intcleanOrders(Instant certNotAfter, Instant notFinishedOrderExpires)voidclose()voidflushOrderIfNotCached(AcmeOrder order)AcmeAccountgetAccount(long accountId)AcmeAccountgetAccountForJwk(Map<String,String> jwk)AcmeAuthzgetAuthz(AuthzId authzId)AcmeChallenge2getChallenge(ChallId challId)Iterator<ChallId>getChallengesToValidate()byte[]getCsr(long orderId)AcmeOrdergetOrder(long orderId)AcmeOrdergetOrderForCert(byte[] cert)List<Long>getOrderIds(long accountId)Iterator<Long>getOrdersToEnroll()AcmeAccountnewAcmeAccount()AcmeOrdernewAcmeOrder(long accountId, long orderId)booleanorderIdExists(long id)voidstart()
-
-
-
Constructor Detail
-
AcmeRepo
public AcmeRepo(AcmeDataSource dataSource, int cacheSize, int syncDbSeconds)
-
-
Method Detail
-
accountIdExists
public boolean accountIdExists(long id)
- Specified by:
accountIdExistsin interfaceAcmeDataSource.IdChecker
-
orderIdExists
public boolean orderIdExists(long id)
- Specified by:
orderIdExistsin interfaceAcmeDataSource.IdChecker
-
start
public void start()
-
addAccount
public void addAccount(AcmeAccount account)
-
getCsr
public byte[] getCsr(long orderId) throws AcmeSystemException- Throws:
AcmeSystemException
-
getAccount
public AcmeAccount getAccount(long accountId) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getAccountForJwk
public AcmeAccount getAccountForJwk(Map<String,String> jwk) throws AcmeSystemException
- Throws:
AcmeSystemException
-
addOrder
public void addOrder(AcmeOrder order)
-
getOrder
public AcmeOrder getOrder(long orderId) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getOrderForCert
public AcmeOrder getOrderForCert(byte[] cert) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getChallenge
public AcmeChallenge2 getChallenge(ChallId challId) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getAuthz
public AcmeAuthz getAuthz(AuthzId authzId) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getOrderIds
public List<Long> getOrderIds(long accountId) throws AcmeSystemException
- Throws:
AcmeSystemException
-
getChallengesToValidate
public Iterator<ChallId> getChallengesToValidate() throws AcmeSystemException
- Throws:
AcmeSystemException
-
getOrdersToEnroll
public Iterator<Long> getOrdersToEnroll() throws AcmeSystemException
- Throws:
AcmeSystemException
-
cleanOrders
public int cleanOrders(Instant certNotAfter, Instant notFinishedOrderExpires) throws AcmeSystemException
- Throws:
AcmeSystemException
-
newAcmeOrder
public AcmeOrder newAcmeOrder(long accountId, long orderId)
-
newAcmeAccount
public AcmeAccount newAcmeAccount() throws org.xipki.datasource.DataAccessException
- Throws:
org.xipki.datasource.DataAccessException
-
close
public void close()
-
flushOrderIfNotCached
public void flushOrderIfNotCached(AcmeOrder order) throws AcmeSystemException
- Throws:
AcmeSystemException
-
-