Package net.shibboleth.idp.authn.context

# Class SubjectCanonicalizationContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
net.shibboleth.idp.authn.context.SubjectCanonicalizationContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

public final class SubjectCanonicalizationContext extends BaseContext
A context that holds an input `Subject` to canonicalize into a principal name, and the collection of c14n flows to attempt.

There are different use cases in the system for the c14n process, but all of them share the use of this context as the input and output mechanism.

Parent:
  `ProfileRequestContext`
Added:
  At the end of a login flow or before any other execution of the subject canonicalization flow

## Nested Class Summary

## Nested classes/interfaces inherited from class org.opensaml.messaging.context.BaseContext

`BaseContext.ContextSetNoRemoveIteratorDecorator, BaseContext.DeprecatedContextClassNameLookAside`

## Field Summary

Fields
Modifier and Type
Field
Description
`private SubjectCanonicalizationFlowDescriptor`
`attemptedFlow`
The last c14 flow attempted.
`private Exception`
`canonicalizationError`
Exception raised by a failed canonicalization.
`private final Map<String,SubjectCanonicalizationFlowDescriptor>`
`intermediateFlows`
Previously attempted flows (could be failures or intermediate results).
`private final Map<String,SubjectCanonicalizationFlowDescriptor>`
`potentialFlows`
Flows that could potentially be used.
`private String`
`principalName`
Canonical principal name of subject.
`private String`
`requesterId`
Requester ID.
`private String`
`responderId`
Responder ID.
`private Subject`
`subject`
Subject to canonicalize.

## Constructor Summary

Constructors
Constructor
Description
`SubjectCanonicalizationContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`SubjectCanonicalizationFlowDescriptor`
`getAttemptedFlow()`
Get the last flow that was attempted for subject c14n.
`Exception`
`getException()`
Get the exception raised by a failed canonicalization.
`Map<String,SubjectCanonicalizationFlowDescriptor>`
`getIntermediateFlows()`
Get the set of flows that have been executed, successfully or otherwise, without producing a completed result.
`Map<String,SubjectCanonicalizationFlowDescriptor>`
`getPotentialFlows()`
Get the set of flows that could potentially be used for subject canonicalization.
`String`
`getPrincipalName()`
Get the canonical principal name of the subject.
`String`
`getRequesterId()`
Get the requester's ID.
`String`
`getResponderId()`
Get the responder's ID.
`Subject`
`getSubject()`
Get the `Subject` to canonicalize.
`SubjectCanonicalizationContext`
`setAttemptedFlow(SubjectCanonicalizationFlowDescriptor flow)`
Set the last flow that was attempted for subject c14n.
`SubjectCanonicalizationContext`
`setException(Exception e)`
Set the exception raised by a failed canonicalization.
`SubjectCanonicalizationContext`
`setPrincipalName(String name)`
Set the canonical principal name of the subject.
`SubjectCanonicalizationContext`
`setRequesterId(String id)`
Set the requester's ID.
`SubjectCanonicalizationContext`
`setResponderId(String id)`
Set the responder's ID.
`SubjectCanonicalizationContext`
`setSubject(Subject newSubject)`
Set the `Subject` to canonicalize.

### Methods inherited from class org.opensaml.messaging.context.BaseContext

`addSubcontext, addSubcontext, clearSubcontexts, containsSubcontext, createSubcontext, ensureSubcontext, ensureSubcontext, getParent, getSubcontext, getSubcontext, getSubcontext, getSubcontext, iterator, removeFromParent, removeSubcontext, removeSubcontext, setParent`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.lang.Iterable

`forEach, spliterator`

## Field Details

### subject

@Nullable private Subject subject
Subject to canonicalize.

### principalName

@Nullable private String principalName
Canonical principal name of subject.

### requesterId

@Nullable private String requesterId
Requester ID.

### responderId

@Nullable private String responderId
Responder ID.

### potentialFlows

@Nonnull private final Map<String,SubjectCanonicalizationFlowDescriptor> potentialFlows
Flows that could potentially be used.

### intermediateFlows

@Nonnull private final Map<String,SubjectCanonicalizationFlowDescriptor> intermediateFlows
Previously attempted flows (could be failures or intermediate results).

### attemptedFlow

@Nullable private SubjectCanonicalizationFlowDescriptor attemptedFlow
The last c14 flow attempted.

### canonicalizationError

@Nullable private Exception canonicalizationError
Exception raised by a failed canonicalization.

## Constructor Details

### SubjectCanonicalizationContext

public SubjectCanonicalizationContext()
Constructor.

## Method Details

### getSubject

@Nullable public Subject getSubject()
Get the `Subject` to canonicalize.

Returns:
  Subject to canonicalize

### setSubject

@Nonnull public SubjectCanonicalizationContext setSubject(@Nullable Subject newSubject)
Set the `Subject` to canonicalize.

Parameters:
  `newSubject` - Subject to canonicalize
Returns:
  this context

### getPrincipalName

@Nullable public String getPrincipalName()
Get the canonical principal name of the subject.

Returns:
  the canonical principal name

### setPrincipalName

@Nonnull public SubjectCanonicalizationContext setPrincipalName(@Nullable String name)
Set the canonical principal name of the subject.

Parameters:
  `name` - the canonical principal name
Returns:
  this context

### getException

@Nullable public Exception getException()
Get the exception raised by a failed canonicalization.

Returns:
  exception raised by a failed canonicalization

### setException

@Nonnull public SubjectCanonicalizationContext setException(@Nullable Exception e)
Set the exception raised by a failed canonicalization.

Parameters:
  `e` - exception raised by a failed canonicalization
Returns:
  this context

### getRequesterId

@Nullable public String getRequesterId()
Get the requester's ID.

Returns:
  the requester's ID

### setRequesterId

@Nonnull public SubjectCanonicalizationContext setRequesterId(@Nullable String id)
Set the requester's ID.

Parameters:
  `id` - the requester's ID
Returns:
  this context

### getResponderId

@Nullable public String getResponderId()
Get the responder's ID.

Returns:
  the responder's ID

### setResponderId

@Nonnull public SubjectCanonicalizationContext setResponderId(@Nullable String id)
Set the responder's ID.

Parameters:
  `id` - the responder's ID
Returns:
  this context

### getPotentialFlows

@Nonnull @Live public Map<String,SubjectCanonicalizationFlowDescriptor> getPotentialFlows()
Get the set of flows that could potentially be used for subject canonicalization.

Returns:
  the potential flows

### getIntermediateFlows

@Nonnull @Live public Map<String,SubjectCanonicalizationFlowDescriptor> getIntermediateFlows()
Get the set of flows that have been executed, successfully or otherwise, without producing a completed result.

Returns:
  the intermediately executed flows

### getAttemptedFlow

@Nullable public SubjectCanonicalizationFlowDescriptor getAttemptedFlow()
Get the last flow that was attempted for subject c14n.

Returns:
  last flow that was attempted for subject c14n

### setAttemptedFlow

@Nonnull public SubjectCanonicalizationContext setAttemptedFlow(@Nullable SubjectCanonicalizationFlowDescriptor flow)
Set the last flow that was attempted for subject c14n.

Parameters:
  `flow` - last flow that was attempted for subject c14n
Returns:
  this context