Package com.digicert.validation.mpic
Class MpicFileService
java.lang.Object
com.digicert.validation.mpic.MpicFileService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionMpicFileService(DcvContext dcvContext) Constructs a new MpicService with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionprivate DcvErrorfindDcvErrorOrNull(MpicFileResponse mpicFileResponse) getMpicFileDetails(String fileUrl, String randomValue) Retrieves MPIC file details for a single file URL.getMpicFileDetails(List<String> fileUrls, String randomValue) Retrieves MPIC file details for a list of file URLs.getPrimaryOnlyFileResponse(List<String> fileUrls) Retrieves the primary file response for a list of file URLs.static DcvErrormapAgentStatusToDcvError(AgentStatus agentStatus) private MpicFileDetailsmapToMpicFileDetails(MpicFileResponse mpicFileResponse, String fileUrl, DcvError dcvError) private MpicFileDetailsmapToMpicFileDetailsWithErrorCheck(MpicFileResponse mpicFileResponse, String fileUrl)
-
Field Details
-
mpicClient
-
-
Constructor Details
-
MpicFileService
Constructs a new MpicService with the specified configuration.- Parameters:
dcvContext- context where we can find the necessary dependencies / configuration
-
-
Method Details
-
getMpicFileDetails
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 validaterandomValue- 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
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 validaterandomValue- 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
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
-
mapAgentStatusToDcvError
-
mapToMpicFileDetails
private MpicFileDetails mapToMpicFileDetails(MpicFileResponse mpicFileResponse, String fileUrl, DcvError dcvError)
-