Class OutboundConfig

    • Field Detail

      • CONFIG_OUTBOUND

        public static final String CONFIG_OUTBOUND
        Configuration key (expected under provider configuration) that holds the object list of OutboundTargets configuration.
        See Also:
        Constant Field Values
      • PROPERTY_DISABLE_OUTBOUND

        public static final String PROPERTY_DISABLE_OUTBOUND
        Property used for outbound calls with clients to disable registration/running of outbound security. This may be used from clients that set up outbound security explicitly. By default this property is assumed to be false, so outbound is enabled
        See Also:
        Constant Field Values
    • Constructor Detail

      • OutboundConfig

        public OutboundConfig()
    • Method Detail

      • create

        public static OutboundConfig create​(Config providerConfig)
        Parse targets from provider configuration.
        Parameters:
        providerConfig - configuration object of current provider
        Returns:
        new instance with targets from configuration
      • create

        public static OutboundConfig create​(Config providerConfig,
                                            OutboundTarget... defaults)
        Parse targets from provider configuration with possible default targets. In case the configuration contains a target named "default", the defaults provided to this method will be ignored.
        Parameters:
        providerConfig - configuration object of current provider
        defaults - default target configuration (e.g. known public endpoints that are expected static in time)
        Returns:
        new instance with targets from configuration, defaults are first (unless overridden)
      • builder

        public static OutboundConfig.Builder builder()
        New builder to programmatically build targets.
        Returns:
        new Builder instance
      • findTargetCustomObject

        public <T> Optional<T> findTargetCustomObject​(SecurityEnvironment env,
                                                      Class<T> customObjectClass,
                                                      Function<Config,​? extends T> customObjectProducer,
                                                      Supplier<? extends T> defaultValue)
        Find, create and cache a custom object associated with a specific outbound target.
        Type Parameters:
        T - type of the custom object
        Parameters:
        env - Security environment to find the outbound target
        customObjectClass - class of the custom object
        customObjectProducer - a producer of the custom object from config associated with the target
        defaultValue - supplier of the custom object if there is no object nor config associated with the target
        Returns:
        custom object (cached for further calls) if a target was found, empty otherwise
      • targets

        public List<OutboundTarget> targets()
        Outbound targets configured for outbound handling. Each target defines a protocol, host and path it is valid for (maybe using wildcards). Additional configuration is usually added to a target for a specific provider.
        Returns:
        list of targets defined