Class TaskExecutionResult


  • public final class TaskExecutionResult
    extends java.lang.Object
    The action, which should be performed after the task processing.
    Since:
    09.07.2017
    • Method Detail

      • getActionType

        @Nonnull
        public TaskExecutionResult.Type getActionType()
        Get action, which should be performed after the task processing.
        Returns:
        action, which should be performed after the task processing.
      • getExecutionDelay

        @Nonnull
        public java.util.Optional<java.time.Duration> getExecutionDelay()
        Get task execution delay.
        Returns:
        task execution delay.
      • getExecutionDelayOrThrow

        @Nonnull
        public java.time.Duration getExecutionDelayOrThrow()
        Get task execution delay or throw an IllegalStateException when task execution delay is not present.
        Returns:
        task execution delay.
        Throws:
        java.lang.IllegalStateException - An exception when task execution delay is not present.
      • reenqueue

        @Nonnull
        public static TaskExecutionResult reenqueue​(@Nonnull
                                                    java.time.Duration delay)
        Instruction to re-enqueue the task with determined execution delay.
        Re-enqueue attempts counter will be reset, task will be executed again after the given execution delay.
        Parameters:
        delay - determined execution delay, after which the task will be executed again.
        Returns:
        Task execution action.
      • reenqueue

        @Nonnull
        public static TaskExecutionResult reenqueue()
        Instruction to re-enqueue the task using the re-enqueue strategy established in the queue configuration. Re-enqueue attempts counter will be reset.
        Returns:
        Task execution action.
      • fail

        @Nonnull
        public static TaskExecutionResult fail()
        Instruction to execute the task again later according to the re-enqueue strategy established in the queue configuration.
        Returns:
        Task execution action.
      • finish

        @Nonnull
        public static TaskExecutionResult finish()
        Instruction to finish task processing and remove the task from the queue
        Returns:
        Task execution action.
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object