All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.dsf.common.config.ProxyConfig Maven / Gradle / Ivy

There is a newer version: 1.5.2
Show newest version
package dev.dsf.common.config;

import java.util.List;

public interface ProxyConfig
{
	/**
	 * @return may be null
	 */
	String getUrl();

	/**
	 * @return true if a proxy url is configured and '*' is not set as a no-proxy url
	 */
	boolean isEnabled();

	/**
	 * @param targetUrl
	 *            may be null
	 * @return true if a proxy url is configured, '*' is not set as a no-proxy url and the given
	 *         targetUrl is not set as a no-proxy url, false if the given targetUrl is
	 *         null or blank
	 * @see #getNoProxyUrls()
	 * @see String#isBlank()
	 */
	boolean isEnabled(String targetUrl);

	/**
	 * @return may be null
	 */
	String getUsername();

	/**
	 * @return may be null
	 */
	char[] getPassword();

	/**
	 * @return never null, may be empty
	 */
	List getNoProxyUrls();

	/**
	 * Returns true if the given targetUrl is not null and the domain + port of the
	 * given targetUrl is configured as a no-proxy URL based on the environment configuration.
	 * 

* Configured no-proxy URLs are matched exactly and against sub-domains. If a port is configured, only URLs with the * same port (or default port) return a true result. *

*

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
No-Proxy URL examples
ConfiguredGivenResult
foo.bar, test.com:8080https://foo.bar/fhirtrue
foo.bar, test.com:8080https://baz.foo.bar/testtrue
foo.bar, test.com:8080https://test.com:8080/fhirtrue
foo.bar, test.com:8080https://test.com/fhirfalse
foo.bar:443https://foo.bar/fhirtrue
* * @param targetUrl * may be null * @return true if the given targetUrl is not null and is configured as a no-proxy url */ boolean isNoProxyUrl(String targetUrl); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy