Interface ResourceEvent<T extends Serializable>

    • Method Detail

      • getType

        ResourceEvent.Type getType()
        Gets the type of the event. The type of the event carries the cause: a creation, an update, a removing or a deletion of the related resource. It defines then the state in the life-cycle of the resource.
        Returns:
        the type of the event (creation, update, deletion, ...)
      • getTransition

        StateTransition<T> getTransition()
        Gets the state transition implying by a change on the resource. The transition carries two instances of the resource: the resource before the change at the origin of this event, the the resource after the change has occurred. According to the type of the event, one of the state can be null or the two instances can be identical:
        • for a creation, the instance before the transition is null whereas the instance after the transition is the created resource,
        • for an update, the instance before the transition is the resource before the update whereas the instance after the transition is the resource after the update,
        • for a removing, the two instances are identical (as the resource is existent and recoverable),
        • for a deletion, the instance before the transition is the resource whereas the instance after the deletion is null.
        Returns:
        a state transition with two instances of the resource related by this event: one being the resource before the change, the second being the resource after the change.
      • isOnCreation

        default boolean isOnCreation()
        Is the event on the creation of a resource?
        Returns:
        true if the event is about a resource creation. False otherwise.
      • isOnUpdate

        default boolean isOnUpdate()
        Is the event on the update of a resource?
        Returns:
        true if the event is about a resource update. False otherwise.
      • isOnRemoving

        default boolean isOnRemoving()
        Is the event on the removing of a resource?
        Returns:
        true if the event is about a resource removing. False otherwise.
      • isOnDeletion

        default boolean isOnDeletion()
        Is the event on the deletion of a resource?
        Returns:
        true if the event is about a resource deletion. False otherwise.
      • isOnRecovery

        default boolean isOnRecovery()
        Is the event on the recovery of a removed resource?
        Returns:
        true if the event is about a resource recovery. False otherwise.