Class Preference
java.lang.Object
org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer
com.iizigo.webserver.Preference
Class used to initialize default preference values.
- Author:
- Christopher Mindus
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanWhether the Designer's editor endpoints - the external-browser Designer page,?panel=, the Panel Editor's WebSocket - answer a client on another computer (EB-3, ruled 2026-10-13: default off).The bind address.intString caching.intString caching.intString caching.static final intThe default length of the port ranges, ten ports: 2800-2809 and 4800-4809.The domain name.booleanTracing.External web server URL, including protocol and potential port number.The PKCS#12 KeyStore file name.The password to use for the KeyStore.static final StringSystem property overriding the bind address for this JVM only, never saved, e.g.static final StringSystem property overriding the HTTP port for this JVM only, never saved:0lets the operating system pick a free port (P-D-1/P-D-2 of CC-SURVEY-PORT-2800).static final StringSystem property overriding the HTTPS port for this JVM only, never saved:-1for no HTTPS,0for a free port the operating system picks.booleanToS accepted.The ToS URI.booleanFlag to use Gzip compression.intThe first port of the HTTP port range (the keywsPort, which held the single port until CC-FIX-PORT-RANGE-A: a workspace that stored a port keeps it as the start of its range).intThe last port of the HTTP port range.intThe offset in the port ranges this workspace bound last, -1 for none: tried first at the next start (R-D-4, sticky per workspace).intThe first port of the HTTPS port range (the keywsSecurePort).intThe last port of the HTTPS port range.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionCreates the port configurations from the preferences, at the start of the ranges (or the override).createPortConfigs(int offset) Creates the port configurations of one offset of the port ranges: HTTPwsPort+offsetand HTTPSwsSecurePort+offset.Gets the bind address in effect: the override, else the preference.static PreferenceGets the instance.intGets the number of offsets of the port ranges: HTTP and HTTPS move together, so the shorter range bounds them (R-D-2).Gets the ID of this workspace, created and saved on first use: the key of its port claim and of its entry in the registry of live iiziGo (CC-FIX-PORT-RANGE-A).voidInitializes the preferences store for all the terminal preferences.static booleanTells whether the bind address is overridden for this JVM (PROP_BIND).static booleanTells whether the HTTP port is overridden for this JVM (PROP_PORT): the port range is then not used.voidrememberOffset(int offset) Remembers the offset this workspace bound, tried first at its next start (R-D-4); -1 forgets it.voidSaves a "page" to the store.
Field Details
PROP_PORT
System property overriding the HTTP port for this JVM only, never saved:0lets the operating system pick a free port (P-D-1/P-D-2 of CC-SURVEY-PORT-2800). Set, it bypasses the port range entirely - no sticky port, no claim (CC-FIX-PORT-RANGE-A). The UI harness ofcom.iizigo.term.testssets it to 0.- See Also:
PROP_SECURE_PORT
PROP_BIND
System property overriding the bind address for this JVM only, never saved, e.g.127.0.0.1.- See Also:
DEFAULT_RANGE
public static final int DEFAULT_RANGEThe default length of the port ranges, ten ports: 2800-2809 and 4800-4809.- See Also:
extServerURL
External web server URL, including protocol and potential port number.This setting must be set if the retrieval of the local host name e.g. does not include the domain DNS suffix, or that the name is known on external nets differently than on the internal network. This host name is typically used for the OAuth 2.0 authentication callback URL's.
bindAddress
The bind address.wsPort
public int wsPortThe first port of the HTTP port range (the keywsPort, which held the single port until CC-FIX-PORT-RANGE-A: a workspace that stored a port keeps it as the start of its range).wsPortEnd
public int wsPortEndThe last port of the HTTP port range.wsSecurePort
public int wsSecurePortThe first port of the HTTPS port range (the keywsSecurePort).wsSecurePortEnd
public int wsSecurePortEndThe last port of the HTTPS port range.wsPortOffsetLast
public int wsPortOffsetLastThe offset in the port ranges this workspace bound last, -1 for none: tried first at the next start (R-D-4, sticky per workspace).allowRemoteDesigner
public boolean allowRemoteDesignerWhether the Designer's editor endpoints - the external-browser Designer page,?panel=, the Panel Editor's WebSocket - answer a client on another computer (EB-3, ruled 2026-10-13: default off).useGzip
public boolean useGzipFlag to use Gzip compression.cacheCount
public int cacheCountString caching.cacheMin
public int cacheMinString caching.cacheMax
public int cacheMaxString caching.doVerboseTrace
public boolean doVerboseTraceTracing.keyStore
The PKCS#12 KeyStore file name.password
The password to use for the KeyStore.tosURI
The ToS URI.tosAccepted
public boolean tosAcceptedToS accepted.domainName
The domain name.
Constructor Details
Preference
public Preference()Construction of the class.
Method Details
getInstance
Gets the instance.- Returns:
- The single instance of the preferences.
isPortOverridden
public static boolean isPortOverridden()Tells whether the HTTP port is overridden for this JVM (PROP_PORT): the port range is then not used.- Returns:
truewhen-Dcom.iizigo.webserver.portis set.
isBindOverridden
public static boolean isBindOverridden()Tells whether the bind address is overridden for this JVM (PROP_BIND).- Returns:
truewhen-Dcom.iizigo.webserver.bindis set.
getEffectiveBindAddress
Gets the bind address in effect: the override, else the preference.- Returns:
- The bind address, null or empty for all interfaces.
getOffsetCount
public int getOffsetCount()Gets the number of offsets of the port ranges: HTTP and HTTPS move together, so the shorter range bounds them (R-D-2).- Returns:
- The count, at least 1.
createPortConfigs
Creates the port configurations from the preferences, at the start of the ranges (or the override).- Returns:
- The port configurations.
createPortConfigs
Creates the port configurations of one offset of the port ranges: HTTPwsPort+offsetand HTTPSwsSecurePort+offset. WithPROP_PORTset, the overrides are used instead and the offset is ignored: HTTP on that port, HTTPS onPROP_SECURE_PORT(none for-1; the start of the HTTPS range when not set).- Parameters:
offset- The offset, 0 for the start of the ranges.- Returns:
- The port configurations.
getWorkspaceId
Gets the ID of this workspace, created and saved on first use: the key of its port claim and of its entry in the registry of live iiziGo (CC-FIX-PORT-RANGE-A).- Returns:
- The ID.
rememberOffset
public void rememberOffset(int offset) Remembers the offset this workspace bound, tried first at its next start (R-D-4); -1 forgets it.- Parameters:
offset- The offset, -1 for none.
initializeDefaultPreferences
public void initializeDefaultPreferences()Initializes the preferences store for all the terminal preferences.- Specified by:
initializeDefaultPreferencesin classAbstractPreferenceInitializer- See Also:
saveToStore
public void saveToStore()Saves a "page" to the store.