Sha256: 2d821d54f8a1ea520332df5fb35f67bcb405f69cada3b6e28d9ade0841434aed

Contents?: true

Size: 1.15 KB

Versions: 30

Compression:

Stored size: 1.15 KB

Contents

# encoding: utf-8
require "logstash-input-http_jars"

module LogStash module Inputs class Http
  class MessageHandler
    include org.logstash.plugins.inputs.http.IMessageHandler

    attr_reader :input

    def initialize(input, default_codec, additional_codecs, auth_token)
      @input = input
      @default_codec = default_codec
      @additional_codecs = additional_codecs
      @auth_token = auth_token
    end

    def validates_token(token)
      if @auth_token
        @auth_token == token
      else
        true
      end
    end

    def requires_token
      !!@auth_token
    end

    def onNewMessage(remote_address, headers, body)
      @input.decode_body(headers, remote_address, body, @default_codec, @additional_codecs)
    end

    def copy
      MessageHandler.new(@input, @default_codec.clone, clone_additional_codecs(), @auth_token)
    end

    def clone_additional_codecs
      clone_additional_codecs = {}
      @additional_codecs.each do |content_type, codec|
        clone_additional_codecs[content_type] = codec.clone
      end
      clone_additional_codecs
    end

    def response_headers
      @input.response_headers
    end
  end
end; end; end

Version data entries

30 entries across 30 versions & 4 rubygems

Version Path
logstash-input-http-3.9.2-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.9.1-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.9.0-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.8.1-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.8.0-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.7.3-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.7.2-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.7.1-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.7.0-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.6.1-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.6.0-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.5.1-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.5.0-java lib/logstash/inputs/http/message_handler.rb
sp-logstash-input-http-3.3.9-java lib/logstash/inputs/http/message_handler.rb
sp-logstash-input-http-3.3.8-java lib/logstash/inputs/http/message_handler.rb
sp-logstash-input-http-3.3.7-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.4.5-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.4.4-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.4.3-java lib/logstash/inputs/http/message_handler.rb
logstash-input-http-3.4.2-java lib/logstash/inputs/http/message_handler.rb