Package org.apache.ignite.internal.processors.continuous

## Interface GridContinuousHandler

All Superinterfaces:
  `Cloneable`, `Externalizable`, `Serializable`

All Known Implementing Classes:
  `CacheContinuousQueryHandler`, `CacheContinuousQueryHandlerV2`, `CacheContinuousQueryHandlerV3`, `GridMessageListenHandler`

    public interface GridContinuousHandler
    extends Externalizable, Cloneable

Continuous routine handler.

### Nested Class Summary

Nested Classes
`static class` `GridContinuousHandler.RegisterStatus` Listener registration status.

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`String` `cacheName()`
`GridContinuousHandler` `clone()` Clones this handler.
`GridContinuousBatch` `createBatch()` Creates new batch.
`default void` `flushOnNodeLeft()` Node which started routine leave topology.
`boolean` `isEvents()`
`boolean` `isMessaging()`
`boolean` `isQuery()`
`boolean` `keepBinary()`
`void` `notifyCallback​(UUID nodeId, UUID routineId, Collection<?> objs, GridKernalContext ctx)` Notifies local callback.
`void` `onBatchAcknowledged​(UUID routineId, GridContinuousBatch batch, GridKernalContext ctx)` Called when ack for a batch is received from client.
`void` `onClientDisconnected()` Client node disconnected callback.
`@Nullable Object` `orderedTopic()`
`void` `p2pMarshal​(GridKernalContext ctx)` Deploys and marshals inner objects (called only if peer deployment is enabled).
`void` `p2pUnmarshal​(UUID nodeId, GridKernalContext ctx)` Unmarshals inner objects (called only if peer deployment is enabled).
`GridContinuousHandler.RegisterStatus` `register​(UUID nodeId, UUID routineId, GridKernalContext ctx)` Registers listener.
`void` `unregister​(UUID routineId, GridKernalContext ctx)` Unregisters listener.
`Map<Integer,​T2<Long,​Long>>` `updateCounters()`
`void` `updateCounters​(AffinityTopologyVersion topVer, Map<UUID,​Map<Integer,​T2<Long,​Long>>> cntrsPerNode, Map<Integer,​T2<Long,​Long>> cntrs)`

### Methods inherited from interface java.io.Externalizable

`readExternal, writeExternal`

### Method Detail

#### register

    GridContinuousHandler.RegisterStatus register​(UUID nodeId,
                                                  UUID routineId,
                                                  GridKernalContext ctx)
                                           throws IgniteCheckedException

Registers listener.

Parameters:
  `nodeId` - ID of the node that started routine.
  `routineId` - Routine ID.
  `ctx` - Kernal context.
Returns:
  Whether listener was actually registered.
Throws:
  `IgniteCheckedException` - In case of error.

#### unregister

    void unregister​(UUID routineId,
                    GridKernalContext ctx)

Unregisters listener.

Parameters:
  `routineId` - Routine ID.
  `ctx` - Kernal context.

#### notifyCallback

    void notifyCallback​(UUID nodeId,
                        UUID routineId,
                        Collection<?> objs,
                        GridKernalContext ctx)

Notifies local callback.

Parameters:
  `nodeId` - ID of the node where notification came from.
  `routineId` - Routine ID.
  `objs` - Notification objects.
  `ctx` - Kernal context.

#### p2pMarshal

    void p2pMarshal​(GridKernalContext ctx)
             throws IgniteCheckedException

Deploys and marshals inner objects (called only if peer deployment is enabled).

Parameters:
  `ctx` - Kernal context.
Throws:
  `IgniteCheckedException` - In case of error.

#### p2pUnmarshal

    void p2pUnmarshal​(UUID nodeId,
                      GridKernalContext ctx)
               throws IgniteCheckedException

Unmarshals inner objects (called only if peer deployment is enabled).

Parameters:
  `nodeId` - Sender node ID.
  `ctx` - Kernal context.
Throws:
  `IgniteCheckedException` - In case of error.

#### createBatch

    GridContinuousBatch createBatch()

Creates new batch.

Returns:
  New batch.

#### onClientDisconnected

    void onClientDisconnected()

Client node disconnected callback.

#### onBatchAcknowledged

    void onBatchAcknowledged​(UUID routineId,
                             GridContinuousBatch batch,
                             GridKernalContext ctx)

Called when ack for a batch is received from client.

Parameters:
  `routineId` - Routine ID.
  `batch` - Acknowledged batch.
  `ctx` - Kernal context.

#### flushOnNodeLeft

    default void flushOnNodeLeft()

Node which started routine leave topology.

#### orderedTopic

    @Nullable
    @Nullable Object orderedTopic()

Returns:
  Topic for ordered notifications. If `null`, notifications will be sent in non-ordered messages.

#### clone

    GridContinuousHandler clone()

Clones this handler.

Returns:
  Clone of this handler.

#### isEvents

    boolean isEvents()

Returns:
  `True` if for events.

#### isMessaging

    boolean isMessaging()

Returns:
  `True` if for messaging.

#### isQuery

    boolean isQuery()

Returns:
  `True` if for continuous queries.

#### keepBinary

    boolean keepBinary()

Returns:
  `True` if Ignite Binary objects should be passed to the listener and filter.

#### cacheName

    String cacheName()

Returns:
  Cache name if this is a continuous query handler.

#### updateCounters

    void updateCounters​(AffinityTopologyVersion topVer,
                        Map<UUID,​Map<Integer,​T2<Long,​Long>>> cntrsPerNode,
                        Map<Integer,​T2<Long,​Long>> cntrs)

Parameters:
  `cntrsPerNode` - Init state partition counters for node.
  `cntrs` - Init state for partition counters.
  `topVer` - Topology version.

#### updateCounters

    Map<Integer,​T2<Long,​Long>> updateCounters()

Returns:
  Init state for partition counters.