Class FapiResourceResponseBase<T extends FapiResourceResponseBase<T>>

java.lang.Object
com.authlete.hms.fapi.FapiResourceResponseBase<T>
Type Parameters:
T - The subclass.
Direct Known Subclasses:
FapiResourceResponseSigner, FapiResourceResponseVerifier

public abstract class FapiResourceResponseBase<T extends FapiResourceResponseBase<T>> extends Object
Since:
1.4
See Also:
  • Constructor Details

    • FapiResourceResponseBase

      public FapiResourceResponseBase()
  • Method Details

    • getMethod

      public String getMethod()
      Get the HTTP method of the request. This is used as the value of the "@method";req derived component.
      Returns:
      The HTTP method of the request.
      See Also:
    • setMethod

      public T setMethod(String method)
      Set the HTTP method of the request. This is used as the value of the "@method";req derived component.
      Parameters:
      method - The HTTP method of the request.
      Returns:
      this object.
      See Also:
    • getTargetUri

      public URI getTargetUri()
      Get the target URI (the original request URL) of the HTTP request. This is used as the value of the "@target-uri";req derived component.
      Returns:
      The target URI (the original request URL) of the HTTP request.
      See Also:
    • setTargetUri

      public T setTargetUri(URI targetUri)
      Set the target URI (the original request URL) of the HTTP request. This is used as the value of the "@target-uri";req derived component.
      Parameters:
      targetUri - The target URI (the original request URL) of the HTTP request.
      Returns:
      this object.
      See Also:
    • getRequestContentDigest

      public String getRequestContentDigest()
      Get the value of the Content-Digest HTTP field of the request. This is used as the value of the "content-digest";req component.
      Returns:
      The value of the Content-Digest HTTP field of the request.
      See Also:
    • setRequestContentDigest

      public T setRequestContentDigest(String contentDigest)
      Set the value of the Content-Digest HTTP field of the request. This is used as the value of the "content-digest";req component.
      Parameters:
      contentDigest - The value of the Content-Digest HTTP field of the request.
      Returns:
      this object.
      See Also:
    • getStatus

      public int getStatus()
      Get the status code of the HTTP response. This is used as the value of the "@status" derived component.
      Returns:
      The status code of the HTTP response.
      See Also:
    • setStatus

      public T setStatus(int status)
      Set the status code of the HTTP response. This is used as the value of the "@status" derived component.
      Parameters:
      status - The status code of the HTTP response.
      Returns:
      this object.
      See Also:
    • getResponseContentDigest

      public String getResponseContentDigest()
      Get the value of the Content-Digest HTTP field of the response. This is used as the value of the "content-digest" component.
      Returns:
      The value of the Content-Digest HTTP field of the response.
      See Also:
    • setResponseContentDigest

      public T setResponseContentDigest(String contentDigest)
      Set the value of the Content-Digest HTTP field of the response. This is used as the value of the "content-digest" component.
      Parameters:
      contentDigest - The value of the Content-Digest HTTP field of the response.
      Returns:
      this object.
      See Also:
    • getCreated

      public Long getCreated()
      Get the creation time of the signature, represented as seconds since the Unix epoch. This is used as the value of the created parameter of the signature metadata.
      Returns:
      The creation time of the signature.
      See Also:
    • setCreated

      public T setCreated(Long created)
      Set the creation time of the signature, represented as seconds since the Unix epoch. This is used as the value of the created parameter of the signature metadata.

      If this is not set before the signing or verifying operation, the current time at which the operation will be executed is used as the signature creation time.

      Parameters:
      created - The creation time of the signature.
      Returns:
      this object.
      See Also:
    • setCreated

      public T setCreated(Instant created)
      Set the creation time of the signature. This is used as the value of the created parameter of the signature metadata.

      If this is not set before the signing or verifying operation, the current time at which the operation will be executed is used as the signature creation time.

      Parameters:
      created - The creation time of the signature.
      Returns:
      this object.
      See Also:
    • getRequestSignatures

      public List<SignatureEntry> getRequestSignatures()
      Get the list of signature entries that represent HTTP message signatures in the request.
      Returns:
      The list of signature entries.
    • addRequestSignature

      public T addRequestSignature(SignatureEntry entry)
      Add a signature entry that represents an HTTP message signature in the request.

      Note that signature entries that do not have the fapi-2-request tag should not be added.

      Parameters:
      entry - A signature entry.
      Returns:
      this object.
    • addRequestSignatures

      public T addRequestSignatures(Collection<SignatureEntry> entries)
      Add signature entries that represent HTTP message signatures in the request.

      Note that signature entries that do not have the fapi-2-request tag should not be added.

      Parameters:
      entries - The list of signature entries.
      Returns:
      this object.