Class CommunicationKit

java.lang.Object
com.iohao.net.framework.communication.CommunicationKit

public final class CommunicationKit extends Object
Utility class providing static access to the global communication infrastructure.

Holds the singleton CommunicationAggregation and Communication instances, and offers convenience methods for common cross-server operations such as forced user offline and user existence checks.

Since:
25.1
Author:
渔民小镇
date:
2025-09-28
  • Method Details

    • setCommunicationAggregation

      public static void setCommunicationAggregation(CommunicationAggregation communicationAggregation)
      Set the global communication aggregation and initialize the communication instance.
      Parameters:
      communicationAggregation - the aggregation implementation to use
    • forcedOffline

      public static void forcedOffline(long userId)
      Force a user offline by broadcasting a forced-offline request to all external servers.
      Parameters:
      userId - the ID of the user to disconnect
    • existUser

      public static boolean existUser(long userId)
      Check whether a user is currently connected to any external server.
      Parameters:
      userId - the ID of the user to check
      Returns:
      true if the user exists on at least one external server
    • getCommunicationAggregation

      public static CommunicationAggregation getCommunicationAggregation()
    • getCommunication

      public static Communication getCommunication()
    • setCommunicationSupplier

      public static void setCommunicationSupplier(Supplier<Communication> communicationSupplier)