Package net.shibboleth.idp.profile.impl

# Class LogContextTree

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.profile.impl.LogContextTree

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

public class LogContextTree extends AbstractProfileAction
Spring Web Flow utility action for logging on DEBUG a representation of the current `ProfileRequestContext`.

You can contextualize the logging of the context tree either by setting `setDescription(String)`, or more usefully by using an attribute on the specific action expression as below. This allows using just one declaration of the action bean, but parameterized differently depending on where it is placed.

     <evaluate expression="LogContextTree">
        <attribute name="contextTreeDescription" value="My Description" />
     </evaluate>

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ATTRIB_DESC`
Name of Spring web flow attribute holding the description of the tree to log.
`private String`
`description`
Contextual description to output at the start of the action.
`private org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`LogContextTree()`

## Method Summary

Modifier and Type
Method
Description
`protected void`
`doExecute(ProfileRequestContext profileRequestContext)`
`private String`
`getIndent(int indent)`
Generate the leading indent string to print.
`private void`
`logContext(BaseContext current, int indent)`
Recursively log the context tree.
`void`
`setDescription(String value)`
Set the contextual description to output at the start of the action.

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

`doPreExecute, 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

### ATTRIB_DESC

@Nonnull @NotEmpty public static final String ATTRIB_DESC
Name of Spring web flow attribute holding the description of the tree to log.

See Also:
  - Constant Field Values

### log

@Nonnull private org.slf4j.Logger log
Logger.

### description

@Nullable private String description
Contextual description to output at the start of the action.

## Constructor Details

### LogContextTree

public LogContextTree()

## Method Details

### setDescription

public void setDescription(@Nullable String value)
Set the contextual description to output at the start of the action.

Parameters:
  `value` - the description value

### doExecute

protected void doExecute(@Nonnull ProfileRequestContext profileRequestContext)

Overrides:
  `doExecute` in class `AbstractProfileAction`

### logContext

private void logContext(@Nullable BaseContext current, int indent)
Recursively log the context tree.

Parameters:
  `current` - the current context to log
  `indent` - the amount of leading indent

### getIndent

@Nonnull private String getIndent(int indent)
Generate the leading indent string to print.

Parameters:
  `indent` - the amount of the indent
Returns:
  the leading indent string to print