Class SecureEndpointsConfiguration

  • All Implemented Interfaces:
    KeyAndTrustStoreConfigProvider, TrustStoreConfigProvider

    public class SecureEndpointsConfiguration
    extends SSLContextConfiguration
    Configuration for secure REST endpoints, including the configuration from an SSLContextConfiguration as well as adding a collection of EndpointConfiguration instances. Supports programmatic creation using a builder. Also supports construction from external configuration, e.g. from a YAML configuration file, using the no-args constructor and setter methods.

    As this is a configuration class that supports population from external configuration, it is mutable.

    • Constructor Detail

      • SecureEndpointsConfiguration

        public SecureEndpointsConfiguration()
        Create instance with empty collection of endpoints.
    • Method Detail

      • isSecure

        public boolean isSecure()
        Returns true if any of the endpoints in this configuration is secure.

        Alias for anyEndpointSecure().

        Returns:
        true if any endpoint is secure
      • anyEndpointSecure

        public boolean anyEndpointSecure()
        Returns true if any of the endpoints in this configuration is secure.
        Returns:
        true if any of endpoint is secure: false otherwise
      • allEndpointsSecure

        public boolean allEndpointsSecure()
        Returns true if all of the endpoints in this configuration are secure.
        Returns:
        true if all endpoints are secure: false otherwise
      • getEndpointByPathEnding

        public EndpointConfiguration getEndpointByPathEnding​(String pathEnding)
        Finds the EndpointConfiguration with a path ending with the given pathEnding, throwing an exception if not found.
        Parameters:
        pathEnding - the end of the path to look for in each endpoint
        Returns:
        the EndpointConfiguration with the given path ending
        Throws:
        IllegalStateException - if there is no such endpoint
      • getEndpointByPathEndingOrEmpty

        public Optional<EndpointConfiguration> getEndpointByPathEndingOrEmpty​(String pathEnding)
        Finds the EndpointConfiguration with a path ending with the given pathEnding, returning an empty Optional if not found.
        Parameters:
        pathEnding - the end of the path to look for in each endpoint
        Returns:
        an Optional that may or may not contain an endpoint