Class MailLinkBase

java.lang.Object
com.iizix.server.user.MailLinkBase

public final class MailLinkBase extends Object
The base URL of every absolute link the server mails for a client session (R-145, CC-FIX-SIGNIN-ACCOUNT-MAIL): the ORIGIN the client reached the server by - the scheme, the host name the Browser used and the client's port, as the web server read them of the connection at the WebSocket upgrade (SessionInfo.getExternalBaseURL(); a LAN client gets a LAN link, a client behind the front-end proxy gets the proxy's name and scheme) - and only when the session has none, the server's configured external URL (ServerShell.getExternalWebServerBaseURL(), which reads the thread's session first and the setting externalHostName after it).

No feature depends on the configured value: a mail is never refused because it is not set. The one case that still gives no base is a caller without a client session on a server without the setting; the caller says so to the user (VerificationMails) or in the log.

Author:
Christopher Mindus
  • Method Details

    • of

      public static String of(IClientSessionGyro clientGyro)
      Gets the base of the links mailed for a client session: the session's origin, else the server's configured external URL.
      Parameters:
      clientGyro - The client session, null for none.
      Returns:
      The base as https://host[:port] without a trailing slash, or null when neither the session nor the server gives one.
    • of

      public static String of(SessionInfo si, String configured)
      Gets the base of the links mailed for a session, with the configured fallback given: the session's origin first (SessionInfo.getExternalBaseURL()), the fallback only when the session gives none. A trailing slash is removed; a blank value counts as none.
      Parameters:
      si - The session, null for none.
      configured - The server's configured external URL, null or blank for none.
      Returns:
      The base without a trailing slash, or null for none.