Package africa.absa.inception.error
Class ErrorService
java.lang.Object
africa.absa.inception.error.ErrorService
- All Implemented Interfaces:
IErrorService
The ErrorService class provides the Error Service implementation.
- Author:
- Marcus Portmann
-
Constructor Summary
ConstructorsConstructorDescriptionErrorService(org.springframework.context.ApplicationContext applicationContext, javax.validation.Validator validator, ErrorReportRepository errorReportRepository, ErrorReportSummaryRepository errorReportSummaryRepository) Constructs a new ErrorService. -
Method Summary
Modifier and TypeMethodDescriptionvoidcreateErrorReport(ErrorReport errorReport) Create the new entry for the error report in the database.getErrorReport(UUID errorReportId) Retrieve the error report.getErrorReportSummaries(String filter, ErrorReportSortBy sortBy, SortDirection sortDirection, Integer pageIndex, Integer pageSize) Retrieve the error report summaries.getErrorReportSummary(UUID errorReportId) Retrieve the summary for the error report.getMostRecentErrorReportSummaries(int maximumNumberOfEntries) Retrieve the summaries for the most recent error reports.
-
Constructor Details
-
ErrorService
public ErrorService(org.springframework.context.ApplicationContext applicationContext, javax.validation.Validator validator, ErrorReportRepository errorReportRepository, ErrorReportSummaryRepository errorReportSummaryRepository) Constructs a new ErrorService.- Parameters:
applicationContext- the Spring application contextvalidator- the JSR-303 validatorerrorReportRepository- the Error Report RepositoryerrorReportSummaryRepository- the Error Report Summary Repository
-
-
Method Details
-
createErrorReport
@Transactional public void createErrorReport(ErrorReport errorReport) throws InvalidArgumentException, ServiceUnavailableException Description copied from interface:IErrorServiceCreate the new entry for the error report in the database.- Specified by:
createErrorReportin interfaceIErrorService- Parameters:
errorReport- the ErrorReport instance containing the information for the error report- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the error report could not be created
-
getErrorReport
public ErrorReport getErrorReport(UUID errorReportId) throws InvalidArgumentException, ErrorReportNotFoundException, ServiceUnavailableException Description copied from interface:IErrorServiceRetrieve the error report.- Specified by:
getErrorReportin interfaceIErrorService- Parameters:
errorReportId- the ID for the error report- Returns:
- the error report
- Throws:
InvalidArgumentException- if an argument is invalidErrorReportNotFoundException- if the error report could not be foundServiceUnavailableException- if the error report could not be retrieved
-
getErrorReportSummaries
public ErrorReportSummaries getErrorReportSummaries(String filter, ErrorReportSortBy sortBy, SortDirection sortDirection, Integer pageIndex, Integer pageSize) throws InvalidArgumentException, ServiceUnavailableException Description copied from interface:IErrorServiceRetrieve the error report summaries.- Specified by:
getErrorReportSummariesin interfaceIErrorService- Parameters:
filter- the optional filter to apply to the error reportssortBy- the optional method used to sort the error reports e.g. by who submitted themsortDirection- the optional sort direction to apply to the error reportspageIndex- the optional page indexpageSize- the optional page size- Returns:
- the error report summaries
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the error report summaries could not be retrieved
-
getErrorReportSummary
public ErrorReportSummary getErrorReportSummary(UUID errorReportId) throws InvalidArgumentException, ErrorReportNotFoundException, ServiceUnavailableException Description copied from interface:IErrorServiceRetrieve the summary for the error report.- Specified by:
getErrorReportSummaryin interfaceIErrorService- Parameters:
errorReportId- the ID for the error report- Returns:
- the summary for the error report
- Throws:
InvalidArgumentException- if an argument is invalidErrorReportNotFoundException- if the error report could not be foundServiceUnavailableException- if the error report summary could not be retrieved
-
getMostRecentErrorReportSummaries
public List<ErrorReportSummary> getMostRecentErrorReportSummaries(int maximumNumberOfEntries) throws InvalidArgumentException, ServiceUnavailableException Description copied from interface:IErrorServiceRetrieve the summaries for the most recent error reports.- Specified by:
getMostRecentErrorReportSummariesin interfaceIErrorService- Parameters:
maximumNumberOfEntries- the maximum number of summaries for the most recent error reports to retrieve- Returns:
- the summaries for the most recent error reports
- Throws:
InvalidArgumentException- if an argument is invalidServiceUnavailableException- if the most recent error report summaries could not be retrieved
-