org.apache.ignite.services

## Interface ServiceContext

- All Superinterfaces:
    Serializable

      public interface ServiceContext
      extends Serializable

  Service execution context. Execution context is provided into `Service.execute(ServiceContext)` and `Service.cancel(ServiceContext)` methods and contains information about specific service execution.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `<K> K` | `affinityKey()` Gets affinity key used for key-to-node affinity calculation.
    `@Nullable String` | `cacheName()` Gets cache name used for key-to-node affinity calculation.
    `UUID` | `executionId()` Gets service execution ID.
    `boolean` | `isCancelled()` Get flag indicating whether service has been cancelled or not.
    `String` | `name()` Gets service name.

- - ### Method Detail

    - #### name

          String name()

      Gets service name.
      Returns:
        Service name.

    - #### executionId

          UUID executionId()

      Gets service execution ID. Execution ID is guaranteed to be unique across all service deployments.
      Returns:
        Service execution ID.

    - #### isCancelled

          boolean isCancelled()

      Get flag indicating whether service has been cancelled or not.
      Returns:
        Flag indicating whether service has been cancelled or not.

    - #### cacheName

          @Nullable
          @Nullable String cacheName()

      Gets cache name used for key-to-node affinity calculation. This parameter is optional and is set only when key-affinity service was deployed.
      Returns:
        Cache name, possibly `null`.

    - #### affinityKey

          @Nullable
          <K> K affinityKey()

      Gets affinity key used for key-to-node affinity calculation. This parameter is optional and is set only when key-affinity service was deployed.
      Type Parameters:
        `K` - Affinity key type.
      Returns:
        Affinity key, possibly `null`.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022