com.hazelcast.cp.session

## Interface CPSessionManagementService

-     public interface CPSessionManagementService

  The public API for managing CP sessions. CP sessions are used for tracking liveliness of Hazelcast servers and clients that hold CP resources.
  See Also:
    `CPSession`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `ICompletableFuture<Boolean>` | `forceCloseSession(String groupName, long sessionId)` If a Hazelcast instance that owns a CP session crashes, its CP session is not terminated immediately.
    `ICompletableFuture<Collection<CPSession>>` | `getAllSessions(String groupName)` Returns a non-null collection of CP sessions that are currently active in the given CP group.

- - ### Method Detail

    - #### getAllSessions

          ICompletableFuture<Collection<CPSession>> getAllSessions(String groupName)

      Returns a non-null collection of CP sessions that are currently active in the given CP group.

    - #### forceCloseSession

          ICompletableFuture<Boolean> forceCloseSession(String groupName,
                                                        long sessionId)

      If a Hazelcast instance that owns a CP session crashes, its CP session is not terminated immediately. Instead, the session is closed after `CPSubsystemConfig.getSessionTimeToLiveSeconds()` passes. If it is known for sure that the session owner is not partitioned and definitely crashed, this method can be used for closing the session and releasing its resources immediately.

Copyright © 2019. All rights reserved.