TriggerEventService

public interface TriggerEventService

Service responsible for retrieving, counting and validating triggers.

Methods

countDynamicTriggers

long countDynamicTriggers(String moduleName)

Returns the amount of dynamic triggers provided by the channel with the given moduleName.

Parameters:
  • moduleName – the name of the module
Returns:

the amount of dynamic triggers

countStaticTriggers

long countStaticTriggers(String moduleName)

Returns the amount of static triggers provided by the channel with the given moduleName.

Parameters:
  • moduleName – the name of the module
Returns:

the amount of static triggers

getDynamicTriggers

List<TriggerEvent> getDynamicTriggers(String moduleName, int page, int pageSize)

Returns a list of dynamic triggers currently provided by the channel with the given moduleName based on the given page and page size.

Parameters:
  • moduleName – the name of the channel module
  • page – the number of the page
  • pageSize – the size of the page
Returns:

list of dynamic triggers

getStaticTriggers

List<TriggerEvent> getStaticTriggers(String moduleName, int page, int pageSize)

Returns a list of static triggers currently provided by the channel with the given moduleName based on the given page and page size.

Parameters:
  • moduleName – the name of the channel module
  • page – the number of the page
  • pageSize – the size of the page
Returns:

list of static triggers

getTrigger

TriggerEvent getTrigger(TaskTriggerInformation triggerInformation)

Returns a trigger based on the information given in the triggerInformation.

Parameters:
  • triggerInformation – the information about a trigger
Returns:

the trigger it exists, null otherwise

providesDynamicTriggers

boolean providesDynamicTriggers(String moduleName)

Checks whether channel with the given moduleName provides dynamic triggers.

Parameters:
  • moduleName – the name of the module
Returns:

true if the channel provides dynamic triggers, false otherwise

triggerExists

boolean triggerExists(TaskTriggerInformation triggerInformation)

Checks whether trigger matching the given information exists.

Parameters:
  • triggerInformation – the information about a trigger
Returns:

true if matching trigger exists, false otherwise

validateTrigger

Set<TaskError> validateTrigger(TaskTriggerInformation triggerInformation)

Checks if the given trigger is valid by checking if related channel exists and if it provides a trigger matching the given triggerInformation.

Parameters:
  • triggerInformation – the information about a trigger
Returns:

list of error related with the trigger validation