Package es.gob.afirma.tsl.utils
Class UtilsProxy
- java.lang.Object
-
- es.gob.afirma.tsl.utils.UtilsProxy
-
public final class UtilsProxy extends java.lang.ObjectUtility class responsible for loading the properties from data base to obtain the data necessary to establish a connection via PROXY. Besides this load will be done in the initialization of the platform, and this class is responsible for setting the data in the virtual machine.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.2, 18/04/2022.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanisHostURLInNonProxyList(java.lang.String urlString)Method that checks whether the specified URL is in the list of non proxy hosts.static booleanisLocalPath(java.lang.String path)Method that checks whether a path represents a host from the local network (true) or not (false).static booleanisProxyConfigurationInitialized()Method that checks if proxy configuration is initialized.static voidloadProxyConfiguration()Method that loads the configuration where the properties which configure the PROXY to use are defined.static org.apache.http.HttpHostsetUpProxyConfigurationInHttpClient(org.apache.http.client.CredentialsProvider credentials, org.apache.http.client.methods.HttpRequestBase method, java.lang.String path)Method that returns the proxy configuration needed in aHttpHostobject.static voidsetUpProxyConfigurationInJava()Method that sets the default properties in the java virtual machine for the proxy.
-
-
-
Method Detail
-
loadProxyConfiguration
public static void loadProxyConfiguration()
Method that loads the configuration where the properties which configure the PROXY to use are defined. Also sets this configuration in java static properties.
-
setUpProxyConfigurationInJava
public static void setUpProxyConfigurationInJava()
Method that sets the default properties in the java virtual machine for the proxy.
-
isLocalPath
public static boolean isLocalPath(java.lang.String path)
Method that checks whether a path represents a host from the local network (true) or not (false).- Parameters:
path- Parameter that represents the path to check.- Returns:
- a boolean that indicates whether a path represents a host from the local network (
true) or not (false).
-
isProxyConfigurationInitialized
public static boolean isProxyConfigurationInitialized()
Method that checks if proxy configuration is initialized.- Returns:
- a boolean that indicates if proxy configuration is initialized (
true) or not (false).
-
isHostURLInNonProxyList
public static boolean isHostURLInNonProxyList(java.lang.String urlString)
Method that checks whether the specified URL is in the list of non proxy hosts.- Parameters:
urlString- Parameter that represents the URL to check in a string.- Returns:
- a boolean that indicates whether the specified host is in the list of non proxy hosts.
-
setUpProxyConfigurationInHttpClient
public static org.apache.http.HttpHost setUpProxyConfigurationInHttpClient(org.apache.http.client.CredentialsProvider credentials, org.apache.http.client.methods.HttpRequestBase method, java.lang.String path)Method that returns the proxy configuration needed in aHttpHostobject.- Parameters:
credentials- Parameter that represents the HTTP client credentials that are modified if needed.method- Parameter that represents the protocol.path- Parameter that represents the path.- Returns:
- a HttpHost with proxy configuration or
nullif not needed.
-
-