Class CSCertificateTaskContext

java.lang.Object
com.io7m.certusine.vanilla.internal.tasks.CSCertificateTaskContext

public final class CSCertificateTaskContext extends Object
The execution context for a task.
  • Constructor Details

    • CSCertificateTaskContext

      public CSCertificateTaskContext(CSStrings inStrings, CSOptions inOptions, CSCertificateStoreType inCertificateStore, Clock inClock, CSDomain inDomain, CSCertificate inCertificate, int inRetryAttemptsMax, CSDNSQueriesFactoryType inDnsQueries)
      The execution context for a task.
      Parameters:
      inStrings - The string resources
      inClock - The clock
      inCertificateStore - The certificate store
      inOptions - The options
      inDomain - The domain
      inCertificate - The certificate
      inDnsQueries - The DNS query factory
      inRetryAttemptsMax - The maximum number of retry attempts
  • Method Details

    • certificateStore

      public CSCertificateStoreType certificateStore()
      Returns:
      The certificate store used during execution
    • now

      public OffsetDateTime now()
      Returns:
      The current time
    • clock

      public Clock clock()
      Returns:
      The clock used for time operations
    • dnsQueries

      public CSDNSQueriesFactoryType dnsQueries()
      Returns:
      A factory of DNS queries
    • options

      public CSOptions options()
      Returns:
      The configuration options
    • strings

      public CSStrings strings()
      Returns:
      The string resources
    • domain

      public CSDomain domain()
      Returns:
      The current domain
    • certificate

      public CSCertificate certificate()
      Returns:
      The current certificate being processed
    • retryAttemptsMax

      public int retryAttemptsMax()
      Returns:
      The maximum number of times a task can be retried
    • dnsRecordCreated

      public void dnsRecordCreated(String name, String text)
      A DNS record was created.
      Parameters:
      name - The record name
      text - The record text
    • dnsRecordsCreated

      public List<CSDNSTXTRecord> dnsRecordsCreated()
      Returns:
      The list of DNS TXT records created during execution
    • retryAttemptsExhausted

      public boolean retryAttemptsExhausted(int retryAttempts)
      Parameters:
      retryAttempts - The number of times a task has been retried
      Returns:
      true if the given number of retry attempts exceeds the allowed number
    • formatProblem

      public String formatProblem(org.shredzone.acme4j.Problem error)
      Format a problem report as text.
      Parameters:
      error - The report
      Returns:
      The formatted report