Class HTTPResourceFactoryBean
- java.lang.Object
-
- org.springframework.beans.factory.config.AbstractFactoryBean<HTTPResource>
-
- net.shibboleth.idp.profile.spring.resource.impl.HTTPResourceFactoryBean
-
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<HTTPResource>,InitializingBean
public class HTTPResourceFactoryBean extends AbstractFactoryBean<HTTPResource>
Factory bean for simple use cases that auto-configure PKIX or key pinning for anHTTPResource.- Since:
- 3.4.0
-
-
Field Summary
Fields Modifier and Type Field Description private StringbackingResourceBacking file path.private List<Resource>certificateResourcesThe resources to be turned into certificates.private org.apache.http.client.HttpClienthttpClientHTTP Client used to pull the resource.private HttpClientContextHandlerhttpClientContextHandlerOptional handler to pre- and post-process context.private List<Resource>keyResourcesThe resources to be turned into keys.private org.slf4j.LoggerlogClass logger.private URLresourceURLURL to the Resource.private booleanusePKIXUse a PKIX trust engine.private IntegerverifyDepthPKIX verify depth.-
Fields inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
logger
-
Fields inherited from interface org.springframework.beans.factory.FactoryBean
OBJECT_TYPE_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description HTTPResourceFactoryBean()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected HTTPResourcecreateInstance()protected List<X509Certificate>getCertificates()Get the configured certificates in their native form.protected List<Credential>getCredentials()Get the configured keys and certificates lumped together as credentials.Class<?>getObjectType()voidsetBackingResource(String resource)Set the backing resource.voidsetCertificates(List<Resource> certs)Set the resources which we will convert into certificates.voidsetHttpClient(org.apache.http.client.HttpClient client)Set theHttpClientinstance.voidsetHttpClientContextHandler(HttpClientContextHandler handler)Set a handler to manipulate theHttpClientContext.voidsetPublicKeys(List<Resource> keys)Set the resources which we will convert into certificates.voidsetURL(URL url)Set the URL.voidsetUsePKIX(boolean flag)Set whether to use a PKIX trust engine.voidsetVerifyDepth(Integer depth)Set the verify depth.-
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
-
-
-
-
Field Detail
-
log
@Nonnull private org.slf4j.Logger log
Class logger.
-
backingResource
@Nullable private String backingResource
Backing file path.
-
httpClient
@Nullable private org.apache.http.client.HttpClient httpClient
HTTP Client used to pull the resource.
-
resourceURL
@Nullable private URL resourceURL
URL to the Resource.
-
httpClientContextHandler
@Nullable private HttpClientContextHandler httpClientContextHandler
Optional handler to pre- and post-process context.
-
certificateResources
@Nonnull private List<Resource> certificateResources
The resources to be turned into certificates.
-
usePKIX
private boolean usePKIX
Use a PKIX trust engine.
-
verifyDepth
@Nullable private Integer verifyDepth
PKIX verify depth.
-
-
Method Detail
-
setURL
public void setURL(@Nullable URL url)Set the URL.- Parameters:
url- the URL
-
setBackingResource
public void setBackingResource(@Nullable @NotEmpty String resource)
Set the backing resource.- Parameters:
resource- the backing resource
-
setHttpClient
public void setHttpClient(@Nullable org.apache.http.client.HttpClient client)Set theHttpClientinstance.- Parameters:
client- client instance
-
setHttpClientContextHandler
public void setHttpClientContextHandler(@Nullable HttpClientContextHandler handler)Set a handler to manipulate theHttpClientContext.- Parameters:
handler- the handler to install
-
setPublicKeys
public void setPublicKeys(@Nullable List<Resource> keys)Set the resources which we will convert into certificates.- Parameters:
keys- the resources
-
setCertificates
public void setCertificates(@Nullable List<Resource> certs)Set the resources which we will convert into certificates.- Parameters:
certs- the resources
-
setUsePKIX
public void setUsePKIX(boolean flag)
Set whether to use a PKIX trust engine.- Parameters:
flag- flag to set
-
setVerifyDepth
public void setVerifyDepth(@Nullable Integer depth)Set the verify depth.- Parameters:
depth- value to set
-
getCredentials
@Nullable @NonnullElements protected List<Credential> getCredentials()
Get the configured keys and certificates lumped together as credentials.- Returns:
- the certificates null
-
getCertificates
@Nullable @NonnullElements protected List<X509Certificate> getCertificates()
Get the configured certificates in their native form.- Returns:
- the certificates
-
getObjectType
public Class<?> getObjectType()
- Specified by:
getObjectTypein interfaceFactoryBean<HTTPResource>- Specified by:
getObjectTypein classAbstractFactoryBean<HTTPResource>
-
createInstance
protected HTTPResource createInstance() throws Exception
- Specified by:
createInstancein classAbstractFactoryBean<HTTPResource>- Throws:
Exception
-
-