Class MockDataConnector
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<Map<String,IdPAttribute>>
net.shibboleth.idp.attribute.resolver.AbstractDataConnector
net.shibboleth.idp.attribute.resolver.testing.MockDataConnector
- All Implemented Interfaces:
DataConnector,ResolverPlugin<Map<String,,IdPAttribute>> Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
A data connector that just returns a static collection of attributes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intNumber of timesAbstractInitializableComponent.destroy()was called.private intNumber of timesAbstractInitializableComponent.initialize()was called.private ResolutionExceptionException thrown by resolution.private final Map<String,IdPAttribute> Static collection of values returned by this connector. -
Constructor Summary
ConstructorsConstructorDescriptionMockDataConnector(String id, Map<String, IdPAttribute> connectorValues) Constructor.MockDataConnector(String id, Map<String, IdPAttribute> connectorValues, Set<ResolverAttributeDefinitionDependency> attrDepends, Set<ResolverDataConnectorDependency> dcDepends) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected Map<String,IdPAttribute> doDataConnectorResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) Retrieves a collection of attributes from some data source.voidvoidintGets the number of timesAbstractInitializableComponent.destroy()was called.intGets the number of timesAbstractInitializableComponent.initialize()was called.booleanvoidsetFailure(boolean fail) Fail resolutionsMethods inherited from class net.shibboleth.idp.attribute.resolver.AbstractDataConnector
doResolve, getExportAttributes, getFailoverDataConnectorId, getLastFail, getLastSuccess, getLogPrefix, getNoRetryDelay, setExportAttributes, setFailoverDataConnectorId, setLastFail, setLastSuccess, setNoRetryDelayMethods inherited from class net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin
equals, getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, hashCode, isPropagateResolutionExceptions, resolve, setActivationCondition, setAttributeDependencies, setDataConnectorDependencies, setPropagateResolutionExceptionsMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, initialize, isDestroyedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.DestructableComponent
destroy, isDestroyedMethods inherited from interface org.springframework.beans.factory.DisposableBean
destroyMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getIdMethods inherited from interface net.shibboleth.shared.component.InitializableComponent
initializeMethods inherited from interface net.shibboleth.idp.attribute.resolver.ResolverPlugin
getActivationCondition, getAttributeDependencies, getDataConnectorDependencies, isPropagateResolutionExceptions, resolve
-
Field Details
-
destroyCount
private int destroyCountNumber of timesAbstractInitializableComponent.destroy()was called. -
initializeCount
private int initializeCountNumber of timesAbstractInitializableComponent.initialize()was called. -
values
Static collection of values returned by this connector. -
resolutionException
Exception thrown by resolution.
-
-
Constructor Details
-
MockDataConnector
public MockDataConnector(@Nonnull @NotEmpty String id, @Nullable Map<String, IdPAttribute> connectorValues) throws ComponentInitializationExceptionConstructor.- Parameters:
id- unique ID for this data connectorconnectorValues- static collection of values returned by this connector- Throws:
ComponentInitializationException- ...
-
MockDataConnector
public MockDataConnector(@Nonnull @NotEmpty String id, @Nullable Map<String, IdPAttribute> connectorValues, @Nullable Set<ResolverAttributeDefinitionDependency> attrDepends, @Nullable Set<ResolverDataConnectorDependency> dcDepends) throws ComponentInitializationExceptionConstructor.- Parameters:
id- unique ID for this data connectorconnectorValues- static collection of values returned by this connectorattrDepends- The AD dependenciesdcDepends- The DC dependencies- Throws:
ComponentInitializationException- if initialization failed
-
-
Method Details
-
setFailure
public void setFailure(boolean fail) Fail resolutions- Parameters:
fail-trueto return aResolutionException, otherwisenull
-
doDataConnectorResolve
@Nullable protected Map<String,IdPAttribute> doDataConnectorResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException Retrieves a collection of attributes from some data source.- Specified by:
doDataConnectorResolvein classAbstractDataConnector- Parameters:
resolutionContext- current resolution contextworkContext- current resolver work context- Returns:
- collected attributes indexed by attribute ID
- Throws:
ResolutionException- thrown if there is a problem resolving the attributes
-
doDestroy
public void doDestroy()- Overrides:
doDestroyin classAbstractResolverPlugin<Map<String,IdPAttribute>>
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInitializableComponent- Overrides:
isInitializedin classAbstractInitializableComponent
-
doInitialize
- Overrides:
doInitializein classAbstractDataConnector- Throws:
ComponentInitializationException
-
getDestroyCount
public int getDestroyCount()Gets the number of timesAbstractInitializableComponent.destroy()was called.- Returns:
- number of times
AbstractInitializableComponent.destroy()was called
-
getInitializeCount
public int getInitializeCount()Gets the number of timesAbstractInitializableComponent.initialize()was called.- Returns:
- number of times
AbstractInitializableComponent.initialize()was called
-