Class SettingsBodyParser


  • public class SettingsBodyParser
    extends BodyParser
    • Field Detail

      • LOG

        private static final org.eclipse.jetty.util.log.Logger LOG
      • maxKeys

        private final int maxKeys
      • cursor

        private int cursor
      • length

        private int length
      • settingId

        private int settingId
      • settingValue

        private int settingValue
      • keys

        private int keys
      • settings

        private java.util.Map<java.lang.Integer,​java.lang.Integer> settings
    • Method Detail

      • reset

        protected void reset()
      • getMaxKeys

        public int getMaxKeys()
      • emptyBody

        protected void emptyBody​(java.nio.ByteBuffer buffer)
        Overrides:
        emptyBody in class BodyParser
      • validateFrame

        private boolean validateFrame​(java.nio.ByteBuffer buffer,
                                      int streamId,
                                      int bodyLength)
      • parse

        public boolean parse​(java.nio.ByteBuffer buffer)
        Description copied from class: BodyParser

        Parses the body bytes in the given buffer; only the body bytes are consumed, therefore when this method returns, the buffer may contain unconsumed bytes.

        Specified by:
        parse in class BodyParser
        Parameters:
        buffer - the buffer to parse
        Returns:
        true if the whole body bytes were parsed, false if not enough body bytes were present in the buffer
      • parse

        private boolean parse​(java.nio.ByteBuffer buffer,
                              int streamId,
                              int bodyLength)
      • onSetting

        protected boolean onSetting​(java.nio.ByteBuffer buffer,
                                    java.util.Map<java.lang.Integer,​java.lang.Integer> settings,
                                    int key,
                                    int value)
      • onSettings

        protected boolean onSettings​(java.nio.ByteBuffer buffer,
                                     java.util.Map<java.lang.Integer,​java.lang.Integer> settings)
      • onSettings

        private boolean onSettings​(java.nio.ByteBuffer buffer,
                                   SettingsFrame frame)
      • parseBody

        public static SettingsFrame parseBody​(java.nio.ByteBuffer buffer)

        Parses the given buffer containing the whole body of a SETTINGS frame (without header bytes), typically from the HTTP2-Settings header.

        Parameters:
        buffer - the buffer containing the body of SETTINGS frame
        Returns:
        the SETTINGS frame from the parsed body bytes