Package io.gravitee.am.service.impl
Class AlertTriggerServiceImpl
java.lang.Object
io.gravitee.am.service.impl.AlertTriggerServiceImpl
- All Implemented Interfaces:
AlertTriggerService
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Constructor Summary
ConstructorsConstructorDescriptionAlertTriggerServiceImpl(AlertTriggerRepository alertTriggerRepository, AuditService auditService, EventService eventService) -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<AlertTrigger>createOrUpdate(ReferenceType referenceType, String referenceId, PatchAlertTrigger patchAlertTrigger, User byUser) Create or update an alert trigger.io.reactivex.rxjava3.core.Completabledelete(ReferenceType referenceType, String referenceId, String alertTriggerId, User byUser) Delete the alert trigger by its id and reference it belongs to.io.reactivex.rxjava3.core.Flowable<AlertTrigger>findByDomainAndCriteria(String domainId, AlertTriggerCriteria criteria) Find all alert triggers of a domain and matching the specified criteria.io.reactivex.rxjava3.core.Single<AlertTrigger>getById(ReferenceType referenceType, String referenceId, String id) Find the alert trigger corresponding to the specified id and its reference.io.reactivex.rxjava3.core.Single<AlertTrigger>Find the alert trigger corresponding to the specified id.
-
Constructor Details
-
AlertTriggerServiceImpl
public AlertTriggerServiceImpl(@Lazy AlertTriggerRepository alertTriggerRepository, AuditService auditService, EventService eventService)
-
-
Method Details
-
getById
Find the alert trigger corresponding to the specified id.- Specified by:
getByIdin interfaceAlertTriggerService- Parameters:
id- the alert trigger identifier.- Returns:
- the alert trigger found or an
AlertTriggerNotFoundExceptionif no alert trigger has been found.
-
getById
public io.reactivex.rxjava3.core.Single<AlertTrigger> getById(ReferenceType referenceType, String referenceId, String id) Find the alert trigger corresponding to the specified id and its reference.- Specified by:
getByIdin interfaceAlertTriggerService- Parameters:
referenceType- the reference type.referenceId- the reference id.id- the alert trigger identifier.- Returns:
- the alert trigger found or an
AlertTriggerNotFoundExceptionif no alert trigger has been found.
-
findByDomainAndCriteria
public io.reactivex.rxjava3.core.Flowable<AlertTrigger> findByDomainAndCriteria(String domainId, AlertTriggerCriteria criteria) Find all alert triggers of a domain and matching the specified criteria.- Specified by:
findByDomainAndCriteriain interfaceAlertTriggerService- Parameters:
domainId- the id of the domain the alert trigger is attached to.criteria- the criteria to match.- Returns:
- the alert triggers found or empty if none has been found.
-
createOrUpdate
public io.reactivex.rxjava3.core.Single<AlertTrigger> createOrUpdate(ReferenceType referenceType, String referenceId, PatchAlertTrigger patchAlertTrigger, User byUser) Create or update an alert trigger. Note: alert trigger are predefined. There is at most one trigger of each type for a given reference.- Specified by:
createOrUpdatein interfaceAlertTriggerService- Parameters:
referenceType- the reference type.referenceId- the reference id.patchAlertTrigger- the information on the alert trigger to create or update.byUser- the user at the origin of the update.- Returns:
- the created or updated alert trigger.
-
delete
public io.reactivex.rxjava3.core.Completable delete(ReferenceType referenceType, String referenceId, String alertTriggerId, User byUser) Delete the alert trigger by its id and reference it belongs to.- Specified by:
deletein interfaceAlertTriggerService- Parameters:
referenceType- the reference type.referenceId- the reference id.alertTriggerId- the alert trigger identifier.- Returns:
- nothing if the alert trigger has been successfully delete or an
AlertTriggerNotFoundExceptionexception if it has not been found.
-