Package io.gravitee.am.service.impl
Class AlertNotifierServiceImpl
java.lang.Object
io.gravitee.am.service.impl.AlertNotifierServiceImpl
- All Implemented Interfaces:
AlertNotifierService
@Component
@Primary
public class AlertNotifierServiceImpl
extends Object
implements AlertNotifierService
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Constructor Summary
ConstructorsConstructorDescriptionAlertNotifierServiceImpl(AlertNotifierRepository alertNotifierRepository, AuditService auditService, EventService eventService, NotifierValidator notifierValidator) -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Single<AlertNotifier>create(ReferenceType referenceType, String referenceId, NewAlertNotifier newAlertNotifier, User byUser) Create a new alert notifier.io.reactivex.rxjava3.core.Completabledelete(ReferenceType referenceType, String referenceId, String notifierId, User byUser) Delete the alert notifier by its id and reference it belongs to.io.reactivex.rxjava3.core.Flowable<AlertNotifier>findByDomainAndCriteria(String domainId, AlertNotifierCriteria criteria) Find all the alert notifiers of a domain corresponding to the specified criteria.io.reactivex.rxjava3.core.Flowable<AlertNotifier>findByReferenceAndCriteria(ReferenceType referenceType, String referenceId, AlertNotifierCriteria criteria) Find all the alert notifiers by reference (ex: domain) corresponding to the specified criteria.io.reactivex.rxjava3.core.Single<AlertNotifier>getById(ReferenceType referenceType, String referenceId, String notifierId) Get the alert notifier by its id and reference it belongs to.io.reactivex.rxjava3.core.Single<AlertNotifier>update(ReferenceType referenceType, String referenceId, String alertNotifierId, PatchAlertNotifier patchAlertNotifier, User byUser) Update an existing alert notifier.
-
Constructor Details
-
AlertNotifierServiceImpl
public AlertNotifierServiceImpl(@Lazy AlertNotifierRepository alertNotifierRepository, AuditService auditService, EventService eventService, NotifierValidator notifierValidator)
-
-
Method Details
-
getById
public io.reactivex.rxjava3.core.Single<AlertNotifier> getById(ReferenceType referenceType, String referenceId, String notifierId) Get the alert notifier by its id and reference it belongs to.- Specified by:
getByIdin interfaceAlertNotifierService- Parameters:
referenceType- the reference type.referenceId- the reference id.notifierId- the notifier identifier.- Returns:
- the alert notifier found or an
AlertNotifierNotFoundExceptionexception if it has not been found.
-
findByDomainAndCriteria
public io.reactivex.rxjava3.core.Flowable<AlertNotifier> findByDomainAndCriteria(String domainId, AlertNotifierCriteria criteria) Find all the alert notifiers of a domain corresponding to the specified criteria.- Specified by:
findByDomainAndCriteriain interfaceAlertNotifierService- Parameters:
domainId- the domain the alert notifiers are attached to.criteria- the criteria to match.- Returns:
- the list of alert notifiers found.
-
findByReferenceAndCriteria
public io.reactivex.rxjava3.core.Flowable<AlertNotifier> findByReferenceAndCriteria(ReferenceType referenceType, String referenceId, AlertNotifierCriteria criteria) Find all the alert notifiers by reference (ex: domain) corresponding to the specified criteria.- Specified by:
findByReferenceAndCriteriain interfaceAlertNotifierService- Parameters:
referenceType- the reference type.referenceId- the reference id.criteria- the criteria to match.- Returns:
- the list of alert notifiers found.
-
create
public io.reactivex.rxjava3.core.Single<AlertNotifier> create(ReferenceType referenceType, String referenceId, NewAlertNotifier newAlertNotifier, User byUser) Create a new alert notifier.- Specified by:
createin interfaceAlertNotifierService- Parameters:
referenceType- the reference type the newly created alert notifier will be attached to.referenceId- the reference id the newly created alert notifier will be attached to.newAlertNotifier- the information about the alert notifier to create.byUser- the user at the origin of the creation.- Returns:
- the newly created alert notifier.
-
update
public io.reactivex.rxjava3.core.Single<AlertNotifier> update(ReferenceType referenceType, String referenceId, String alertNotifierId, PatchAlertNotifier patchAlertNotifier, User byUser) Update an existing alert notifier.- Specified by:
updatein interfaceAlertNotifierService- Parameters:
referenceType- the reference type the newly created alert notifier will be attached to.referenceId- the reference id the newly created alert notifier will be attached to.patchAlertNotifier- the information about the alert notifier to update.byUser- the user at the origin of the update.- Returns:
- the updated alert notifier or a
AlertNotifierNotFoundExceptionif the notifier has not been found.
-
delete
public io.reactivex.rxjava3.core.Completable delete(ReferenceType referenceType, String referenceId, String notifierId, User byUser) Delete the alert notifier by its id and reference it belongs to.- Specified by:
deletein interfaceAlertNotifierService- Parameters:
referenceType- the reference type.referenceId- the reference id.notifierId- the notifier identifier.- Returns:
- nothing if the alert notifier has been successfully delete or an
AlertNotifierNotFoundExceptionexception if it has not been found.
-