com.hazelcast.nio

## Interface NetworkingService<T extends Connection>

- All Known Implementing Classes:
    TcpIpNetworkingService

      @PrivateApi
      public interface NetworkingService<T extends Connection>

  Networking service, it initializes the endpoints, the acceptor and the reactive networking stack Given an `EndpointQualifier` an `EndpointManager` can be retrieved by `getEndpointManager(EndpointQualifier)` to create or get connections on that end.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `AggregateEndpointManager` | `getAggregateEndpointManager()` Return an aggregate endpoint which acts as a view of all endpoints merged together for reporting purposes eg.
    `EndpointManager<T>` | `getEndpointManager(EndpointQualifier qualifier)` Returns the relevant `EndpointManager` given an `EndpointQualifier` On single-endpoint setups (legacy mode), then a View relevant to the requested Endpoint is returned which purely acts as a facade to hide the API differences and maintain common signatures.
    `IOService` | `getIoService()` Returns the I/O Service
    `com.hazelcast.internal.networking.Networking` | `getNetworking()` Returns the Networking engine Shared across the multiple (or not) endpoints
    `boolean` | `isLive()` Flag indicating the liveness status of the Network
    `void` | `scheduleDeferred(Runnable task, long delay, TimeUnit unit)` Global scheduler for all Endpoints responsible of message retransmission
    `void` | `shutdown()` Shutdowns the service completely.
    `void` | `start()` Starts the service, initializes its endpoints, starts threads, etc.
    `void` | `stop()` Stops the service, releases its resources, stops threads, etc.

- - ### Method Detail

    - #### getIoService

          IOService getIoService()

      Returns the I/O Service

    - #### getNetworking

          com.hazelcast.internal.networking.Networking getNetworking()

      Returns the Networking engine Shared across the multiple (or not) endpoints

    - #### getAggregateEndpointManager

          AggregateEndpointManager getAggregateEndpointManager()

      Return an aggregate endpoint which acts as a view of all endpoints merged together for reporting purposes eg. Read total-connections

    - #### getEndpointManager

          EndpointManager<T> getEndpointManager(EndpointQualifier qualifier)

      Returns the relevant `EndpointManager` given an `EndpointQualifier` On single-endpoint setups (legacy mode), then a View relevant to the requested Endpoint is returned which purely acts as a facade to hide the API differences and maintain common signatures. eg. `ProtocolType.MEMBER` -> `MemberViewUnifiedEndpointManager` `ProtocolType.CLIENT` -> `ClientViewUnifiedEndpointManager` `com.hazelcast.instance.ProtocolType#TEXT` -> `TextViewUnifiedEndpointManager`

    - #### scheduleDeferred

          void scheduleDeferred(Runnable task,
                                long delay,
                                TimeUnit unit)

      Global scheduler for all Endpoints responsible of message retransmission

    - #### isLive

          boolean isLive()

      Flag indicating the liveness status of the Network

    - #### start

          void start()

      Starts the service, initializes its endpoints, starts threads, etc. After start, Endpoints becomes fully operational.

      If it is already started, then this method has no effect.

      Throws:
        `IllegalStateException` - if NetworkingService is shutdown

    - #### stop

          void stop()

      Stops the service, releases its resources, stops threads, etc. When stopped, Endpoints can be started again using `start()`.

      This method has no effect if it is already stopped or shutdown.

      Currently `stop` is called during the merge process to detach node from the current cluster. After node becomes ready to join to the new cluster, `start` is called to re-initialize the Endpoints.

    - #### shutdown

          void shutdown()

      Shutdowns the service completely. Endpoints and the networking engine will not be operational anymore and cannot be restarted.

      This method has no effect if it is already shutdown.

Copyright © 2020. All rights reserved.