Class AbstractDataConnectorParser
- java.lang.Object
-
- org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
-
- org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
-
- net.shibboleth.ext.spring.util.AbstractCustomBeanDefinitionParser
-
- net.shibboleth.idp.attribute.resolver.spring.BaseResolverPluginParser
-
- net.shibboleth.idp.attribute.resolver.spring.dc.AbstractDataConnectorParser
-
- All Implemented Interfaces:
BeanDefinitionParser
- Direct Known Subclasses:
HTTPDataConnectorParser,LDAPDataConnectorParser,RDBMSDataConnectorParser,ScriptDataConnectorParser,StaticDataConnectorParser,StorageServiceDataConnectorParser,SubjectDataConnectorParser
public abstract class AbstractDataConnectorParser extends BaseResolverPluginParser
Base spring bean definition parser for data connectors. DataConnector implementations should provide a custom BeanDefinitionParser by extending this class and overriding thedoParse(Element, ParserContext, BeanDefinitionBuilder)method to parse any additional attributes or elements it requires. Standard attributes and elements defined by the ResolutionPlugIn and DataConnector schemas will automatically attempt to be parsed.
-
-
Field Summary
Fields Modifier and Type Field Description static StringATTR_EXPORT_ALLWhether to export all attributes.static StringATTR_EXPORT_NAMESWhich attributes to export.static StringATTR_FACTORY_POSTPROCESSORS_REFstatic StringATTR_FAIL_FASTFailfast LDAP, Realtional, Stored.static StringATTR_NORETRYDELAYDelay in retrying failed connector.static StringATTR_POSTPROCESSORS_REFstatic StringATTR_SPRING_RESOURCEsemi colon separated resources to indicate external config.static StringATTR_SPRING_RESOURCE_REFstatic QNameELEMENT_NAMEElement name.static QNameFAILOVER_DATA_CONNECTOR_ELEMENT_NAMEFailover data connector attribute name.private org.slf4j.LoggerlogLog4j logger.-
Fields inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
ID_ATTRIBUTE, NAME_ATTRIBUTE
-
-
Constructor Summary
Constructors Constructor Description AbstractDataConnectorParser()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoParse(Element config, ParserContext parserContext, BeanDefinitionBuilder builder)protected abstract voiddoV2Parse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)Parse the suppliedElementas a legacy format and populate the suppliedBeanDefinitionBuilderas required.protected Class<?>getBeanClass(Element element)protected StringgetLogPrefix()Return a string which is to be prepended to all log messages.protected abstract Class<? extends AbstractDataConnector>getNativeBeanClass()Per parser indication of what we are building.protected booleanisNative(Element config)Returns whether the element configuration is native spring or custom.-
Methods inherited from class net.shibboleth.idp.attribute.resolver.spring.BaseResolverPluginParser
failOnDependencies, getActivationCondition, getDefinitionId, warnOnDependencies
-
Methods inherited from class net.shibboleth.ext.spring.util.AbstractCustomBeanDefinitionParser
registerBeanDefinition
-
Methods inherited from class org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser
doParse, getBeanClassName, getParentName, parseInternal
-
Methods inherited from class org.springframework.beans.factory.xml.AbstractBeanDefinitionParser
parse, postProcessComponentDefinition, resolveId, shouldFireEvents, shouldGenerateId, shouldGenerateIdAsFallback, shouldParseNameAsAliases
-
-
-
-
Field Detail
-
ELEMENT_NAME
@Nonnull public static final QName ELEMENT_NAME
Element name.
-
ATTR_NORETRYDELAY
@Nonnull @NotEmpty public static final String ATTR_NORETRYDELAY
Delay in retrying failed connector.- See Also:
- Constant Field Values
-
ATTR_SPRING_RESOURCE
@Nonnull @NotEmpty public static final String ATTR_SPRING_RESOURCE
semi colon separated resources to indicate external config.- See Also:
- Constant Field Values
-
ATTR_SPRING_RESOURCE_REF
@Nonnull @NotEmpty public static final String ATTR_SPRING_RESOURCE_REF
- See Also:
- Constant Field Values
-
ATTR_FACTORY_POSTPROCESSORS_REF
@Nonnull @NotEmpty public static final String ATTR_FACTORY_POSTPROCESSORS_REF
- See Also:
- Constant Field Values
-
ATTR_POSTPROCESSORS_REF
@Nonnull @NotEmpty public static final String ATTR_POSTPROCESSORS_REF
- See Also:
- Constant Field Values
-
ATTR_EXPORT_ALL
@Nonnull @NotEmpty public static final String ATTR_EXPORT_ALL
Whether to export all attributes.- See Also:
- Constant Field Values
-
ATTR_EXPORT_NAMES
@Nonnull @NotEmpty public static final String ATTR_EXPORT_NAMES
Which attributes to export.- See Also:
- Constant Field Values
-
ATTR_FAIL_FAST
@Nonnull @NotEmpty public static final String ATTR_FAIL_FAST
Failfast LDAP, Realtional, Stored.- See Also:
- Constant Field Values
-
FAILOVER_DATA_CONNECTOR_ELEMENT_NAME
@Nonnull public static final QName FAILOVER_DATA_CONNECTOR_ELEMENT_NAME
Failover data connector attribute name.
-
log
@Nonnull private final org.slf4j.Logger log
Log4j logger.
-
-
Method Detail
-
isNative
protected boolean isNative(@Nonnull Element config)Returns whether the element configuration is native spring or custom.- Parameters:
config- the element under consideration.- Returns:
- whether this is native spring
-
getBeanClass
protected final Class<?> getBeanClass(Element element)
- Overrides:
getBeanClassin classAbstractSingleBeanDefinitionParser
-
getNativeBeanClass
protected abstract Class<? extends AbstractDataConnector> getNativeBeanClass()
Per parser indication of what we are building.- Returns:
- the class
-
doParse
protected void doParse(@Nonnull Element config, @Nonnull ParserContext parserContext, @Nonnull BeanDefinitionBuilder builder)- Overrides:
doParsein classBaseResolverPluginParser
-
doV2Parse
protected abstract void doV2Parse(Element element, ParserContext parserContext, BeanDefinitionBuilder builder)
Parse the suppliedElementas a legacy format and populate the suppliedBeanDefinitionBuilderas required.- Parameters:
element- the XML element being parsedparserContext- the object encapsulating the current state of the parsing processbuilder- used to define theBeanDefinition- See Also:
AbstractSingleBeanDefinitionParser.doParse(Element, BeanDefinitionBuilder)
-
getLogPrefix
@Nonnull @NotEmpty protected String getLogPrefix()
Return a string which is to be prepended to all log messages.- Overrides:
getLogPrefixin classBaseResolverPluginParser- Returns:
- "Data Connector: '<definitionID>' :"
-
-