Class LinePorts
Every imperialqore/*-rest image listens on 8080 inside its
container; that is the image contract and does not change. What is allocated
here is the host port each service is published on by default, so
that two LINE services can run side by side. Mirrors
matlab/src/io/line_ports.m, line_solver.api.io.ports and
cpp/include/line/io/line_ports.h; the four tables must agree.
The block 29200-29229 is unassigned in the IANA registry, needs no root to bind, and sits below 32768, the floor of the Linux ephemeral range: RFC 6335 points unregistered services at 49152-65535, but that is where operating systems draw outbound source ports from, so a fixed listener there can lose its bind to an outgoing connection, intermittently and only under load.
Offsets are permanent: one is retired, never reused for another tool. Offset 0 is kept free for an aggregating gateway; offsets 5-15 are reserved for the wrapper packages that ship outside this tree.
Copyright (c) 2012-2026, Imperial College London All rights reserved.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intFirst host port of the reserved block.static final intLast host port of the reserved block.static final intPort every service image listens on inside its container.static final intimperialqore/jmt-rest.static final intimperialqore/ldes-rest.static final intHost port every service used before the allocation (the old documenteddocker run -p 8080:8080); consulted only as a fallback verified through/api/v1/info.static final StringDefaultoptions.config.remote_urlof SolverLQNS.static final intimperialqore/line-lqns-rest(lqns, lqsim and qnsolver share the image).static final intimperialqore/line-sage-rest. -
Method Summary
Modifier and TypeMethodDescriptionstatic intallocate(int offset) Host port for a given offset within the LINE block.static StringdefaultUrl(int port) Base URL a service published onportof localhost is reachable at.static booleanTrue when<baseUrl>/api/v1/healthanswers 2xx.static booleanisLqnsService(String baseUrl) True when/api/v1/infolists a tool namedlqns.static StringresolveLqnsUrl(String configured) URL the SolverLQNS remote path should post to, givenoptions.config.remote_url.
-
Field Details
-
BLOCK_FIRST
public static final int BLOCK_FIRSTFirst host port of the reserved block.- See Also:
-
BLOCK_LAST
public static final int BLOCK_LASTLast host port of the reserved block.- See Also:
-
CONTAINER_PORT
public static final int CONTAINER_PORTPort every service image listens on inside its container.- See Also:
-
LEGACY_PORT
public static final int LEGACY_PORTHost port every service used before the allocation (the old documenteddocker run -p 8080:8080); consulted only as a fallback verified through/api/v1/info.- See Also:
-
JMT_PORT
public static final int JMT_PORTimperialqore/jmt-rest. -
LQNS_PORT
public static final int LQNS_PORTimperialqore/line-lqns-rest(lqns, lqsim and qnsolver share the image). -
LDES_PORT
public static final int LDES_PORTimperialqore/ldes-rest. -
SAGE_PORT
public static final int SAGE_PORTimperialqore/line-sage-rest. -
LQNS_DEFAULT_URL
Defaultoptions.config.remote_urlof SolverLQNS.
-
-
Method Details
-
allocate
public static int allocate(int offset) Host port for a given offset within the LINE block.- Parameters:
offset- position in the block, 0-29- Returns:
- the absolute host port
- Throws:
IllegalArgumentException- if the offset falls outside the block
-
defaultUrl
Base URL a service published onportof localhost is reachable at.- Parameters:
port- host port- Returns:
http://localhost:<port>
-
resolveLqnsUrl
URL the SolverLQNS remote path should post to, givenoptions.config.remote_url.A URL other than the default is used exactly as given. The default is used when it answers; otherwise an lqns-rest still published on the legacy port 8080, verified through
/api/v1/info, is used with a warning telling the user to republish it. When neither answers the default is returned, so the request fails naming the URL the service is expected at.- Parameters:
configured-options.config.remote_url- Returns:
- the URL to use
-
isHealthy
True when<baseUrl>/api/v1/healthanswers 2xx.- Parameters:
baseUrl- service base URL- Returns:
- whether the service is up
-
isLqnsService
True when/api/v1/infolists a tool namedlqns. Identity is read, not assumed from the port: a line-sage-rest started by hand on 8080 answers/healthjust as an lqns-rest does.- Parameters:
baseUrl- service base URL- Returns:
- whether the service is lqns-rest
-