Class SecurityContextThreadLocalAccessor

java.lang.Object
org.springframework.graphql.execution.SecurityContextThreadLocalAccessor
All Implemented Interfaces:
io.micrometer.context.ThreadLocalAccessor<Object>

public class SecurityContextThreadLocalAccessor extends Object implements io.micrometer.context.ThreadLocalAccessor<Object>
ThreadLocalAccessor to extract and restore security context through SecurityContextHolder. This accessor is automatically registered via ServiceLoader but applies if Spring Security is present on the classpath.
Since:
1.0.0
Author:
Rob Winch, Rossen Stoyanchev
  • Constructor Details

    • SecurityContextThreadLocalAccessor

      public SecurityContextThreadLocalAccessor()
  • Method Details

    • key

      public Object key()
      Specified by:
      key in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • getValue

      public Object getValue()
      Specified by:
      getValue in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • setValue

      public void setValue(Object value)
      Specified by:
      setValue in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • setValue

      public void setValue()
      Specified by:
      setValue in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • reset

      @Deprecated(since="1.3.0", forRemoval=true) public void reset()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      reset in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • restore

      public void restore(Object previousValue)
      Specified by:
      restore in interface io.micrometer.context.ThreadLocalAccessor<Object>
    • restoreInternal

      public <V> void restoreInternal(Object previousValue)
    • restore

      public void restore()
      Specified by:
      restore in interface io.micrometer.context.ThreadLocalAccessor<Object>