Class MpicFileService

java.lang.Object
com.digicert.validation.mpic.MpicFileService

public class MpicFileService extends Object
  • Field Details

  • Constructor Details

    • MpicFileService

      public MpicFileService(DcvContext dcvContext)
      Constructs a new MpicService with the specified configuration.
      Parameters:
      dcvContext - context where we can find the necessary dependencies / configuration
  • Method Details

    • getMpicFileDetails

      public MpicFileDetails getMpicFileDetails(List<String> fileUrls, String randomValue)
      Retrieves MPIC file details for a list of file URLs. It will return the first valid and corroborated MPIC response or the first MPIC response with an error.
      Parameters:
      fileUrls - List of file URLs to validate
      randomValue - A random value that should be included in the file content for validation
      Returns:
      MpicFileDetails containing the MPIC details, file URL, file contents, status code, and any errors encountered
    • getMpicFileDetails

      public MpicFileDetails getMpicFileDetails(String fileUrl, String randomValue)
      Retrieves MPIC file details for a single file URL. It will return the MPIC response with any associated error.
      Parameters:
      fileUrl - The file URL to validate
      randomValue - A random value that should be included in the file content for validation
      Returns:
      MpicFileDetails containing the MPIC details, file URL, file contents, status code, and any errors encountered
    • getPrimaryOnlyFileResponse

      public PrimaryFileResponse getPrimaryOnlyFileResponse(List<String> fileUrls)
      Retrieves the primary file response for a list of file URLs. It will return the first valid primary file response or the first response with an error.
      Parameters:
      fileUrls - List of file URLs to validate
      Returns:
      PrimaryFileResponse containing the primary file response details
    • mapToMpicFileDetailsWithErrorCheck

      private MpicFileDetails mapToMpicFileDetailsWithErrorCheck(MpicFileResponse mpicFileResponse, String fileUrl)
    • findDcvErrorOrNull

      private DcvError findDcvErrorOrNull(MpicFileResponse mpicFileResponse)
    • mapAgentStatusToDcvError

      public static DcvError mapAgentStatusToDcvError(AgentStatus agentStatus)
    • mapToMpicFileDetails

      private MpicFileDetails mapToMpicFileDetails(MpicFileResponse mpicFileResponse, String fileUrl, DcvError dcvError)