org.apache.ignite.internal.processors.localtask

## Class DurableBackgroundTaskState

- java.lang.Object
- - org.apache.ignite.internal.processors.localtask.DurableBackgroundTaskState

    public class DurableBackgroundTaskState
    extends Object

Class for storing the current state of a durable background task. Task execution state transitions: INIT -> PREPARE -> STARTED -> COMPLETED If the task needs to be restarted, it must have status INIT.

### Nested Class Summary

Nested Classes
`static class` `DurableBackgroundTaskState.State` Enumeration of the current state of the task.

### Constructor Summary

Constructors
Constructor and Description
`DurableBackgroundTaskState(DurableBackgroundTask task, @Nullable GridFutureAdapter<Void> outFut, boolean saved)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`@Nullable GridFutureAdapter<Void>` `outFuture()` Getting outside task future.
`boolean` `saved()` Check if the task has been saved to the MetaStorage.
`DurableBackgroundTaskState.State` `state()` Getting current state of the task.
`void` `state(DurableBackgroundTaskState.State s)` Set the current state of the task.
`boolean` `state(DurableBackgroundTaskState.State exp, DurableBackgroundTaskState.State newState)` Atomically sets of the current task state.
`DurableBackgroundTask` `task()` Getting durable background task.
`String` `toString()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### DurableBackgroundTaskState

    public DurableBackgroundTaskState(DurableBackgroundTask task,
                                      @Nullable
                                      @Nullable GridFutureAdapter<Void> outFut,
                                      boolean saved)

Constructor.

Parameters:
  `task` - Durable background task.
  `outFut` - Outside task future.
  `saved` - Task has been saved to the MetaStorage.

### Method Detail

#### task

    public DurableBackgroundTask task()

Getting durable background task.

Returns:
  Durable background task.

#### outFuture

    @Nullable
    public @Nullable GridFutureAdapter<Void> outFuture()

Getting outside task future.

Returns:
  Outside task future.

#### saved

    public boolean saved()

Check if the task has been saved to the MetaStorage.

Returns:
  `True` if stored in the MetaStorage.

#### state

    public DurableBackgroundTaskState.State state()

Getting current state of the task.

Returns:
  Current state of the task.

#### state

    public void state(DurableBackgroundTaskState.State s)

Set the current state of the task.

Parameters:
  `s` - New current state of the task.

#### state

    public boolean state(DurableBackgroundTaskState.State exp,
                         DurableBackgroundTaskState.State newState)

Atomically sets of the current task state.

Parameters:
  `exp` - Expected state.
  `newState` - New state.
Returns:
  `True` if successful.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.11.0
Release Date | : September 11 2021