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:
Component
,DestructableComponent
,InitializableComponent
,MessageHandler
public class SAMLProtocolAndRoleHandler extends AbstractMessageHandler
SAMLMessageHandler
that attaches protocol and role information to a message context viaSAMLProtocolContext
and an instance ofAbstractSAMLEntityContext
objects. 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 ContextDataLookupFunction<MessageContext,? extends BaseContext>
copyContextLookup
Optional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.private Class<? extends AbstractSAMLEntityContext>
entityContextClass
The context class representing the SAML entity for whom data is to be attached.private QName
peerRole
Role type to add to context.private String
samlProtocol
Protocol 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 void
doInitialize()
protected void
doInvoke(MessageContext messageContext)
void
setCopyContextLookup(ContextDataLookupFunction<MessageContext,? extends 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.void
setEntityContextClass(Class<? extends AbstractSAMLEntityContext> clazz)
Set the class type holding the SAML entity data.void
setProtocol(String protocol)
Set the protocol constant to attach.void
setRole(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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.shibboleth.utilities.java.support.component.InitializableComponent
initialize, 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 AbstractSAMLEntityContext> entityContextClass
The context class representing the SAML entity for whom data is to be attached. Defaults to:SAMLPeerEntityContext
.
-
copyContextLookup
@Nullable private ContextDataLookupFunction<MessageContext,? extends 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 ContextDataLookupFunction<MessageContext,? extends 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 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 ComponentInitializationException
- Overrides:
doInitialize
in classAbstractInitializableComponent
- Throws:
ComponentInitializationException
-
doInvoke
protected void doInvoke(MessageContext messageContext) throws MessageHandlerException
- Specified by:
doInvoke
in classAbstractMessageHandler
- Throws:
MessageHandlerException
-
-