Class AbstractChainableEvent

java.lang.Object
alpine.event.framework.AbstractChainableEvent
All Implemented Interfaces:
ChainableEvent, Event
Direct Known Subclasses:
SingletonCapableEvent

public abstract class AbstractChainableEvent extends Object implements ChainableEvent
Provides a default abstract implementation of an Event which supports an unbounded chain of callbacks that can be routed between different IEventService implementations.
Since:
1.2.0
Author:
Steve Springett
  • Constructor Details

    • AbstractChainableEvent

      public AbstractChainableEvent()
  • Method Details

    • getEventIdentifier

      public UUID getEventIdentifier()
      Returns the unique identifier for this event.
      Specified by:
      getEventIdentifier in interface ChainableEvent
      Returns:
      the unique identifier for this event
      Since:
      1.4.0
    • getChainIdentifier

      public UUID getChainIdentifier()
      Returns the unique identifier for the chain this event is a part of.
      Specified by:
      getChainIdentifier in interface ChainableEvent
      Returns:
      the unique identifier for the chain this event is a part of
      Since:
      1.4.0
    • setChainIdentifier

      public void setChainIdentifier(UUID chainIdentifier)
      Sets the unique identifier for the chain this event is a part of.
      Specified by:
      setChainIdentifier in interface ChainableEvent
      Parameters:
      chainIdentifier - the UUID of the chain
      Since:
      1.4.0
    • onSuccess

      public ChainLink[] onSuccess()
      Returns the optional callback event that should be processed if this event is successful.
      Specified by:
      onSuccess in interface ChainableEvent
      Returns:
      an Event
      Since:
      1.2.0
    • onFailure

      public ChainLink[] onFailure()
      Returns the optional callback event that should be processed if this event is not successful.
      Specified by:
      onFailure in interface ChainableEvent
      Returns:
      an Event
      Since:
      1.2.0
    • onSuccess

      public ChainableEvent onSuccess(Event onSuccessEvent)
      Fluent method that sets the onSuccess Event and returns this object.
      Specified by:
      onSuccess in interface ChainableEvent
      Parameters:
      onSuccessEvent - the event to publish if this event succeeds
      Returns:
      the current object
      Since:
      1.2.0
    • onSuccess

      public ChainableEvent onSuccess(Event onSuccessEvent, Class<? extends IEventService> onSuccessEventService)
      Fluent method that sets the onSuccess Event and returns this object.
      Specified by:
      onSuccess in interface ChainableEvent
      Parameters:
      onSuccessEvent - the event to publish if this event succeeds
      onSuccessEventService - the specific IEventService implementation to use
      Returns:
      the current object
      Since:
      1.2.0
    • onFailure

      public ChainableEvent onFailure(Event onFailureEvent)
      Fluent method that sets the onFailure Event and returns this object.
      Specified by:
      onFailure in interface ChainableEvent
      Parameters:
      onFailureEvent - the event to publish if this event fails
      Returns:
      the current object
      Since:
      1.2.0
    • onFailure

      public ChainableEvent onFailure(Event onFailureEvent, Class<? extends IEventService> onFailureEventService)
      Fluent method that sets the onFailure Event and returns this object.
      Specified by:
      onFailure in interface ChainableEvent
      Parameters:
      onFailureEvent - the event to publish if this event fails
      onFailureEventService - the specific IEventService implementation to use
      Returns:
      the current object
      Since:
      1.2.0