Class AbstractIncidentService
java.lang.Object
org.opencastproject.serviceregistry.impl.AbstractIncidentService
- All Implemented Interfaces:
IncidentService
- Direct Known Subclasses:
OsgiIncidentService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from interface org.opencastproject.serviceregistry.api.IncidentService
JOB_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a list of localization database keys from a base key and a locale split into its part, e.g.protected abstract DBSessiongetIncident(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.protected abstract ServiceRegistryprotected abstract WorkflowServicelocaleToList(Locale locale) Convert a locale into a list of strings, [language, country, variant]static StringreplaceVars(String template, Map<String, String> params) Replace variables of the form #{xxx} in a string template.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
-
PERSISTENCE_UNIT_NAME
- See Also:
-
NO_TITLE
- See Also:
-
NO_DESCRIPTION
- See Also:
-
FIELD_TITLE
- See Also:
-
FIELD_DESCRIPTION
- See Also:
-
-
Constructor Details
-
AbstractIncidentService
public AbstractIncidentService()
-
-
Method Details
-
getServiceRegistry
-
getWorkflowService
-
getDBSession
-
storeIncident
public Incident storeIncident(Job job, Date timestamp, String code, Incident.Severity severity, Map<String, String> descriptionParameters, List<Tuple<String, throws IncidentServiceException, IllegalStateExceptionString>> details) Description copied from interface:IncidentServiceStores a new job incident.- Specified by:
storeIncidentin interfaceIncidentService- Throws:
IncidentServiceException- if there is a problem communicating with the underlying data storeIllegalStateException- if no job related job exists
-
getIncident
Description copied from interface:IncidentServiceGets a job incident by a given incident identifier.- Specified by:
getIncidentin interfaceIncidentService- 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
Description copied from interface:IncidentServiceGet the directly related incidents of all given jobs and return them concatenated into a single list. No incidents of any descendants will be returned.- Specified by:
getIncidentsOfJobin interfaceIncidentService- 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
-
getIncidentsOfJob
public IncidentTree getIncidentsOfJob(long jobId, boolean cascade) throws NotFoundException, IncidentServiceException Description copied from interface:IncidentServiceGet the hierarchy of incidents for a given job identifier.- Specified by:
getIncidentsOfJobin interfaceIncidentService- 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
-
getLocalization
public IncidentL10n getLocalization(long id, Locale locale) throws IncidentServiceException, NotFoundException Description copied from interface:IncidentServiceGets 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.- Specified by:
getLocalizationin interfaceIncidentService- Parameters:
id- the incident identifierlocale- the locale- Returns:
- the incident localization
- Throws:
IncidentServiceException- if there is a problem communicating with the underlying data storeNotFoundException- if there is no job incident with this incident identifier
-
genDbKeys
Create a list of localization database keys from a base key and a locale split into its part, e.g. ["de", "DE"] or ["en"]. The returned list starts with the most specific key getting more common, e.g. ["org.opencastproject.composer.1.title.de.DE", "org.opencastproject.composer.1.title.de", "org.opencastproject.composer.1.title"] -
localeToList
Convert a locale into a list of strings, [language, country, variant] -
replaceVars
Replace variables of the form #{xxx} in a string template.
-