com.google.cloud.dataflow.sdk.transforms.windowing

## Class Trigger.TriggerContext

- java.lang.Object
- - com.google.cloud.dataflow.sdk.transforms.windowing.Trigger.TriggerContext

Direct Known Subclasses:
  Trigger.OnElementContext, Trigger.OnMergeContext

Enclosing class:
  Trigger<W extends BoundedWindow>

    public abstract class Trigger.TriggerContext
    extends Object

Information accessible to all operational hooks in this `Trigger`.

Used directly in `Trigger.shouldFire(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)` and `Trigger.clear(com.google.cloud.dataflow.sdk.transforms.windowing.Trigger<W>.TriggerContext)`, and extended with additional information in other methods.

### Constructor Summary

Constructors
Constructor and Description
`TriggerContext()`

### Method Summary

All Methods Instance Methods Abstract Methods
`abstract Instant` `currentEventTime()` The current event time for the input or `null` if unknown.
`abstract Instant` `currentProcessingTime()` The current processing time.
`abstract Instant` `currentSynchronizedProcessingTime()` The current synchronized upstream processing time or `null` if unknown.
`abstract void` `deleteTimer(Instant timestamp, com.google.cloud.dataflow.sdk.util.TimeDomain domain)` Removes the timer set in this trigger context for the given `Instant` and `TimeDomain`.
`abstract Trigger.TriggerContext` `forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)` Create a sub-context for the given sub-trigger.
`abstract com.google.cloud.dataflow.sdk.util.state.StateAccessor<?>` `state()` Returns the interface for accessing persistent state.
`abstract Trigger.TriggerInfo<W>` `trigger()` Returns the interface for accessing trigger info.
`abstract W` `window()` The window that the current context is executing in.

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

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

### Constructor Detail

#### TriggerContext

    public TriggerContext()

### Method Detail

#### trigger

    public abstract Trigger.TriggerInfo<W> trigger()

Returns the interface for accessing trigger info.

#### state

    public abstract com.google.cloud.dataflow.sdk.util.state.StateAccessor<?> state()

Returns the interface for accessing persistent state.

#### window

    public abstract W window()

The window that the current context is executing in.

#### forTrigger

    public abstract Trigger.TriggerContext forTrigger(com.google.cloud.dataflow.sdk.util.ExecutableTrigger<W> trigger)

Create a sub-context for the given sub-trigger.

#### deleteTimer

    public abstract void deleteTimer(Instant timestamp,
                                     com.google.cloud.dataflow.sdk.util.TimeDomain domain)

Removes the timer set in this trigger context for the given `Instant` and `TimeDomain`.

#### currentProcessingTime

    public abstract Instant currentProcessingTime()

The current processing time.

#### currentSynchronizedProcessingTime

    @Nullable
    public abstract Instant currentSynchronizedProcessingTime()

The current synchronized upstream processing time or `null` if unknown.

#### currentEventTime

    @Nullable
    public abstract Instant currentEventTime()

The current event time for the input or `null` if unknown.