Class SAMLProtocolAndRoleHandler
java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.messaging.handler.AbstractMessageHandler
org.opensaml.saml.common.binding.impl.SAMLProtocolAndRoleHandler
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,MessageHandler
SAML
MessageHandler that attaches protocol
and role information to a message context via SAMLProtocolContext and
an instance of AbstractSAMLEntityContext objects. The entity context class
is configurable and defaults to SAMLPeerEntityContext.
A profile flow would typically run this handler after message decoding occurs, to bootstrap subsequent handlers.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ContextDataLookupFunction<MessageContext,? extends BaseContext> 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>The context class representing the SAML entity for whom data is to be attached.private QNameRole type to add to context.private StringProtocol value to add to context. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidprotected voiddoInvoke(MessageContext messageContext) Performs the handler logic.voidsetCopyContextLookup(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.voidsetEntityContextClass(Class<? extends AbstractSAMLEntityContext> clazz) Set the class type holding the SAML entity data.voidsetProtocol(String protocol) Set the protocol constant to attach.voidSet the operational role to attach.Methods inherited from class org.opensaml.messaging.handler.AbstractMessageHandler
doPostInvoke, doPostInvoke, doPreInvoke, getActivationCondition, getLogPrefix, invoke, isPreInvokeCalled, setActivationConditionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.InitializableComponent
initialize, isInitialized
-
Field Details
-
samlProtocol
Protocol value to add to context. -
peerRole
Role type to add to context. -
entityContextClass
The context class representing the SAML entity for whom data is to be attached. Defaults to:SAMLPeerEntityContext. -
copyContextLookup
Optional lookup function for a context from which to copy the protocol and role data, for example from a parent operation context.
-
-
Constructor Details
-
SAMLProtocolAndRoleHandler
public SAMLProtocolAndRoleHandler()
-
-
Method Details
-
setEntityContextClass
Set the class type holding the SAML entity data.Defaults to:
SAMLPeerEntityContext.- Parameters:
clazz- the entity context class type
-
setProtocol
Set the protocol constant to attach.- Parameters:
protocol- the protocol constant to set
-
setRole
Set the operational role to attach.- Parameters:
role- the operational role to set
-
doInitialize
- Overrides:
doInitializein classAbstractInitializableComponent- Throws:
ComponentInitializationException
-
doInvoke
Performs the handler logic.- Specified by:
doInvokein classAbstractMessageHandler- Parameters:
messageContext- the message context on which to invoke the handler- Throws:
MessageHandlerException- if there is an error invoking the handler on the message context