com.hazelcast.util.scheduler

## Interface EntryTaskScheduler<K,V>

- Type Parameters:
    `K` - key type of related entries
    `V` - value type of related entries
  All Known Implementing Classes:
    SecondsBasedEntryTaskScheduler

      public interface EntryTaskScheduler<K,V>

  Schedules (or reschedules) the execution of given entry.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ScheduledEntry<K,V>` | `cancel(K key)` Cancel all scheduled executions with the given key.
    `void` | `cancelAll()` Cancel all scheduled executions
    `int` | `cancelIfExists(K key, V value)` Cancels the scheduled executions for the given key and value if present.
    `ScheduledEntry<K,V>` | `get(K key)` Return the entry for the scheduled key.
    `boolean` | `schedule(long delayMillis, K key, V object)` Schedules (or reschedules) the execution of given entry.

- - ### Method Detail

    - #### schedule

          boolean schedule(long delayMillis,
                           K key,
                           V object)

      Schedules (or reschedules) the execution of given entry. Key parameter is used to check whether there is an existing scheduling for this entry, see `ScheduleType` for possible behaviours in such case.
      Parameters:
        `delayMillis` - milliseconds to delay the execution.
        `key` - key of this scheduling.
        `object` - user object to pass back when it is time to execute.
      Returns:
        returns true if this call resulted in a new scheduling, false otherwise.

    - #### cancel

          ScheduledEntry<K,V> cancel(K key)

      Cancel all scheduled executions with the given key.
      Parameters:
        `key` - the scheduled key
      Returns:
        the cancelled scheduled execution, in case of `ScheduleType.FOR_EACH` a random one will be returned, or `null` if nothing was scheduled or everything already executed for this key

    - #### cancelIfExists

          int cancelIfExists(K key,
                             V value)

      Cancels the scheduled executions for the given key and value if present. The method returns the number of cancelled scheduled entries.
      Parameters:
        `key` - the scheduled key
        `value` - the scheduled value
      Returns:
        the number of cancelled scheduled entries.

    - #### get

          ScheduledEntry<K,V> get(K key)

      Return the entry for the scheduled key.
      Parameters:
        `key` - the scheduled key
      Returns:
        the scheduled execution, in case of `ScheduleType.FOR_EACH` a random one will be returned, or `null` if nothing was scheduled or everything already executed for this key

    - #### cancelAll

          void cancelAll()

      Cancel all scheduled executions

Copyright © 2019. All rights reserved.