Class VelocityMetadataGenerator
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
org.opensaml.saml.metadata.generator.impl.VelocityMetadataGenerator
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent,MetadataGenerator
public class VelocityMetadataGenerator
extends AbstractIdentifiableInitializableComponent
implements MetadataGenerator
Implementation of SAML metadata generation using Velocity.
- Since:
- 5.0.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.velocity.app.VelocityEngineVelocity engine. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidgenerate(MetadataGeneratorParameters params, Writer sink) Generate metadata using the supplied parameters into the supplied destination.protected org.apache.velocity.VelocityContextBuilds the Velocity template context.voidsetVelocityEngine(org.apache.velocity.app.VelocityEngine engine) Set the Velocity engine to use.Methods 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, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
velocityEngine
Velocity engine.
-
-
Constructor Details
-
VelocityMetadataGenerator
public VelocityMetadataGenerator()
-
-
Method Details
-
setVelocityEngine
public void setVelocityEngine(@Nonnull org.apache.velocity.app.VelocityEngine engine) Set the Velocity engine to use.- Parameters:
engine- velocity engine
-
doInitialize
- Overrides:
doInitializein classAbstractIdentifiedInitializableComponent- Throws:
ComponentInitializationException
-
generate
public void generate(@Nonnull MetadataGeneratorParameters params, @Nonnull Writer sink) throws IOException Generate metadata using the supplied parameters into the supplied destination.The writer must be open and will not be closed by this method.
- Specified by:
generatein interfaceMetadataGenerator- Parameters:
params- input parameterssink- destination for output- Throws:
IOException- on error
-
getVelocityContext
@Nonnull protected org.apache.velocity.VelocityContext getVelocityContext(@Nonnull TemplateMetadataGeneratorParameters params) Builds the Velocity template context.- Parameters:
params- the input parameters- Returns:
- the populated context
-