Interface IncidentService
public interface IncidentService
Manages storing and retrieving of job incidents.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiongetIncident(long id) Gets a job incident by a given incident identifier.getIncidentsOfJob(long jobId, boolean cascade) Get the hierarchy of incidents for a given job identifier.getIncidentsOfJob(List<Long> jobIds) Get the directly related incidents of all given jobs and return them concatenated into a single list.getLocalization(long id, Locale locale) Gets the localized texts for an incident by a given incident identifier and locale.storeIncident(Job job, Date timestamp, String code, Incident.Severity severity, Map<String, String> descriptionParameters, List<Tuple<String, String>> details) Stores a new job incident.
-
Field Details
-
JOB_TYPE
Identifier for service registration and location- See Also:
-
-
Method Details
-
storeIncident
Incident storeIncident(Job job, Date timestamp, String code, Incident.Severity severity, Map<String, String> descriptionParameters, List<Tuple<String, throws IncidentServiceException, IllegalStateExceptionString>> details) Stores a new job incident.- Throws:
IllegalStateException- if no job related job existsIncidentServiceException- if there is a problem communicating with the underlying data store
-
getIncident
Gets a job incident by a given incident identifier.- Parameters:
id- the incident indentifier- Returns:
- the job incident
- Throws:
IncidentServiceException- if there is a problem communicating with the underlying data storeNotFoundException- if there is no job incident with this incident identifier
-
getIncidentsOfJob
IncidentTree getIncidentsOfJob(long jobId, boolean cascade) throws NotFoundException, IncidentServiceException Get the hierarchy of incidents for a given job identifier.- Parameters:
jobId- the job identifiercascade- if true, return the incidents of the given job and those of of its descendants; if false, just return the incidents of the given job, which means that the list returned byIncidentTree.getDescendants()will always be empty- Returns:
- the list of incidents
- Throws:
NotFoundException- if there is no incident with this job identifierIncidentServiceException- if there is a problem communicating with the underlying data store
-
getIncidentsOfJob
Get the directly related incidents of all given jobs and return them concatenated into a single list. No incidents of any descendants will be returned.- Parameters:
jobIds- the job identifiers- Returns:
- the concatenated list of directly related incidents
- Throws:
IncidentServiceException- if there is a problem communicating with the underlying data store
-
getLocalization
IncidentL10n getLocalization(long id, Locale locale) throws IncidentServiceException, NotFoundException Gets the localized texts for an incident by a given incident identifier and locale. If there are no localized texts of the given locale, the default localized texts are returned.- Parameters:
id- the incident identifierlocale- the locale- Returns:
- the incident localization
- Throws:
NotFoundException- if there is no job incident with this incident identifierIncidentServiceException- if there is a problem communicating with the underlying data store
-