Package org.apache.ignite.services

## Interface ServiceContext

All Superinterfaces:
  `Serializable`

All Known Implementing Classes:
  `ServiceContextImpl`

    public interface ServiceContext
    extends Serializable

Service execution context. This context is provided using `ServiceContextResource` annotation and contains information about specific service execution.

See Also:
  `ServiceContextResource`

### Method Summary

All Methods Instance Methods Abstract Methods
`<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.
`@Nullable ServiceCallContext` `currentCallContext()` Gets context of the current service call.
`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`.

#### currentCallContext

    @Nullable
    @Nullable ServiceCallContext currentCallContext()

Gets context of the current service call.

Returns:
  Context of the current service call, possibly `null`.
See Also:
  `ServiceCallContext`