jar-invoke

Elasticsearch plugin to invoke Java code

Лицензия

Лицензия

Группа

Группа

com.github.pukkaone
Идентификатор

Идентификатор

jar-invoke
Последняя версия

Последняя версия

6.5.4-1
Дата

Дата

Тип

Тип

zip
Описание

Описание

jar-invoke
Elasticsearch plugin to invoke Java code
Ссылка на сайт

Ссылка на сайт

https://github.com/pukkaone/jar-invoke
Система контроля версий

Система контроля версий

https://github.com/pukkaone/jar-invoke

Скачать jar-invoke

Зависимости

compile (3)

Идентификатор библиотеки Тип Версия
org.antlr : antlr4-runtime jar 4.7
org.jboss.shrinkwrap.resolver : shrinkwrap-resolver-impl-maven jar 2.2.6
org.glassfish.jaxb : jaxb-runtime jar 2.4.0-b180830.0438

test (2)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.assertj : assertj-core jar 3.9.0

Модули Проекта

Данный проект не имеет модулей.

Jar invoke Elasticsearch plugin  Maven Central

To execute custom code in Elasticsearch, you can write an Elasticsearch plugin. However, a plugin introduces an operational complication. To deploy a new version of an Elasticsearch plugin, you need to restart every node in the Elasticsearch cluster where the plugin is installed. This plugin loads Java code at runtime, so you can deploy new code without needing to restart the Elasticsearch nodes.

SECURITY WARNING

This plugin allows scripts to download and execute arbitrary code from the Internet. Installing it will make your information security officer cry.

Install

Install the plugin using the command:

elasticsearch-plugin install com.github.pukkaone:jar-invoke:VERSION

Usage

This plugin adds a script language named jar-invoke which implements statements to load and invoke Java code.

Require JAR file

Load JAR artifact from a Maven repository if not already loaded.

module = require(' repositoryUri ', ' jarCoordinates ')

Parameter Description

module

name to assign to module

repositoryUri

Maven repository URI

jarCoordinates

Maven artifact coordinates, in format groupId:artifactId:version

Invoke Java static method

Invoke static method of a Java class in a loaded JAR file.

module .invoke(' className ', ' methodName ')

Parameter Description

module

name of loaded module

className

Java class name

methodName

Java method name

Example:
hello = require('http://repository.example.com/', 'com.example:hello:1.0')
hello.invoke('com.example.Hello', 'greet')

The Java method must have accept two Map parameters:

public static Object greet(Map<String, Object> variables, Map<String, ScriptDocValues> docLookup) {

Load JAR file

Load JAR artifact from a Maven repository even if it was already loaded.

module = load(' repositoryUri ', ' jarCoordinates ')

Parameter Description

module

name to assign to module

repositoryUri

Maven repository URI

jarCoordinates

Maven artifact coordinates, in format groupId:artifactId:version

Example:
hello = load('http://repository.example.com/', 'com.example:hello:1.0')

Версии библиотеки

Версия
6.5.4-1
6.5.4-0
6.3.2-1
6.3.2-0
6.3.1-0
6.3.0-0
6.2.4-0
6.2.3-0
6.2.2-0
6.2.1-0
6.1.3-0
6.1.2-0
6.1.1-0
2.4.5-2
2.4.5-1
2.4.5-0