Class SAMLProtocolAndRoleHandler
- java.lang.Object
-
- net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
-
- org.opensaml.messaging.handler.AbstractMessageHandler
-
- org.opensaml.saml.common.binding.impl.SAMLProtocolAndRoleHandler
-
- All Implemented Interfaces:
net.shibboleth.utilities.java.support.component.Component,net.shibboleth.utilities.java.support.component.DestructableComponent,net.shibboleth.utilities.java.support.component.InitializableComponent,org.opensaml.messaging.handler.MessageHandler
public class SAMLProtocolAndRoleHandler extends org.opensaml.messaging.handler.AbstractMessageHandlerSAMLMessageHandlerthat attaches protocol and role information to a message context viaSAMLProtocolContextand an instance ofAbstractSAMLEntityContextobjects. The entity context class is configurable and defaults toSAMLPeerEntityContext.A profile flow would typically run this handler after message decoding occurs, to bootstrap subsequent handlers.
-
-
Field Summary
Fields Modifier and Type Field Description private org.opensaml.messaging.context.navigate.ContextDataLookupFunction<org.opensaml.messaging.context.MessageContext,? extends org.opensaml.messaging.context.BaseContext>copyContextLookupOptional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.private Class<? extends org.opensaml.saml.common.messaging.context.AbstractSAMLEntityContext>entityContextClassThe context class representing the SAML entity for whom data is to be attached.private QNamepeerRoleRole type to add to context.private StringsamlProtocolProtocol value to add to context.
-
Constructor Summary
Constructors Constructor Description SAMLProtocolAndRoleHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoInitialize()protected voiddoInvoke(org.opensaml.messaging.context.MessageContext messageContext)voidsetCopyContextLookup(org.opensaml.messaging.context.navigate.ContextDataLookupFunction<org.opensaml.messaging.context.MessageContext,? extends org.opensaml.messaging.context.BaseContext> lookup)Set the optional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.voidsetEntityContextClass(Class<? extends org.opensaml.saml.common.messaging.context.AbstractSAMLEntityContext> clazz)Set the class type holding the SAML entity data.voidsetProtocol(String protocol)Set the protocol constant to attach.voidsetRole(QName role)Set the operational role to attach.-
Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, setActivationCondition
-
Methods inherited from class net.shibboleth.utilities.java.support.component.AbstractInitializableComponent
destroy, doDestroy, initialize, isDestroyed, isInitialized
-
-
-
-
Field Detail
-
samlProtocol
@NonnullAfterInit @NotEmpty private String samlProtocol
Protocol value to add to context.
-
peerRole
@NonnullAfterInit private QName peerRole
Role type to add to context.
-
entityContextClass
@Nonnull private Class<? extends org.opensaml.saml.common.messaging.context.AbstractSAMLEntityContext> entityContextClass
The context class representing the SAML entity for whom data is to be attached. Defaults to:SAMLPeerEntityContext.
-
copyContextLookup
@Nullable private org.opensaml.messaging.context.navigate.ContextDataLookupFunction<org.opensaml.messaging.context.MessageContext,? extends org.opensaml.messaging.context.BaseContext> copyContextLookup
Optional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.
-
-
Method Detail
-
setCopyContextLookup
public void setCopyContextLookup(@Nullable org.opensaml.messaging.context.navigate.ContextDataLookupFunction<org.opensaml.messaging.context.MessageContext,? extends org.opensaml.messaging.context.BaseContext> lookup)Set the optional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.- Parameters:
lookup- the lookup function, may be null
-
setEntityContextClass
public void setEntityContextClass(@Nonnull Class<? extends org.opensaml.saml.common.messaging.context.AbstractSAMLEntityContext> clazz)Set the class type holding the SAML entity data.Defaults to:
SAMLPeerEntityContext.- Parameters:
clazz- the entity context class type
-
setProtocol
public void setProtocol(@Nonnull @NotEmpty String protocol)Set the protocol constant to attach.- Parameters:
protocol- the protocol constant to set
-
setRole
public void setRole(@Nonnull QName role)Set the operational role to attach.- Parameters:
role- the operational role to set
-
doInitialize
protected void doInitialize() throws net.shibboleth.utilities.java.support.component.ComponentInitializationException- Overrides:
doInitializein classnet.shibboleth.utilities.java.support.component.AbstractInitializableComponent- Throws:
net.shibboleth.utilities.java.support.component.ComponentInitializationException
-
doInvoke
protected void doInvoke(org.opensaml.messaging.context.MessageContext messageContext) throws org.opensaml.messaging.handler.MessageHandlerException- Specified by:
doInvokein classorg.opensaml.messaging.handler.AbstractMessageHandler- Throws:
org.opensaml.messaging.handler.MessageHandlerException
-
-