class OrchestrationRequests {

    @GET
    @Path("/{version:[vV][4-8]}/{requestId}")
    @Operation(description = "Find Orchestrated Requests for a given requestId", responses = @ApiResponse(
            content = @Content(array = @ArraySchema(schema = @Schema(implementation = Response.class)))))
    @Produces(MediaType.APPLICATION_JSON)
    @Transactional
    public Response getOrchestrationRequest(@PathParam("requestId") String requestId,
            @PathParam("version") String version, @QueryParam("includeCloudRequest") boolean includeCloudRequest,
            @QueryParam(value = "format") String format) throws ApiException {

        GetOrchestrationResponse orchestrationResponse = new GetOrchestrationResponse();

        InfraActiveRequests infraActiveRequest = null;
        List<org.onap.so.db.request.beans.RequestProcessingData> requestProcessingData = null;

        if (!UUIDChecker.isValidUUID(requestId)) {

            ErrorLoggerInfo errorLoggerInfo =
                    new ErrorLoggerInfo.Builder(MessageEnum.APIH_VALIDATION_ERROR, ErrorCode.SchemaError)
                            .errorSource(Constants.MODIFIED_BY_APIHANDLER).build();
            throw new ValidateException.Builder("Request Id " + requestId + " is not a valid UUID",
                    HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).errorInfo(errorLoggerInfo).build();
        }

        infraActiveRequest = infraActiveRequestLookup(requestId);

        if (isRequestProcessingDataRequired(format)) {
            try {
                requestProcessingData = requestsDbClient.getExternalRequestProcessingDataBySoRequestId(requestId);
            } catch (Exception e) {
                logger.error(
                        "Exception occurred while communicating with RequestDb during requestProcessingData lookup ",
                        e);
                ErrorLoggerInfo errorLoggerInfo =
                        new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.AvailabilityError)
                                .build();

                ValidateException validateException = new ValidateException.Builder(
                        "Exception occurred while communicating with RequestDb during requestProcessingData lookup",
                        HttpStatus.SC_NOT_FOUND, ErrorNumbers.NO_COMMUNICATION_TO_REQUESTS_DB).cause(e)
                                .errorInfo(errorLoggerInfo).build();

                throw validateException;
            }
        }

        Request request = mapInfraActiveRequestToRequest(infraActiveRequest, includeCloudRequest, format, version);

        if (null != requestProcessingData && !requestProcessingData.isEmpty()) {
            request.setRequestProcessingData(mapRequestProcessingData(requestProcessingData));
        }
        request.setRequestId(requestId);
        orchestrationResponse.setRequest(request);

        return builder.buildResponse(HttpStatus.SC_OK, MDC.get(ONAPLogConstants.MDCs.REQUEST_ID), orchestrationResponse,
                version);
    }

}