Class ShellMessageHeaderAccessor

java.lang.Object
org.springframework.messaging.support.MessageHeaderAccessor
org.springframework.shell.jline.tui.component.message.ShellMessageHeaderAccessor

public class ShellMessageHeaderAccessor extends org.springframework.messaging.support.MessageHeaderAccessor
Adds standard shell Headers.
Author:
Janne Valkealahti, Piotr Olaszewski
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Raw source message.
    static final String
     
    static final String
    Raw source message.
    static final String
     

    Fields inherited from class org.springframework.messaging.support.MessageHeaderAccessor

    DEFAULT_CHARSET
  • Constructor Summary

    Constructors
    Constructor
    Description
    ShellMessageHeaderAccessor(@Nullable org.springframework.messaging.Message<?> message)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable EventLoop.Type
    Get a EventLoop.Type header if present.
    <T> @Nullable T
    getHeader(String key, Class<T> type)
     
    @Nullable Integer
     
    @Nullable reactor.util.context.ContextView
    Get a ContextView header if present.
    @Nullable View
     
    boolean
    isReadOnly(String headerName)
     
    void
    setReadOnlyHeaders(String... readOnlyHeaders)
    Specify a list of headers which should be considered as read only and prohibited from being populated in the message.
     
    protected void
    verifyType(@Nullable String headerName, @Nullable Object headerValue)
     

    Methods inherited from class org.springframework.messaging.support.MessageHeaderAccessor

    copyHeaders, copyHeadersIfAbsent, createAccessor, fromMap, fromMessageHeaders, getAccessor, getAccessor, getAccessor, getContentType, getDetailedLogMessage, getDetailedPayloadLogMessage, getErrorChannel, getHeader, getId, getMessageHeaders, getMutableAccessor, getReplyChannel, getShortLogMessage, getShortPayloadLogMessage, getTimestamp, isModified, isMutable, isReadableContentType, removeHeader, removeHeaders, setContentType, setErrorChannel, setErrorChannelName, setHeader, setHeaderIfAbsent, setImmutable, setLeaveMutable, setModified, setReplyChannel, setReplyChannelName, toMessageHeaders, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • ShellMessageHeaderAccessor

      public ShellMessageHeaderAccessor(@Nullable org.springframework.messaging.Message<?> message)
  • Method Details

    • setReadOnlyHeaders

      public void setReadOnlyHeaders(String... readOnlyHeaders)
      Specify a list of headers which should be considered as read only and prohibited from being populated in the message.
      Parameters:
      readOnlyHeaders - the list of headers for readOnly mode. Defaults to MessageHeaders.ID and MessageHeaders.TIMESTAMP.
      See Also:
    • getPriority

      public @Nullable Integer getPriority()
    • getView

      public @Nullable View getView()
    • getReactorContext

      public @Nullable reactor.util.context.ContextView getReactorContext()
      Get a ContextView header if present.
      Returns:
      the ContextView header if present.
    • getEventType

      public @Nullable EventLoop.Type getEventType()
      Get a EventLoop.Type header if present.
      Returns:
      the EventLoop.Type header if present.
    • getHeader

      public <T> @Nullable T getHeader(String key, Class<T> type)
    • verifyType

      protected void verifyType(@Nullable String headerName, @Nullable Object headerValue)
      Overrides:
      verifyType in class org.springframework.messaging.support.MessageHeaderAccessor
    • isReadOnly

      public boolean isReadOnly(String headerName)
      Overrides:
      isReadOnly in class org.springframework.messaging.support.MessageHeaderAccessor
    • toMap

      public Map<String,Object> toMap()
      Overrides:
      toMap in class org.springframework.messaging.support.MessageHeaderAccessor