Class MockAttributeDefinition
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
net.shibboleth.idp.attribute.resolver.AbstractResolverPlugin<IdPAttribute>
net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
net.shibboleth.idp.attribute.resolver.testing.MockAttributeDefinition
- All Implemented Interfaces:
AttributeDefinition,ResolverPlugin<IdPAttribute>,Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,UnmodifiableComponent,DisposableBean
An attribute definition that simply returns a static value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intNumber of timesAbstractInitializableComponent.destroy()was called.private intNumber of timesAbstractInitializableComponent.initialize()was called.private ResolutionExceptionException thrown by resolution.private IdPAttributeStatic value returned by this definition. -
Constructor Summary
ConstructorsConstructorDescriptionMockAttributeDefinition(String id, IdPAttribute value) Constructor.MockAttributeDefinition(String id, ResolutionException exception) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected IdPAttributedoAttributeDefinitionResolve(AttributeResolutionContext resolutionContext, AttributeResolverWorkContext workContext) voidvoidintGets the number of timesAbstractInitializableComponent.destroy()was called.intGets the number of timesAbstractInitializableComponent.initialize()was called.booleanMethods inherited from class net.shibboleth.idp.attribute.resolver.AbstractAttributeDefinition
doResolve, getLogPrefix, isDependencyOnly, isPreRequested, setDependencyOnly, setPreRequestedMethods 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. -
staticValue
Static value returned by this definition. -
resolutionException
Exception thrown by resolution.
-
-
Constructor Details
-
MockAttributeDefinition
public MockAttributeDefinition(@Nonnull @NotEmpty String id, @Nullable IdPAttribute value) throws ComponentInitializationException Constructor.- Parameters:
id- unique ID of this attribute definitionvalue- static value returned by this definition- Throws:
ComponentInitializationException- ...
-
MockAttributeDefinition
public MockAttributeDefinition(@Nonnull @NotEmpty String id, @Nullable ResolutionException exception) Constructor.- Parameters:
id- id of the data connectorexception- exception thrown by resolution
-
-
Method Details
-
doAttributeDefinitionResolve
@Nullable protected IdPAttribute doAttributeDefinitionResolve(@Nonnull AttributeResolutionContext resolutionContext, @Nonnull AttributeResolverWorkContext workContext) throws ResolutionException - Specified by:
doAttributeDefinitionResolvein classAbstractAttributeDefinition- Throws:
ResolutionException
-
doDestroy
public void doDestroy()- Overrides:
doDestroyin classAbstractResolverPlugin<IdPAttribute>
-
isInitialized
public boolean isInitialized()- Specified by:
isInitializedin interfaceInitializableComponent- Overrides:
isInitializedin classAbstractInitializableComponent
-
doInitialize
- Overrides:
doInitializein classAbstractAttributeDefinition- 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
-