Class WorkConnectionRoutes

java.lang.Object
io.aether.cloud.client.WorkConnectionRoutes
All Implemented Interfaces:
WorkConnectionRouter

public final class WorkConnectionRoutes extends Object implements WorkConnectionRouter
Immutable SID-based work routing table.

Maps an original work server SID to a customer-hosted proxy physical URI. The logical server descriptor used for crypto and identity is untouched.

Two explicit policies exist:

  • proxyOnly(Map) - every SID in the client cloud must have a route; unknown SIDs are rejected instead of silently falling back to direct connections;
  • withDirectFallback(Map) - unknown SIDs connect directly to their descriptor URI as in the non-proxied client.
  • Method Details

    • proxyOnly

      public static WorkConnectionRoutes proxyOnly(Map<Short,URI> routes)
      Proxy-only mode. Any SID not present in the map fails with a
      invalid reference
      ClientApiException
      instead of silently using a direct route.
    • withDirectFallback

      public static WorkConnectionRoutes withDirectFallback(Map<Short,URI> routes)
      Mixed mode. Unknown SIDs fall back to the original descriptor URI.
    • resolve

      public URI resolve(io.aether.api.common.ServerDescriptor server)
      Description copied from interface: WorkConnectionRouter
      Resolve the physical transport URI for the given logical server.
      Specified by:
      resolve in interface WorkConnectionRouter
      Parameters:
      server - logical server descriptor; never null
      Returns:
      physical URI to connect to, or null to fall back to the descriptor-provided URI
    • routes

      public Map<Short,URI> routes()
    • isProxyOnly

      public boolean isProxyOnly()