Interface ShardManager

All Known Implementing Classes:
AbstractShardManager, DefaultShardManager

public interface ShardManager
Manages the lifecycle of shards - starting, stopping, resuming, etc.
Since:
8/15/18.
Author:
amy
  • Method Details

    • shardCount

      @Nonnegative int shardCount()
      Returns:
      The number of shards this shard manager owns.
    • shardIds

      Collection<Integer> shardIds()
      Returns:
      The collection of shard ids owned by this shard manager instance.
    • start

      void start()
      Starts booting shards.
    • conditions

      List<ShardCondition> conditions()
      Returns:
      The shard conditions for this shard manager instance.
      See Also:
    • addCondition

      ShardManager addCondition(@Nonnull ShardCondition condition)
      Add a condition to this shard manager.
      Parameters:
      condition - The new condition.
      Returns:
      Itself.
    • addToConnectQueue

      void addToConnectQueue(@Nonnegative int shard)
      Adds the given shard id to the connect queue.
      Parameters:
      shard - The shard id to add.
    • shard

      @Nonnull CatnipShard shard(@Nonnegative int shard)
      Fetches a shard.
      Parameters:
      shard - The id of the shard to fetch.
      Returns:
      The shard, if it exists, otherwise it throws a NullPointerException.
    • catnip

      @Nonnull Catnip catnip()
      Returns:
      The catnip instance this shard manager is for.
    • catnip

      @Nonnull ShardManager catnip(@Nonnull Catnip catnip)
    • shutdown

      void shutdown()
      Shuts down all shards.