Class ShellMessageHeaderAccessor

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

public class ShellMessageHeaderAccessor extends org.springframework.messaging.support.MessageHeaderAccessor
Adds standard shell Headers.
  • 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(org.springframework.messaging.Message<?> message)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Get a EventLoop.Type header if present.
    <T> T
    getHeader(String key, Class<T> type)
     
     
    reactor.util.context.ContextView
    Get a ContextView header if present.
     
    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(String headerName, Object headerValue)
     

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

    copyHeaders, copyHeadersIfAbsent, createAccessor, 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

      @Nullable public Integer getPriority()
    • getView

      @Nullable public View getView()
    • getReactorContext

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

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

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

      protected void verifyType(String headerName, 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