java.lang.Object
com.irurueta.authserver.serviceclient.infrastructure.resourceserver.DocumentCalls

@Component public class DocumentCalls extends Object
Lists the documents through a generated client and translates every failure into a DocumentAccessException, so no HTTP, OAuth2 or JSON type escapes through the ports. Messages and logs never carry a token.
  • Field Details

    • documentMapper

      private final DocumentMapper documentMapper
      Maps the generated model onto the domain.
  • Constructor Details

    • DocumentCalls

      public DocumentCalls()
  • Method Details

    • list

      public List<Document> list(DocumentsApi documentsApi)
      Lists the documents the token behind the client may see.
      Parameters:
      documentsApi - the generated client, which sends the access token.
      Returns:
      the documents, empty when there are none.
      Throws:
      DocumentAccessException - if the token cannot be obtained, the resource server refuses it, cannot be reached or answers something that is not a list of documents.