org.apache.ignite.internal.processors.service

## Class ServiceContextImpl

- java.lang.Object
- - org.apache.ignite.internal.processors.service.ServiceContextImpl

All Implemented Interfaces:
  Serializable, ServiceContext

    public class ServiceContextImpl
    extends Object
    implements ServiceContext

Service context implementation.

See Also:
  Serialized Form

### Method Summary

All Methods Instance Methods Concrete Methods
`<K> K` `affinityKey()` Gets affinity key used for key-to-node affinity calculation.
`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.
`void` `setCancelled(boolean isCancelled)`
`String` `toString()`

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

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

### Method Detail

#### name

    public String name()

Gets service name.

Specified by:
  `name` in interface `ServiceContext`
Returns:
  Service name.

#### executionId

    public UUID executionId()

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

Specified by:
  `executionId` in interface `ServiceContext`
Returns:
  Service execution ID.

#### isCancelled

    public boolean isCancelled()

Get flag indicating whether service has been cancelled or not.

Specified by:
  `isCancelled` in interface `ServiceContext`
Returns:
  Flag indicating whether service has been cancelled or not.

#### cacheName

    @Nullable
    public 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.

Specified by:
  `cacheName` in interface `ServiceContext`
Returns:
  Cache name, possibly `null`.

#### affinityKey

    @Nullable
    public <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.

Specified by:
  `affinityKey` in interface `ServiceContext`
Returns:
  Affinity key, possibly `null`.

#### setCancelled

    public void setCancelled(boolean isCancelled)

Parameters:
  `isCancelled` - Cancelled flag.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2018 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 2.6.0
Release Date | : July 10 2018