class DynamoDBCertRecordStoreFactory implements CertRecordStoreFactory {

    @Override
    public CertRecordStore create(PrivateKeyStore keyStore) {

        final String tableName = System.getProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_TABLE_NAME);
        if (tableName == null || tableName.isEmpty()) {
            LOGGER.error("Cert Store DynamoDB table name not specified");
            throw new ResourceException(ResourceException.SERVICE_UNAVAILABLE, "DynamoDB table name not specified");
        }

        final String indexName = System.getProperty(ZTSConsts.ZTS_PROP_CERT_DYNAMODB_INDEX_CURRENT_TIME_NAME);
        if (indexName == null || indexName.isEmpty()) {
            LOGGER.error("Cert Store DynamoDB index current-time not specified");
            throw new ResourceException(ResourceException.SERVICE_UNAVAILABLE, "DynamoDB index current-time not specified");
        }

        ZTSClientNotificationSenderImpl ztsClientNotificationSender = new ZTSClientNotificationSenderImpl();
        AmazonDynamoDB client = getDynamoDBClient(ztsClientNotificationSender, keyStore);
        return new DynamoDBCertRecordStore(client, tableName, indexName, ztsClientNotificationSender);
    }

}