Package net.shibboleth.idp.admin.impl

# Class OutputConfig

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.admin.impl.OutputConfig

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

public class OutputConfig extends AbstractProfileAction
Action that outputs the settings from the effective `ProfileConfiguration` and so on.

On success, a 200 HTTP status is returned. On failure, a non-successful HTTP status is returned.

Since:
  5.0.0
Event:
  `EventIds.PROCEED_EVENT_ID`, `EventIds.INVALID_PROFILE_CTX`, `IdPEventIds.INVALID_RELYING_PARTY_CTX`, `IdPEventIds.INVALID_RELYING_PARTY_CONFIG`, `IdPEventIds.INVALID_PROFILE_CONFIG`, `EventIds.IO_ERROR`

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`private static class`
`OutputConfig.PrincipalSerializer`
Custom serializer for `Principal` objects in config.
`private static class`
`OutputConfig.RequestedAttributeSerializer`
Custom serializer for `Principal` objects in config.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`allowedOrigin`
Value for Access-Control-Allow-Origin header, if any.
`private String`
`jsonpCallbackName`
Name of JSONP callback function, if any.
`private org.slf4j.Logger`
`log`
Class logger.
`private RelyingPartyContext`
`relyingPartyContext`
Relying party context.
`private Function<ProfileRequestContext,RelyingPartyContext>`
`relyingPartyContextLookupStrategy`
Lookup strategy for `RelyingPartyContext`.

## Constructor Summary

Constructors
Constructor
Description
`OutputConfig()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`private void`
`addSetting(Map<String,Object> settings, String name, Object obj)`
Process a setting by adding it to the map if it's suitable for output.
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`protected boolean`
`doPreExecute(ProfileRequestContext profileRequestContext)`
`private Map<String,Object>`
`getConfig(ProfileRequestContext profileRequestContext)`
Extract configuration settings into a map to output.
`private Map<String,Object>`
`getSettings(ProfileRequestContext profileRequestContext, Object target)`
Interrogate a target object for configuration settings, extract them, and return in a map.
`private boolean`
`isPrimitive(Object o)`
Check an object for whether it's a boxed primitive type or one of the time wrappers.
`void`
`setAllowedOrigin(String origin)`
Set the value of the Access-Control-Allow-Origin CORS header, if any.
`void`
`setJSONPCallbackName(String callbackName)`
Set a JSONP callback function to wrap the result in, if any.
`void`
`setRelyingPartyContextLookupStrategy(Function<ProfileRequestContext,RelyingPartyContext> strategy)`
Set the lookup strategy to locate the `RelyingPartyContext`.

### 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, doInitialize, 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 org.slf4j.Logger log
Class logger.

### allowedOrigin

@Nullable private String allowedOrigin
Value for Access-Control-Allow-Origin header, if any.

### jsonpCallbackName

@Nullable private String jsonpCallbackName
Name of JSONP callback function, if any.

### relyingPartyContextLookupStrategy

@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategy
Lookup strategy for `RelyingPartyContext`.

### relyingPartyContext

@NonnullBeforeExec private RelyingPartyContext relyingPartyContext
Relying party context.

## Constructor Details

### OutputConfig

public OutputConfig()
Constructor.

## Method Details

### setAllowedOrigin

public void setAllowedOrigin(@Nullable String origin)
Set the value of the Access-Control-Allow-Origin CORS header, if any.

Parameters:
  `origin` - header value

### setJSONPCallbackName

public void setJSONPCallbackName(@Nullable String callbackName)
Set a JSONP callback function to wrap the result in, if any.

Parameters:
  `callbackName` - callback function name.

### setRelyingPartyContextLookupStrategy

public void setRelyingPartyContextLookupStrategy(@Nonnull Function<ProfileRequestContext,RelyingPartyContext> strategy)
Set the lookup strategy to locate the `RelyingPartyContext`.

Parameters:
  `strategy` - lookup strategy

### doPreExecute

protected boolean doPreExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doPreExecute` in class `AbstractConditionalProfileAction`

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### getConfig

@Nonnull @NullableElements private Map<String,Object> getConfig(@Nonnull ProfileRequestContext profileRequestContext)
Extract configuration settings into a map to output.

Parameters:
  `profileRequestContext` - profile request context
Returns:
  configuration settings map

### getSettings

@Nonnull @NullableElements @Unmodifiable @NotLive private Map<String,Object> getSettings(@Nonnull ProfileRequestContext profileRequestContext, @Nonnull Object target)
Interrogate a target object for configuration settings, extract them, and return in a map.

Parameters:
  `profileRequestContext` - profile request context
  `target` - target object
Returns:
  map of settings

### addSetting

private void addSetting(@Nonnull Map<String,Object> settings, @Nonnull String name, @Nonnull Object obj)
Process a setting by adding it to the map if it's suitable for output.

Parameters:
  `settings` - map of settings to be serialized to caller by Jackson
  `name` - name of setting
  `obj` - native/original value of setting

### isPrimitive

private boolean isPrimitive(@Nullable Object o)
Check an object for whether it's a boxed primitive type or one of the time wrappers.

Parameters:
  `o` - object to test
Returns:
  true iff the type of the object is one of the boxed primitive types