Package net.shibboleth.idp.cas.flow.impl

# Class PrepareTicketValidationResponseAction

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
org.opensaml.profile.action.AbstractProfileAction
org.opensaml.profile.action.AbstractConditionalProfileAction
net.shibboleth.idp.profile.AbstractProfileAction
net.shibboleth.idp.cas.flow.impl.AbstractCASProtocolAction<TicketValidationRequest,TicketValidationResponse>
net.shibboleth.idp.cas.flow.impl.PrepareTicketValidationResponseAction

All Implemented Interfaces:
  `Component`, `DestructableComponent`, `InitializableComponent`, `ProfileAction`, `Aware`, `MessageSource`, `MessageSourceAware`, `Action`

public class PrepareTicketValidationResponseAction extends AbstractCASProtocolAction<TicketValidationRequest,TicketValidationResponse>
Prepares `TicketValidationResponse` for use in CAS protocol response views. Possible outcomes:

- `null` on success
- `IllegalState`

## Field Summary

Fields
Modifier and Type
Field
Description
`private AttributeContext`
`attributeContext`
Stored off context from request.
`private Function<ProfileRequestContext,AttributeContext>`
`attributeContextFunction`
Function used to retrieve AttributeContext.
`private final ConfigLookupFunction<ValidateConfiguration>`
`configLookupFunction`
Profile configuration lookup function.
`private Set<String>`
`consentedAttributeIds`
Stored consented attributes from ticket.
`private TranscodingRule`
`defaultTranscodingRule`
Fallback rule that does a simple/default encode.
`private final org.slf4j.Logger`
`log`
Class logger.
`private Function<ProfileRequestContext,String>`
`principalLookupFunction`
Function used to retrieve subject principal.
`private TicketValidationResponse`
`ticketValidationResponse`
CAS response.
`private ReloadableService<AttributeTranscoderRegistry>`
`transcoderRegistry`
Transcoder registry service object.
`private ValidateConfiguration`
`validateConfiguration`
Profile configuration.

## Constructor Summary

Constructors
Constructor
Description
`PrepareTicketValidationResponseAction()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected void`
`doInitialize()`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`protected int`
`encodeAttribute(AttributeTranscoderRegistry registry, ProfileRequestContext profileRequestContext, IdPAttribute attribute, Collection<Attribute> results)`
Access the registry of transcoding rules to transform the input attribute into a target type.
`void`
`setTranscoderRegistry(ReloadableService<AttributeTranscoderRegistry> registry)`
Sets the registry of transcoding rules to apply to encode attributes.

### Methods inherited from class net.shibboleth.idp.cas.flow.impl.AbstractCASProtocolAction

`getCASRequest, getCASResponse, getCASService, getCASTicket, getProtocolContext, setCASRequest, setCASResponse, setCASService, setCASTicket`

### Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction

`doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategy`

### Methods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction

`getActivationCondition, setActivationCondition`

### Methods inherited from class org.opensaml.profile.action.AbstractProfileAction

`doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplier`

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, 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.shared.component.InitializableComponent

`initialize, isInitialized`

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### attributeContextFunction

@Nonnull private Function<ProfileRequestContext,AttributeContext> attributeContextFunction
Function used to retrieve AttributeContext.

### principalLookupFunction

@Nonnull private Function<ProfileRequestContext,String> principalLookupFunction
Function used to retrieve subject principal.

### configLookupFunction

@Nonnull private final ConfigLookupFunction<ValidateConfiguration> configLookupFunction
Profile configuration lookup function.

### transcoderRegistry

@NonnullAfterInit private ReloadableService<AttributeTranscoderRegistry> transcoderRegistry
Transcoder registry service object.

### defaultTranscodingRule

@NonnullAfterInit private TranscodingRule defaultTranscodingRule
Fallback rule that does a simple/default encode.

### attributeContext

@NonnullBeforeExec private AttributeContext attributeContext
Stored off context from request.

### consentedAttributeIds

@Nullable private Set<String> consentedAttributeIds
Stored consented attributes from ticket.

### validateConfiguration

@NonnullBeforeExec private ValidateConfiguration validateConfiguration
Profile configuration.

### ticketValidationResponse

@NonnullBeforeExec private TicketValidationResponse ticketValidationResponse
CAS response.

## Constructor Details

### PrepareTicketValidationResponseAction

public PrepareTicketValidationResponseAction()
Constructor.

## Method Details

### setTranscoderRegistry

public void setTranscoderRegistry(@Nonnull ReloadableService<AttributeTranscoderRegistry> registry)
Sets the registry of transcoding rules to apply to encode attributes.

Parameters:
  `registry` - registry service interface

### doInitialize

protected void doInitialize() throws ComponentInitializationException

Overrides:
  `doInitialize` in class `AbstractInitializableComponent`
Throws:
  `ComponentInitializationException`

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### encodeAttribute

protected int encodeAttribute(@Nonnull AttributeTranscoderRegistry registry, @Nonnull ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull @Live Collection<Attribute> results)
Access the registry of transcoding rules to transform the input attribute into a target type.

Parameters:
  `registry` - registry of transcoding rules
  `profileRequestContext` - current profile request context
  `attribute` - input attribute
  `results` - collection to add results to
Returns:
  number of results added