Class DataConnectorFactoryBean
- java.lang.Object
-
- org.springframework.beans.factory.config.AbstractFactoryBean<T>
-
- net.shibboleth.ext.spring.factory.AbstractComponentAwareFactoryBean<T>
-
- net.shibboleth.idp.attribute.resolver.spring.impl.AbstractResolverPluginFactoryBean<AbstractDataConnector>
-
- net.shibboleth.idp.attribute.resolver.spring.dc.impl.DataConnectorFactoryBean
-
- All Implemented Interfaces:
Aware,BeanClassLoaderAware,BeanFactoryAware,DisposableBean,FactoryBean<AbstractDataConnector>,InitializingBean,ApplicationContextAware
public class DataConnectorFactoryBean extends AbstractResolverPluginFactoryBean<AbstractDataConnector> implements ApplicationContextAware
A factory bean to collect the parameterization that goes onto aAbstractDataConnector. It is specifically aimed at the implementations where contents are plugged in via external resources.
-
-
Field Summary
Fields Modifier and Type Field Description private GenericApplicationContextappContextThe context we fired up.private Class<? extends AbstractDataConnector>connectorClassThe class that we are implementing.private BooleanexportAllAttributesDo we release all attributes?.private Collection<String>exportAttributesWhich named attributes do we release?.private List<BeanFactoryPostProcessor>factoryPostProcessorsList of bean factory post processors for this connector's content.private StringfailoverDataConnectorIdData Connector property "failoverDataConnectorId".private org.slf4j.LoggerlogLog4j logger.private DurationnoRetryDelayData Connector property "noRetryDelay".private ApplicationContextparentContextOur parent context.private List<BeanPostProcessor>postProcessorsList of bean post processors for this connector's content.private List<Resource>resourcesThe resources we are importing.-
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 DataConnectorFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddestroyInstance(AbstractDataConnector instance)protected AbstractDataConnectordoCreateInstance()List<BeanFactoryPostProcessor>getBeanFactoryPostProcessors()Get the post processors.List<BeanPostProcessor>getBeanPostProcessors()Get the list of bean post processors for this connector.StringgetFailoverDataConnectorId()Data Connector property "failoverDataConnectorId".DurationgetNoRetryDelay()Data Connector property "noRetryDelay".Class<? extends AbstractDataConnector>getObjectType()ApplicationContextgetParentContext()Returns the parentContext.List<Resource>getResources()The resources to use.voidsetApplicationContext(ApplicationContext applicationContext)voidsetBeanFactoryPostProcessors(List<BeanFactoryPostProcessor> processors)Set the list of bean factory post processors for this connector.voidsetBeanPostProcessors(List<BeanPostProcessor> processors)Set the list of bean post processors for this connector.voidsetExportAllAttributes(boolean what)Set whether we export all attributes.voidsetExportAttributes(Collection<String> what)Sets the list of attribute names to export during resolution.voidsetFailoverDataConnectorId(String id)Data Connector property "failoverDataConnectorId".voidsetNoRetryDelay(Duration delay)Data Connector property "noRetryDelay".voidsetObjectType(Class<? extends AbstractDataConnector> claz)Set the class we are going to build.voidsetResources(List<Resource> theResources)The resources to use.voidsetSingleton(boolean singleton)We do not allow non-singleton beans, if we did then we loose constructability.protected voidsetValues(AbstractDataConnector what)Set the locally define values into the object under construction.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.spring.impl.AbstractResolverPluginFactoryBean
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, getId, getProfileContextStrategy, getPropagateResolutionExceptions, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setId, setProfileContextStrategy, setPropagateResolutionExceptions
-
Methods inherited from class net.shibboleth.ext.spring.factory.AbstractComponentAwareFactoryBean
createInstance
-
Methods inherited from class org.springframework.beans.factory.config.AbstractFactoryBean
afterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory
-
-
-
-
Field Detail
-
log
@Nonnull private final org.slf4j.Logger log
Log4j logger.
-
connectorClass
@Nonnull private Class<? extends AbstractDataConnector> connectorClass
The class that we are implementing.
-
parentContext
@Nullable private ApplicationContext parentContext
Our parent context.
-
appContext
private GenericApplicationContext appContext
The context we fired up.
-
factoryPostProcessors
@Nonnull @NonnullElements private List<BeanFactoryPostProcessor> factoryPostProcessors
List of bean factory post processors for this connector's content.
-
postProcessors
@Nonnull @NonnullElements private List<BeanPostProcessor> postProcessors
List of bean post processors for this connector's content.
-
failoverDataConnectorId
@Nullable private String failoverDataConnectorId
Data Connector property "failoverDataConnectorId".
-
noRetryDelay
@Nullable private Duration noRetryDelay
Data Connector property "noRetryDelay".
-
exportAllAttributes
private Boolean exportAllAttributes
Do we release all attributes?.
-
exportAttributes
@Nonnull @NonnullElements private Collection<String> exportAttributes
Which named attributes do we release?.
-
-
Method Detail
-
getFailoverDataConnectorId
@Nullable public String getFailoverDataConnectorId()
Data Connector property "failoverDataConnectorId".- Returns:
- the value of property to set or null if never set
-
setFailoverDataConnectorId
public void setFailoverDataConnectorId(@Nullable String id)Data Connector property "failoverDataConnectorId".- Parameters:
id- the value to set
-
getNoRetryDelay
@Nullable public Duration getNoRetryDelay()
Data Connector property "noRetryDelay".- Returns:
- the value of property to set or null if never set
-
setNoRetryDelay
public void setNoRetryDelay(@Nullable Duration delay)Data Connector property "noRetryDelay".- Parameters:
delay- the value to set
-
setResources
public void setResources(@Nonnull @NonnullElements List<Resource> theResources)
The resources to use.- Parameters:
theResources- the resources to look at
-
getResources
@Nonnull @NonnullElements public List<Resource> getResources()
The resources to use.- Returns:
- the resources to look at
-
setExportAttributes
public void setExportAttributes(@Nonnull Collection<String> what)Sets the list of attribute names to export during resolution.- Parameters:
what- the list
-
setExportAllAttributes
public void setExportAllAttributes(boolean what)
Set whether we export all attributes.- Parameters:
what- whether we export all attributes
-
setBeanFactoryPostProcessors
public void setBeanFactoryPostProcessors(@Nonnull @NonnullElements List<BeanFactoryPostProcessor> processors)
Set the list of bean factory post processors for this connector.- Parameters:
processors- bean factory post processors to apply
-
getBeanFactoryPostProcessors
@Nonnull @NonnullElements public List<BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
Get the post processors.- Returns:
- the bean factory post processors
-
setBeanPostProcessors
public void setBeanPostProcessors(@Nonnull @NonnullElements List<BeanPostProcessor> processors)
Set the list of bean post processors for this connector.- Parameters:
processors- bean post processors to apply
-
getBeanPostProcessors
@Nonnull @NonnullElements public List<BeanPostProcessor> getBeanPostProcessors()
Get the list of bean post processors for this connector.- Returns:
- processors bean post processors to apply
-
setValues
protected void setValues(AbstractDataConnector what)
Set the locally define values into the object under construction.- Overrides:
setValuesin classAbstractResolverPluginFactoryBean<AbstractDataConnector>- Parameters:
what- the object being built.
-
setSingleton
public void setSingleton(boolean singleton)
We do not allow non-singleton beans, if we did then we loose constructability.- Overrides:
setSingletonin classAbstractFactoryBean<AbstractDataConnector>
-
setObjectType
public void setObjectType(@Nonnull Class<? extends AbstractDataConnector> claz)Set the class we are going to build.- Parameters:
claz- the class.
-
getObjectType
public Class<? extends AbstractDataConnector> getObjectType()
- Specified by:
getObjectTypein interfaceFactoryBean<AbstractDataConnector>- Specified by:
getObjectTypein classAbstractFactoryBean<AbstractDataConnector>
-
getParentContext
public ApplicationContext getParentContext()
Returns the parentContext.- Returns:
- Returns the parentContext.
-
setApplicationContext
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException
- Specified by:
setApplicationContextin interfaceApplicationContextAware- Throws:
BeansException
-
destroyInstance
protected void destroyInstance(AbstractDataConnector instance) throws Exception
- Overrides:
destroyInstancein classAbstractComponentAwareFactoryBean<AbstractDataConnector>- Throws:
Exception
-
doCreateInstance
protected AbstractDataConnector doCreateInstance() throws Exception
In order to create the bean we introspect with respect to contents of the Spring resources and inject as required.
- Specified by:
doCreateInstancein classAbstractComponentAwareFactoryBean<AbstractDataConnector>- Throws:
Exception
-
-