Package net.shibboleth.idp.admin.impl
Class OutputConfig
- All Implemented Interfaces:
Component,DestructableComponent,InitializableComponent,ProfileAction,Aware,MessageSource,MessageSourceAware,Action
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.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringValue for Access-Control-Allow-Origin header, if any.private StringName of JSONP callback function, if any.private org.slf4j.LoggerClass logger.private RelyingPartyContextRelying party context.Lookup strategy forRelyingPartyContext. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidProcess a setting by adding it to the map if it's suitable for output.protected voiddoExecute(ProfileRequestContext profileRequestContext) protected booleandoPreExecute(ProfileRequestContext profileRequestContext) getConfig(ProfileRequestContext profileRequestContext) Extract configuration settings into a map to output.getSettings(ProfileRequestContext profileRequestContext, Object target) Interrogate a target object for configuration settings, extract them, and return in a map.private booleanCheck an object for whether it's a boxed primitive type or one of the time wrappers.voidsetAllowedOrigin(String origin) Set the value of the Access-Control-Allow-Origin CORS header, if any.voidsetJSONPCallbackName(String callbackName) Set a JSONP callback function to wrap the result in, if any.voidSet the lookup strategy to locate theRelyingPartyContext.Methods inherited from class net.shibboleth.idp.profile.AbstractProfileAction
doExecute, execute, getBean, getBean, getMessage, getMessage, getMessage, getParameter, getParameter, getProfileContextLookupStrategy, getRequestContext, getResult, setMessageSource, setProfileContextLookupStrategyMethods inherited from class org.opensaml.profile.action.AbstractConditionalProfileAction
getActivationCondition, setActivationConditionMethods inherited from class org.opensaml.profile.action.AbstractProfileAction
doPostExecute, doPostExecute, ensureHttpServletRequest, ensureHttpServletResponse, execute, getHttpServletRequest, getHttpServletRequestSupplier, getHttpServletResponse, getHttpServletResponseSupplier, getLogPrefix, isPreExecuteCalled, setHttpServletRequestSupplier, setHttpServletResponseSupplierMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, 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
-
log
@Nonnull private org.slf4j.Logger logClass logger. -
allowedOrigin
Value for Access-Control-Allow-Origin header, if any. -
jsonpCallbackName
Name of JSONP callback function, if any. -
relyingPartyContextLookupStrategy
@Nonnull private Function<ProfileRequestContext,RelyingPartyContext> relyingPartyContextLookupStrategyLookup strategy forRelyingPartyContext. -
relyingPartyContext
Relying party context.
-
-
Constructor Details
-
OutputConfig
public OutputConfig()Constructor.
-
-
Method Details
-
setAllowedOrigin
Set the value of the Access-Control-Allow-Origin CORS header, if any.- Parameters:
origin- header value
-
setJSONPCallbackName
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 theRelyingPartyContext.- Parameters:
strategy- lookup strategy
-
doPreExecute
- Overrides:
doPreExecutein classAbstractConditionalProfileAction
-
doExecute
- Overrides:
doExecutein classAbstractProfileAction
-
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 contexttarget- 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 Jacksonname- name of settingobj- native/original value of setting
-
isPrimitive
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
-