Class AlertTriggerServiceImpl

java.lang.Object
io.gravitee.am.service.impl.AlertTriggerServiceImpl
All Implemented Interfaces:
AlertTriggerService

@Component public class AlertTriggerServiceImpl extends Object implements AlertTriggerService
Author:
Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
  • Constructor Details

  • Method Details

    • getById

      public io.reactivex.rxjava3.core.Single<AlertTrigger> getById(String id)
      Find the alert trigger corresponding to the specified id.
      Specified by:
      getById in interface AlertTriggerService
      Parameters:
      id - the alert trigger identifier.
      Returns:
      the alert trigger found or an AlertTriggerNotFoundException if 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:
      getById in interface AlertTriggerService
      Parameters:
      referenceType - the reference type.
      referenceId - the reference id.
      id - the alert trigger identifier.
      Returns:
      the alert trigger found or an AlertTriggerNotFoundException if 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:
      findByDomainAndCriteria in interface AlertTriggerService
      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:
      createOrUpdate in interface AlertTriggerService
      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:
      delete in interface AlertTriggerService
      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 AlertTriggerNotFoundException exception if it has not been found.