Class ControllerSession

java.lang.Object
be.theking90000.mumble.controller.spaces.ControllerSession

public final class ControllerSession extends Object
Typed Spaces facade over the profile-neutral CoreSession.

This class owns only Spaces payload encoding, explicit observations, and the decoded space cache. The delegated Core session owns transport lifecycle, leases, reconciliation, reliable requests, participant ownership, revisions, and reconnection.

  • Method Details

    • builder

      public static ControllerSession.Builder builder(be.theking90000.mumble.controller.core.ControllerId controllerId, URI endpoint)
      Creates a Spaces session builder.
      Parameters:
      controllerId - stable declarative controller identity
      endpoint - Controller service URI
      Returns:
      new builder
    • controllerId

      public be.theking90000.mumble.controller.core.ControllerId controllerId()
      Returns:
      declarative controller identity
    • state

      public be.theking90000.mumble.controller.core.ControllerSessionState state()
      Returns:
      current session lifecycle state
    • start

      public CompletableFuture<Void> start()
      Returns:
      future completed after opening reconciliation
    • registerParticipant

      public ParticipantHandle registerParticipant(be.theking90000.mumble.controller.core.ParticipantId participantId, ParticipantSpec spec)
      Registers a participant with a complete Spaces specification.
      Parameters:
      participantId - stable participant identity
      spec - complete desired Spaces state
      Returns:
      typed participant handle
    • participant

      public Optional<ParticipantHandle> participant(be.theking90000.mumble.controller.core.ParticipantId participantId)
      Looks up a current desired participant.
      Parameters:
      participantId - identity to find
      Returns:
      typed handle, or empty after release or revocation
    • participants

      public Map<be.theking90000.mumble.controller.core.ParticipantId,ParticipantHandle> participants()
      Returns:
      immutable point-in-time map of desired typed participants
    • observeSpace

      public CompletableFuture<Void> observeSpace(SpaceKey spaceKey)
      Adds a space to the complete explicit observation set.
      Parameters:
      spaceKey - semantic key to observe
      Returns:
      future completed when the change is accepted
    • unobserveSpace

      public CompletableFuture<Void> unobserveSpace(SpaceKey spaceKey)
      Removes a space from the explicit observation set.
      Parameters:
      spaceKey - semantic key to stop observing
      Returns:
      future completed when the change is accepted
    • explicitlyObservedSpaces

      public Set<SpaceKey> explicitlyObservedSpaces()
      Returns:
      immutable point-in-time copy of explicit observation keys
    • spaces

      public Map<SpaceKey,SpaceSnapshot> spaces()
      Returns:
      immutable point-in-time copy of the latest decoded space cache
    • fetchSpace

      public CompletableFuture<SpaceSnapshot> fetchSpace(SpaceKey spaceKey)
      Fetches one full snapshot without changing the observation set.
      Parameters:
      spaceKey - semantic key to fetch
      Returns:
      future completed with the one-shot snapshot
    • stop

      public CompletableFuture<Void> stop()
      Returns:
      future completed when the delegated Core session is locally closed
    • addSessionListener

      public void addSessionListener(ControllerSessionListener listener)
      Adds a listener for subsequent session transitions.
      Parameters:
      listener - listener to add
    • removeSessionListener

      public void removeSessionListener(ControllerSessionListener listener)
      Removes a session listener; a missing listener is ignored.
      Parameters:
      listener - listener to remove
    • addSpaceListener

      public void addSpaceListener(SpaceListener listener)
      Adds a listener for subsequent full space replacements and closures.
      Parameters:
      listener - listener to add
    • removeSpaceListener

      public void removeSpaceListener(SpaceListener listener)
      Removes a space listener; a missing listener is ignored.
      Parameters:
      listener - listener to remove