Class EndpointConfiguration


  • public class EndpointConfiguration
    extends Object
    Configuration for a specific REST endpoint. Can be used standalone or in conjunction with SecureEndpointsConfiguration.

    As this is a configuration class generally intended to be populated from external configuration, it is mutable.

    • Constructor Detail

      • EndpointConfiguration

        public EndpointConfiguration()
    • Method Detail

      • isSecure

        public boolean isSecure()
        Returns true if the scheme is "wss" or "https".
        Returns:
        true if using a secure scheme
      • setDomain

        public void setDomain​(String singleDomainOrCsv)
        Set the domain(s), which can be a single domain (e.g. example.org) or multiple domains separated by commas. If a comma-separated list of domains is specified, whitespace is allowed and trimmed. For example this is valid: " domain-1.test , domain-2.test , domain-3.test " and results in the three domains "domain-1.test", "domain-2.test", and "domain-3.test".
        Parameters:
        singleDomainOrCsv - a single domain like example.org or a comma-delimited list of domains
      • getDomains

        public List<String> getDomains()
        Return the domains as a list.
        Returns:
        the list of domains
      • getURI

        public String getURI()
        Uses this endpoint's path to build a URI as a String. The host in the returned URI will be the result of round-robin among the domains returned by getDomains().
        Returns:
        the URI as a String
        Implementation Note:
        This currently builds URIs using simple string substitution, any any leading or trailing slashes on the domain are stripped.
      • getUriObject

        public URI getUriObject()
        Uses this endpoint's path to build a URI.
        Returns:
        the URI as a URI
        See Also:
        getURI()
      • toUriBuilder

        public javax.ws.rs.core.UriBuilder toUriBuilder()
        Converts the URI returned by getURI() into a JAX-RS UriBuilder.

        Note that JAX-RS must be in the classpath when calling this method.

        Returns:
        a JAX-RS UriBuilder instance