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.
      Returns:
        Affinity key, possibly `null`.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021