Package org.opensaml.profile.context

# Class ProfileRequestContext

java.lang.Object
org.opensaml.messaging.context.BaseContext
org.opensaml.messaging.context.InOutOperationContext
org.opensaml.profile.context.ProfileRequestContext

All Implemented Interfaces:
  `Iterable<BaseContext>`

@ThreadSafe public final class ProfileRequestContext extends InOutOperationContext
Context that holds the ongoing state of a profile request.

## 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
`static final String`
`ANONYMOUS_PROFILE_ID`
Profile ID if not overridden.
`static final String`
`BINDING_KEY`
ID under which this context is stored, for example, within maps or sessions.
`private boolean`
`browserProfile`
Whether the current profile request is browser-based.
`private String`
`legacyProfileId`
Legacy profile ID used to migrate a profile to a new value.
`private String`
`loggingId`
Logging label for the profile/operation/function .
`private String`
`profileId`
Unique identifier for the profile/operation/function of the current request.

## Constructor Summary

Constructors
Constructor
Description
`ProfileRequestContext()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getLegacyProfileId()`
Get the legacy ID of the profile used by the current request.
`String`
`getLoggingId()`
Get the logging ID of the profile used by the current request.
`String`
`getProfileId()`
Get the ID of the profile used by the current request.
`boolean`
`isBrowserProfile()`
Get whether the current profile request is browser-based (defaults to false).
`void`
`setBrowserProfile(boolean browser)`
Set whether the current profile request is browser-based.
`void`
`setLegacyProfileId(String id)`
Set the legacy ID of the profile used by the current request.
`void`
`setLoggingId(String id)`
Set the logging ID of the profile used by the current request.
`void`
`setProfileId(String id)`
Set the ID of the profile used by the current request.

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

`ensureInboundMessageContext, ensureOutboundMessageContext, getInboundMessageContext, getOutboundMessageContext, setInboundMessageContext, setOutboundMessageContext`

### 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

### BINDING_KEY

@Nonnull @NotEmpty public static final String BINDING_KEY
ID under which this context is stored, for example, within maps or sessions.

See Also:
  - Constant Field Values

### ANONYMOUS_PROFILE_ID

@Nonnull @NotEmpty public static final String ANONYMOUS_PROFILE_ID
Profile ID if not overridden.

See Also:
  - Constant Field Values

### profileId

@Nonnull @NotEmpty private String profileId
Unique identifier for the profile/operation/function of the current request.

### legacyProfileId

@Nullable @NotEmpty private String legacyProfileId
Legacy profile ID used to migrate a profile to a new value.

### loggingId

@Nonnull @NotEmpty private String loggingId
Logging label for the profile/operation/function .

### browserProfile

private boolean browserProfile
Whether the current profile request is browser-based.

## Constructor Details

### ProfileRequestContext

public ProfileRequestContext()
Constructor.

## Method Details

### getProfileId

@Nonnull @NotEmpty public String getProfileId()
Get the ID of the profile used by the current request.

Returns:
  ID of the profile used by the current request

### setProfileId

public void setProfileId(@Nullable String id)
Set the ID of the profile used by the current request.

Parameters:
  `id` - ID of the profile used by the current request

### getLegacyProfileId

@Nullable @NotEmpty public String getLegacyProfileId()
Get the legacy ID of the profile used by the current request.

This is a migration aid for scenarios in which a profile is migrated to a new ID so that the original value can be supplied as a fallback. In most cases it will be null.

Returns:
  legacy profile ID
Since:
  4.2.0

### setLegacyProfileId

public void setLegacyProfileId(@Nullable String id)
Set the legacy ID of the profile used by the current request.

Parameters:
  `id` - legacy profile ID
Since:
  4.2.0

### getLoggingId

@Nonnull @NotEmpty public String getLoggingId()
Get the logging ID of the profile used by the current request.

The logging ID is used for audit logging and may be used for other logging-related functions such as in diagnostic contexts.

Returns:
  ID of the profile used for logging

### setLoggingId

public void setLoggingId(@Nullable String id)
Set the logging ID of the profile used by the current request.

The logging ID is used for audit logging and may be used for other logging-related functions such as in diagnostic contexts.

Parameters:
  `id` - ID of the profile used for logging

### isBrowserProfile

public boolean isBrowserProfile()
Get whether the current profile request is browser-based (defaults to false).

Returns:
  whether the current profile request is browser-based

### setBrowserProfile

public void setBrowserProfile(boolean browser)
Set whether the current profile request is browser-based.

Parameters:
  `browser` - whether the current profile request is browser-based