Renamed ConstructingObjectParser -> ObjectFactory (shorter name, felt more appropriate)
Fields (setters, etc) are now declared using a fluent interface on ObjectFactory and don't need to be done in a `static { ... }` block anymore
Also added back deprecated and obsolete fields.
Previously this was in org.logstash.plugin, and it felt not the right package.
Big code reorg also:
* refactored all the shorthand helpers like declareInteger into default methods of a new ObjectParser interface.
* moved object transforms like transformInteger to a new ObjectTransforms class
This mirrors the current `:deprecated => "details"` and `:obsolete => "details"` in the Ruby side of Logstash.
* When a field is obsolete, using it will raise an exception.
* When a field is deprecated, using it will log a warning.
In tests, I used a trick I learned from Go to make compile-time assertions about return types. This is the reason for `Field x` in various places used in assignment but otherwise not used.
The idea behind ConstructingObjectParser was largely lifted from Elasticsearch's class by the same name. The reasons I liked this approach was that it provided a type-safe way to define how user input (a Map, in Logstash's case) is parsed to create an object like an input plugin.
The ConstructingObjectParser roughly implements in Java what `config/mixin.rb` provides for Ruby plugins.
This class allows us to take a Map that comes from the config parser and
build a pipeline plugin (input, filter, output).
Differences from the ruby api:
* Custom object validation is possible. Example, `http_poller` has a map of `urls` which are `name => { configuration }`, and we can achieve type-safe validation of this `urls` thing which benefits us as plugin authors and benefits users through better error reporting.
* Explicit `default` value is not required because Java class fields already allow you to set default values :)
Some rationale on IllegalArgumentException:
* Object construction will throw IllegalArgumentException upon validation failure. This was chosen because IllegalArgumentException is an unchecked exception we can throw while still satisfying the constraints of the java.util.function interfaces (BiFunction, etc)
The custom serializer introduced in #8371 did change the behavior or JSON
serialization when one of the field was a RubyNil values.
The orignal behavior was to serialize RubyNil values into their
Javascript Null. The PR #8371 changed that behavior to instead
serialized an empty string and changed the expected type.
This commit revert the behavior to serialize to Null and also tests
around the events class to prevent that.
Fixes#8386
final (I hope) fixes for consolidated versioning.
After testing with rake artifact:zip, need to try both files.
Add desc to rake test:install-* tasks, tired of
not seeing them in rake -vT
changes requested via review
Fixes#8373
* Fixes#8344 - Ruby Unit Test can hang with no information as to why
* Fixes#7227 - MetricStore::MetricNotFound
* Fixes#8204 - `config.reload.automatic` is set to`FALSE
I am only certain it fixes#8344 and #7227, since I can not reproduce #8204.
Fixes#8376
Our intent is to ship all commercially supported[1] plugins with
Logstash. By some mistakes, we have omitted a few plugins, and this
commit resolves those omissions.
Fixes#8287Fixes#8318
To understand why we can now remove this gem we have to go back at the
history of LS 1.5 and the choice we made back them. In the begining
plugins depending on external files like the `user-agent` or the `filter-geoip`
were not bundling theses files in the gem.
The `file-dependencies` was providing a new hook when plugins were
installed to trigger the file download.
In the context of making the plugins work in an offline environment we
need to make sure that every plugins external resources are present in
the gem.
We have currently a few plugins that require external files and they all
bundle it. So I think its safe to remove that feature, also the hook was
not triggered correctly. So it was a NOOP.
Fixes#8298
Instead of using rake to bootstrap we are slowly moving part of our
infra to gradle this is the first step taken, I didn't change the calls,
I just made the `rake bootstrap` call the `gradle bootstrap`
Closes: #8234Fixes#8238
Some of the test were still depending on the multiline filter, this
filter is now shipped anymore with Logstash. I've keep the same logic
but created a simple dummy filter.
Fixes#8284