/** * Determines the secure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getPort(int)} * with the value returned by {@link #getPortDefaultValue()}. * * @return The port. */ protected final int determineSecurePort() { final int port = getConfig().getPort(getPortDefaultValue()); if (port == getPortDefaultValue()) { LOG.info("Server uses secure standard port {}", port); } else if (port == 0) { LOG.info("Server found secure port number configured for ephemeral port selection (port chosen automatically)."); } return port; }
/** * Determines the secure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getPort(int)} * with the value returned by {@link #getPortDefaultValue()}. * * @return The port. */ protected final int determineSecurePort() { final int port = getConfig().getPort(getPortDefaultValue()); if (port == getPortDefaultValue()) { LOG.info("Server uses secure standard port {}", port); } else if (port == 0) { LOG.info("Server found secure port number configured for ephemeral port selection (port chosen automatically)."); } return port; }
/** * Determines the insecure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getInsecurePort(int)} * with the value returned by {@link #getInsecurePortDefaultValue()}. * * @return The port. */ protected final int determineInsecurePort() { final int insecurePort = getConfig().getInsecurePort(getInsecurePortDefaultValue()); if (insecurePort == 0) { LOG.info("Server found insecure port number configured for ephemeral port selection (port chosen automatically)."); } else if (insecurePort == getInsecurePortDefaultValue()) { LOG.info("Server uses standard insecure port {}", insecurePort); } else if (insecurePort == getPortDefaultValue()) { LOG.warn("Server found insecure port number configured to standard port for secure connections {}", getConfig().getInsecurePort()); LOG.warn("Possibly misconfigured?"); } return insecurePort; }
/** * Determines the insecure port to bind to. * <p> * The port is determined by invoking {@code HonoConfigProperties#getInsecurePort(int)} * with the value returned by {@link #getInsecurePortDefaultValue()}. * * @return The port. */ protected final int determineInsecurePort() { final int insecurePort = getConfig().getInsecurePort(getInsecurePortDefaultValue()); if (insecurePort == 0) { LOG.info("Server found insecure port number configured for ephemeral port selection (port chosen automatically)."); } else if (insecurePort == getInsecurePortDefaultValue()) { LOG.info("Server uses standard insecure port {}", insecurePort); } else if (insecurePort == getPortDefaultValue()) { LOG.warn("Server found insecure port number configured to standard port for secure connections {}", getConfig().getInsecurePort()); LOG.warn("Possibly misconfigured?"); } return insecurePort; }
if (getConfig().getPort(getPortDefaultValue()) == getConfig().getInsecurePort(getInsecurePortDefaultValue())) { LOG.error("secure and insecure ports must be configured to bind to different port numbers"); result.fail("secure and insecure ports configured to bind to same port number");
if (getConfig().getPort(getPortDefaultValue()) == getConfig().getInsecurePort(getInsecurePortDefaultValue())) { LOG.error("secure and insecure ports must be configured to bind to different port numbers"); result.fail("secure and insecure ports configured to bind to same port number");
/** * Gets the secure port number that this service has bound to. * <p> * The port number is determined as follows: * <ol> * <li>if this service is already listening on a secure port, the corresponding socket's actual port number is returned, else</li> * <li>if this service has been configured to listen on a secure port, the configured port number is returned, else</li> * <li>{@link Constants#PORT_UNCONFIGURED} is returned.</li> * </ol> * * @return The port number. */ public final int getPort() { if (getActualPort() != Constants.PORT_UNCONFIGURED) { return getActualPort(); } else if (isSecurePortEnabled()) { return getConfig().getPort(getPortDefaultValue()); } else { return Constants.PORT_UNCONFIGURED; } };
/** * Gets the secure port number that this service has bound to. * <p> * The port number is determined as follows: * <ol> * <li>if this service is already listening on a secure port, the corresponding socket's actual port number is returned, else</li> * <li>if this service has been configured to listen on a secure port, the configured port number is returned, else</li> * <li>{@link Constants#PORT_UNCONFIGURED} is returned.</li> * </ol> * * @return The port number. */ public final int getPort() { if (getActualPort() != Constants.PORT_UNCONFIGURED) { return getActualPort(); } else if (isSecurePortEnabled()) { return getConfig().getPort(getPortDefaultValue()); } else { return Constants.PORT_UNCONFIGURED; } };