http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-nar/src/main/resources/META-INF/NOTICE index e5036ea..a471737 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-10-nar/src/main/resources/META-INF/NOTICE @@ -55,6 +55,29 @@ The following binary components are provided under the Apache Software License v Apache ZooKeeper Copyright 2009-2012 The Apache Software Foundation + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. + ************************ Common Development and Distribution License 1.1 ************************
http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-nar/src/main/resources/META-INF/NOTICE index 51251be..851fc98 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-8-nar/src/main/resources/META-INF/NOTICE @@ -55,6 +55,29 @@ The following binary components are provided under the Apache Software License v Apache ZooKeeper Copyright 2009-2012 The Apache Software Foundation + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. + ************************ Common Development and Distribution License 1.1 ************************ http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-nar/src/main/resources/META-INF/NOTICE index 6d18a4d..24b8028 100644 --- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-0-9-nar/src/main/resources/META-INF/NOTICE @@ -55,6 +55,29 @@ The following binary components are provided under the Apache Software License v Apache ZooKeeper Copyright 2009-2012 The Apache Software Foundation + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. + ************************ Common Development and Distribution License 1.1 ************************ http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/src/main/resources/META-INF/NOTICE index 3020fee..3cf3c0e 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-nar/src/main/resources/META-INF/NOTICE @@ -49,3 +49,25 @@ The following binary components are provided under the Apache Software License v Apache License Version 2.0 http://www.apache.org/licenses/. (c) Daniel Lemire, http://lemire.me/en/ + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml index bffc490..0146641 100644 --- a/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml +++ b/nifi-nar-bundles/nifi-kite-bundle/nifi-kite-processors/pom.xml @@ -106,18 +106,6 @@ <artifactId>jsr305</artifactId> </exclusion> <exclusion> - <artifactId>jersey-servlet</artifactId> - <groupId>com.sun.jersey</groupId> - </exclusion> - <exclusion> - <artifactId>jersey-core</artifactId> - <groupId>com.sun.jersey</groupId> - </exclusion> - <exclusion> - <artifactId>jersey-server</artifactId> - <groupId>com.sun.jersey</groupId> - </exclusion> - <exclusion> <artifactId>servlet-api</artifactId> <groupId>javax.servlet</groupId> </exclusion> @@ -263,6 +251,7 @@ <dependency> <groupId>com.sun.jersey</groupId> <artifactId>jersey-servlet</artifactId> + <version>1.19</version> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-nar/src/main/resources/META-INF/NOTICE index 34f4467..07393d9 100644 --- a/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-kudu-bundle/nifi-kudu-nar/src/main/resources/META-INF/NOTICE @@ -49,3 +49,25 @@ The following binary components are provided under the Apache Software License v Apache License Version 2.0 http://www.apache.org/licenses/. (c) Daniel Lemire, http://lemire.me/en/ + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/src/main/resources/META-INF/NOTICE index 91077db..ff3e180 100644 --- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-language-translation-nar/src/main/resources/META-INF/NOTICE @@ -18,17 +18,42 @@ The following binary components are provided under the Apache Software License v This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. + ************************ Common Development and Distribution License 1.1 ************************ The following binary components are provided under the Common Development and Distribution License 1.1. See project link for details. - (CDDL 1.1) (GPL2 w/ CPE) jersey-client (com.sun.jersey:jersey-client:jar:1.18.3 - https://jersey.java.net/jersey-client/) - (CDDL 1.1) (GPL2 w/ CPE) jersey-core (com.sun.jersey:jersey-core:jar:1.18.3 - https://jersey.java.net/jersey-core/) - (CDDL 1.1) (GPL2 w/ CPE) jersey-json (com.sun.jersey:jersey-json:jar:1.18.3 - https://jersey.java.net/jersey-json/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-client (org.glassfish.jersey.core:jersey-client:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-common (org.glassfish.jersey.core:jersey-common:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-entity-filtering (org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-media-json-jackson (org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.26 - https://jersey.github.io/) (CDDL 1.1) (GPL2 w/ CPE) Old JAXB Runtime (com.sun.xml.bind:jaxb-impl:jar:2.2.3-1 - http://jaxb.java.net/) (CDDL 1.1) (GPL2 w/ CPE) Java Architecture For XML Binding (javax.xml.bind:jaxb-api:jar:2.2.2 - https://jaxb.dev.java.net/) + (CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.1 - http://jax-rs-spec.java.net) ************************ Common Development and Distribution License 1.0 @@ -38,5 +63,4 @@ The following binary components are provided under the Common Development and Di (CDDL 1.0) (GPL3) Streaming API For XML (javax.xml.stream:stax-api:jar:1.0-2 - no url provided) (CDDL 1.0) JavaBeans Activation Framework (JAF) (javax.activation:activation:jar:1.1 - http://java.sun.com/products/javabeans/jaf/index.jsp) - (CDDL 1.0) JSR311 API (javax.ws.rs:jsr311-api:jar:1.1.1 - https://jsr311.dev.java.net) http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml index cf49c28..284b682 100644 --- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml +++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/pom.xml @@ -34,14 +34,20 @@ <groupId>org.apache.nifi</groupId> <artifactId>nifi-utils</artifactId> </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> + <groupId>org.apache.nifi</groupId> + <artifactId>nifi-web-utils</artifactId> + </dependency> + + <dependency> + <groupId>org.glassfish.jersey.core</groupId> <artifactId>jersey-client</artifactId> + <version>${jersey.version}</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-json</artifactId> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-json-jackson</artifactId> + <version>${jersey.version}</version> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/YandexTranslate.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/YandexTranslate.java b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/YandexTranslate.java index 5f58781..3477754 100644 --- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/YandexTranslate.java +++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/YandexTranslate.java @@ -16,22 +16,6 @@ */ package org.apache.nifi.processors.yandex; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.nio.charset.Charset; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.MultivaluedMap; - import org.apache.nifi.annotation.behavior.DynamicProperty; import org.apache.nifi.annotation.behavior.InputRequirement; import org.apache.nifi.annotation.behavior.InputRequirement.Requirement; @@ -58,18 +42,28 @@ import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; import org.apache.nifi.processors.yandex.model.Translation; import org.apache.nifi.processors.yandex.util.Languages; -import org.apache.nifi.processors.yandex.util.ObjectMapperResolver; import org.apache.nifi.stream.io.StreamUtils; import org.apache.nifi.util.StopWatch; +import org.apache.nifi.web.util.WebUtils; -import com.sun.jersey.api.client.Client; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.ClientResponse.Status; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.config.ClientConfig; -import com.sun.jersey.api.client.config.DefaultClientConfig; -import com.sun.jersey.api.json.JSONConfiguration; -import com.sun.jersey.core.util.MultivaluedMapImpl; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; @SupportsBatching @InputRequirement(Requirement.INPUT_REQUIRED) @@ -203,34 +197,25 @@ public class YandexTranslate extends AbstractProcessor { @OnScheduled public void onScheduled(final ProcessContext context) { - final ClientConfig config = new DefaultClientConfig(); - config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE); - config.getClasses().add(ObjectMapperResolver.class); - - client = Client.create(config); + client = WebUtils.createClient(null); } @OnStopped public void destroyClient() { if (client != null) { - client.destroy(); + client.close(); } } - protected WebResource.Builder prepareResource(final String key, final List<String> text, final String sourceLanguage, final String destLanguage) { - WebResource webResource = client.resource(URL); - - final MultivaluedMap<String, String> paramMap = new MultivaluedMapImpl(); - paramMap.put("text", text); - paramMap.add("key", key); - paramMap.add("lang", sourceLanguage + "-" + destLanguage); + protected Invocation prepareResource(final String key, final List<String> text, final String sourceLanguage, final String destLanguage) { + Invocation.Builder builder = client.target(URL).request(MediaType.APPLICATION_JSON); - WebResource.Builder builder = webResource - .accept(MediaType.APPLICATION_JSON) - .type(MediaType.APPLICATION_FORM_URLENCODED); - builder = builder.entity(paramMap); + final MultivaluedHashMap entity = new MultivaluedHashMap();; + entity.put("text", text); + entity.add("key", key); + entity.add("lang", sourceLanguage + "-" + destLanguage); - return builder; + return builder.buildPost(Entity.form(entity)); } @Override @@ -267,18 +252,18 @@ public class YandexTranslate extends AbstractProcessor { textValues.add(content); } - final WebResource.Builder builder = prepareResource(key, textValues, sourceLanguage, targetLanguage); + final Invocation invocation = prepareResource(key, textValues, sourceLanguage, targetLanguage); - final ClientResponse response; + final Response response; try { - response = builder.post(ClientResponse.class); + response = invocation.invoke(); } catch (final Exception e) { getLogger().error("Failed to make request to Yandex to transate text for {} due to {}; routing to comms.failure", new Object[]{flowFile, e}); session.transfer(flowFile, REL_COMMS_FAILURE); return; } - if (response.getStatus() != Status.OK.getStatusCode()) { + if (response.getStatus() != Response.Status.OK.getStatusCode()) { getLogger().error("Failed to translate text using Yandex for {}; response was {}: {}; routing to {}", new Object[]{ flowFile, response.getStatus(), response.getStatusInfo().getReasonPhrase(), REL_TRANSLATION_FAILED.getName()}); flowFile = session.putAttribute(flowFile, "yandex.translate.failure.reason", response.getStatusInfo().getReasonPhrase()); @@ -287,7 +272,7 @@ public class YandexTranslate extends AbstractProcessor { } final Map<String, String> newAttributes = new HashMap<>(); - final Translation translation = response.getEntity(Translation.class); + final Translation translation = response.readEntity(Translation.class); final List<String> texts = translation.getText(); for (int i = 0; i < texts.size(); i++) { final String text = texts.get(i); http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/util/ObjectMapperResolver.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/util/ObjectMapperResolver.java b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/util/ObjectMapperResolver.java deleted file mode 100644 index 085cf7f..0000000 --- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/main/java/org/apache/nifi/processors/yandex/util/ObjectMapperResolver.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.processors.yandex.util; - -import javax.ws.rs.ext.ContextResolver; -import javax.ws.rs.ext.Provider; -import org.codehaus.jackson.map.AnnotationIntrospector; -import org.codehaus.jackson.map.DeserializationConfig; -import org.codehaus.jackson.map.ObjectMapper; -import org.codehaus.jackson.map.SerializationConfig; -import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion; -import org.codehaus.jackson.xc.JaxbAnnotationIntrospector; - -@Provider -public class ObjectMapperResolver implements ContextResolver<ObjectMapper> { - - private final ObjectMapper mapper; - - public ObjectMapperResolver() throws Exception { - mapper = new ObjectMapper(); - - final AnnotationIntrospector jaxbIntrospector = new JaxbAnnotationIntrospector(); - final SerializationConfig serializationConfig = mapper.getSerializationConfig(); - final DeserializationConfig deserializationConfig = mapper.getDeserializationConfig(); - - mapper.setSerializationConfig(serializationConfig.withSerializationInclusion(Inclusion.NON_NULL).withAnnotationIntrospector(jaxbIntrospector)); - mapper.setDeserializationConfig(deserializationConfig.withAnnotationIntrospector(jaxbIntrospector)); - } - - @Override - public ObjectMapper getContext(Class<?> objectType) { - return mapper; - } -} http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/test/java/org/apache/nifi/processors/yandex/TestYandexTranslate.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/test/java/org/apache/nifi/processors/yandex/TestYandexTranslate.java b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/test/java/org/apache/nifi/processors/yandex/TestYandexTranslate.java index 8c1aaff..0b62b2d 100644 --- a/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/test/java/org/apache/nifi/processors/yandex/TestYandexTranslate.java +++ b/nifi-nar-bundles/nifi-language-translation-bundle/nifi-yandex-processors/src/test/java/org/apache/nifi/processors/yandex/TestYandexTranslate.java @@ -16,16 +16,6 @@ */ package org.apache.nifi.processors.yandex; -import static org.junit.Assert.assertEquals; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.ws.rs.core.Response.Status.Family; -import javax.ws.rs.core.Response.StatusType; - import org.apache.nifi.processors.yandex.model.Translation; import org.apache.nifi.util.MockFlowFile; import org.apache.nifi.util.TestRunner; @@ -36,9 +26,16 @@ import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.client.WebResource; -import com.sun.jersey.api.client.WebResource.Builder; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.Response.Status.Family; +import javax.ws.rs.core.Response.StatusType; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.junit.Assert.assertEquals; public class TestYandexTranslate { @@ -55,13 +52,13 @@ public class TestYandexTranslate { private TestRunner createTestRunner(final int statusCode) { return TestRunners.newTestRunner(new YandexTranslate() { @Override - protected Builder prepareResource(final String key, final List<String> text, final String sourceLanguage, final String destLanguage) { - final WebResource.Builder builder = Mockito.mock(WebResource.Builder.class); + protected Invocation prepareResource(final String key, final List<String> text, final String sourceLanguage, final String destLanguage) { + final Invocation invocation = Mockito.mock(Invocation.class); - Mockito.doAnswer(new Answer<ClientResponse>() { + Mockito.doAnswer(new Answer<Response>() { @Override - public ClientResponse answer(final InvocationOnMock invocation) throws Throwable { - final ClientResponse response = Mockito.mock(ClientResponse.class); + public Response answer(final InvocationOnMock invocation) throws Throwable { + final Response response = Mockito.mock(Response.class); final StatusType statusType = new StatusType() { @Override @@ -96,13 +93,13 @@ public class TestYandexTranslate { translation.setText(translationList); - Mockito.when(response.getEntity(Translation.class)).thenReturn(translation); + Mockito.when(response.readEntity(Translation.class)).thenReturn(translation); } return response; } - }).when(builder).post(ClientResponse.class); - return builder; + }).when(invocation).invoke(); + return invocation; } }); } http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml b/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml index d60e4af..15db099 100644 --- a/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml +++ b/nifi-nar-bundles/nifi-language-translation-bundle/pom.xml @@ -30,19 +30,4 @@ <module>nifi-language-translation-nar</module> </modules> - <dependencyManagement> - <dependencies> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-client</artifactId> - <version>${jersey.version}</version> - </dependency> - <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-json</artifactId> - <version>${jersey.version}</version> - </dependency> - </dependencies> - </dependencyManagement> - </project> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-lumberjack-bundle/nifi-lumberjack-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-lumberjack-bundle/nifi-lumberjack-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-lumberjack-bundle/nifi-lumberjack-nar/src/main/resources/META-INF/NOTICE index 7e0e4a4..33ed9ab 100644 --- a/nifi-nar-bundles/nifi-lumberjack-bundle/nifi-lumberjack-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-lumberjack-bundle/nifi-lumberjack-nar/src/main/resources/META-INF/NOTICE @@ -3,3 +3,32 @@ Copyright 2014-2015 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). + +****************** +Apache Software License v2 +****************** + +The following binary components are provided under the Apache Software License v2 + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/src/main/resources/META-INF/NOTICE index 6d5627b..fd8956f 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-nar/src/main/resources/META-INF/NOTICE @@ -22,3 +22,26 @@ The following binary components are provided under the Apache Software License v The following NOTICE information applies: Apache Commons IO Copyright 2002-2016 The Apache Software Foundation + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java index 185d012..7c78358 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java @@ -18,6 +18,7 @@ */ package org.apache.nifi.processors.mongodb; +import com.fasterxml.jackson.databind.ObjectMapper; import com.mongodb.client.FindIterable; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoCursor; @@ -42,7 +43,6 @@ import org.apache.nifi.processor.io.OutputStreamCallback; import org.apache.nifi.processor.util.StandardValidators; import org.bson.Document; import org.bson.json.JsonWriterSettings; -import org.codehaus.jackson.map.ObjectMapper; import java.io.IOException; import java.io.OutputStream; http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/ObjectIdSerializer.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/ObjectIdSerializer.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/ObjectIdSerializer.java index 3f207e3..5566f5d 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/ObjectIdSerializer.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/ObjectIdSerializer.java @@ -19,13 +19,13 @@ package org.apache.nifi.processors.mongodb; +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.Version; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import com.fasterxml.jackson.databind.module.SimpleModule; import org.bson.types.ObjectId; -import org.codehaus.jackson.JsonGenerator; -import org.codehaus.jackson.JsonProcessingException; -import org.codehaus.jackson.Version; -import org.codehaus.jackson.map.JsonSerializer; -import org.codehaus.jackson.map.SerializerProvider; -import org.codehaus.jackson.map.module.SimpleModule; import java.io.IOException; http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java index 3a045a8..feef93f 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/test/java/org/apache/nifi/processors/mongodb/GetMongoTest.java @@ -18,14 +18,11 @@ */ package org.apache.nifi.processors.mongodb; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Collection; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.collect.Lists; +import com.mongodb.MongoClient; +import com.mongodb.MongoClientURI; +import com.mongodb.client.MongoCollection; import org.apache.nifi.components.ValidationResult; import org.apache.nifi.flowfile.attributes.CoreAttributes; import org.apache.nifi.processor.ProcessContext; @@ -34,17 +31,19 @@ import org.apache.nifi.util.MockProcessContext; import org.apache.nifi.util.TestRunner; import org.apache.nifi.util.TestRunners; import org.bson.Document; -import org.codehaus.jackson.map.ObjectMapper; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import com.google.common.collect.Lists; -import com.mongodb.MongoClient; -import com.mongodb.MongoClientURI; -import com.mongodb.client.MongoCollection; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; @Ignore("Integration tests that cause failures in some environments. Require that they be run from Maven to run the embedded mongo maven plugin. Maven Plugin also fails in my CentOS 7 environment.") public class GetMongoTest { http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE index c1024f7..4f231ab 100644 --- a/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-mqtt-bundle/nifi-mqtt-nar/src/main/resources/META-INF/NOTICE @@ -18,7 +18,28 @@ The following binary components are provided under the Apache Software License v This product includes software developed at The Apache Software Foundation (http://www.apache.org/). + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. ************************ Eclipse Public License 1.0 http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-nar/src/main/resources/META-INF/NOTICE index 8289cbb..a71f86e 100644 --- a/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-poi-bundle/nifi-poi-nar/src/main/resources/META-INF/NOTICE @@ -33,3 +33,26 @@ The following binary components are provided under the Apache Software License v CurvesAIP is BSD-licensed software (https://github.com/virtuald/curvesapi/) Copyright (c) 2005, Graph Builder + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-nar/src/main/resources/META-INF/NOTICE index bc8eacd..128b123 100644 --- a/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-ranger-bundle/nifi-ranger-nar/src/main/resources/META-INF/NOTICE @@ -349,7 +349,6 @@ Common Development and Distribution License 1.0 The following binary components are provided under the Common Development and Distribution License 1.0. See project link for details. (CDDL 1.0) JavaBeans Activation Framework (JAF) (javax.activation:activation:jar:1.1 - http://java.sun.com/products/javabeans/jaf/index.jsp) - (CDDL 1.0) JSR311 API (javax.ws.rs:jsr311-api:jar:1.1.1 - https://jsr311.dev.java.net) (CDDL 1.0) (GPL3) Streaming API For XML (javax.xml.stream:stax-api:jar:1.0-2 - no url provided) ************************ http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-nar/src/main/resources/META-INF/NOTICE index 5327676..90391b1 100644 --- a/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-site-to-site-reporting-bundle/nifi-site-to-site-reporting-nar/src/main/resources/META-INF/NOTICE @@ -4,6 +4,35 @@ Copyright 2015-2017 The Apache Software Foundation This product includes software developed at The Apache Software Foundation (http://www.apache.org/). +=========================================== +Apache Software License v2 +=========================================== + +The following binary components are provided under the Apache Software License v2 + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. + ************************ Common Development and Distribution License 1.1 ************************ http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-nar/src/main/resources/META-INF/NOTICE index 759452a..a00810f 100644 --- a/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-nar/src/main/resources/META-INF/NOTICE @@ -12,7 +12,3 @@ The following binary components are provided under the Common Development and Di (CDDL 1.1) (GPL2 w/ CPE) JSON Processing API (javax.json:javax.json-api:jar:1.0 - http://json-processing-spec.java.net) (CDDL 1.1) (GPL2 w/ CPE) JSON Processing Default Provider (org.glassfish:javax.json:jar:1.0.4 - https://jsonp.java.net) - -The following binary components are provided under the Common Development and Distribution License v1.0. See project link for details. - - (CDDL 1.0) JSR311 API (javax.ws.rs:jsr311-api:jar:1.1.1 - https://jsr311.dev.java.net) http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-processors/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-processors/pom.xml b/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-processors/pom.xml index c4e0829..306db0b 100644 --- a/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-processors/pom.xml +++ b/nifi-nar-bundles/nifi-slack-bundle/nifi-slack-processors/pom.xml @@ -72,7 +72,7 @@ <dependency> <groupId>javax.ws.rs</groupId> <artifactId>javax.ws.rs-api</artifactId> - <version>2.0.1</version> + <version>2.1</version> <scope>test</scope> </dependency> <dependency> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/src/main/resources/META-INF/NOTICE index bdcc71a..872de83 100644 --- a/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-solr-bundle/nifi-solr-nar/src/main/resources/META-INF/NOTICE @@ -66,3 +66,26 @@ The following binary components are provided under the Apache Software License v Since product implements StAX API, it has dependencies to StAX API classes. + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-nar/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-nar/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-nar/src/main/resources/META-INF/NOTICE index 5765318..a3494f1 100644 --- a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-nar/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-nar/src/main/resources/META-INF/NOTICE @@ -22,3 +22,26 @@ The following binary components are provided under the Apache Software License v This product includes software from the Spring Framework, under the Apache License 2.0 (see: StringUtils.containsWhitespace()) + + (ASLv2) Jackson JSON processor + The following NOTICE information applies: + # Jackson JSON processor + + Jackson is a high-performance, Free/Open Source JSON processing library. + It was originally written by Tatu Saloranta ([email protected]), and has + been in development since 2007. + It is currently developed by a community of developers, as well as supported + commercially by FasterXML.com. + + ## Licensing + + Jackson core and extension components may licensed under different licenses. + To find the details that apply to this artifact see the accompanying LICENSE file. + For more information, including possible other licensing options, contact + FasterXML.com (http://fasterxml.com). + + ## Credits + + A list of contributors may be found from CREDITS file, which is included + in some artifacts (usually source distributions); but is always available + from the source code management (SCM) system project uses. \ No newline at end of file http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/pom.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/pom.xml index 2ed6b9a..84041ce 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/pom.xml +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/pom.xml @@ -25,7 +25,6 @@ language governing permissions and limitations under the License. --> <npm.version>1.3.8</npm.version> <maven.javadoc.skip>true</maven.javadoc.skip> <source.skip>true</source.skip> - <jersey.version>1.19.1</jersey.version> <jolt.version>0.1.0</jolt.version> <frontend.dependency.configs>${basedir}/src/main/frontend</frontend.dependency.configs> <frontend.working.dir>${project.build.directory}/frontend-working-directory</frontend.working.dir> @@ -88,28 +87,42 @@ language governing permissions and limitations under the License. --> <version>3.1.0</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-server</artifactId> - <version>${jersey.version}</version> + <groupId>javax.ws.rs</groupId> + <artifactId>javax.ws.rs-api</artifactId> + <version>2.1</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-core</artifactId> + <groupId>org.glassfish.jersey.containers</groupId> + <artifactId>jersey-container-servlet-core</artifactId> <version>${jersey.version}</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-json</artifactId> + <groupId>org.glassfish.jersey.media</groupId> + <artifactId>jersey-media-json-jackson</artifactId> <version>${jersey.version}</version> + <exclusions> + <exclusion> + <groupId>com.fasterxml.jackson.module</groupId> + <artifactId>jackson-module-jaxb-annotations</artifactId> + </exclusion> + <exclusion> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-databind</artifactId> + </exclusion> + <exclusion> + <groupId>com.fasterxml.jackson.core</groupId> + <artifactId>jackson-annotations</artifactId> + </exclusion> + </exclusions> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-servlet</artifactId> - <version>${jersey.version}</version> + <groupId>com.fasterxml.jackson.module</groupId> + <artifactId>jackson-module-jaxb-annotations</artifactId> + <version>${jackson.version}</version> </dependency> <dependency> - <groupId>com.sun.jersey</groupId> - <artifactId>jersey-client</artifactId> + <groupId>org.glassfish.jersey.inject</groupId> + <artifactId>jersey-hk2</artifactId> <version>${jersey.version}</version> </dependency> <dependency> @@ -137,8 +150,8 @@ language governing permissions and limitations under the License. --> <version>${jackson.version}</version> </dependency> <dependency> - <groupId>com.sun.jersey.jersey-test-framework</groupId> - <artifactId>jersey-test-framework-inmemory</artifactId> + <groupId>org.glassfish.jersey.test-framework.providers</groupId> + <artifactId>jersey-test-framework-provider-inmemory</artifactId> <version>${jersey.version}</version> <scope>test</scope> </dependency> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java index ab74014..c8a692f 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/java/org/apache/nifi/web/standard/api/transformjson/TransformJSONResource.java @@ -17,31 +17,29 @@ package org.apache.nifi.web.standard.api.transformjson; -import java.io.File; -import java.io.FilenameFilter; -import java.util.Collections; -import java.util.Map; - -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - +import com.bazaarvoice.jolt.JoltTransform; +import com.bazaarvoice.jolt.JsonUtils; import org.apache.commons.lang3.StringUtils; import org.apache.nifi.attribute.expression.language.PreparedQuery; import org.apache.nifi.attribute.expression.language.Query; +import org.apache.nifi.processors.standard.util.jolt.TransformFactory; import org.apache.nifi.processors.standard.util.jolt.TransformUtils; import org.apache.nifi.util.file.classloader.ClassLoaderUtils; -import org.apache.nifi.processors.standard.util.jolt.TransformFactory; import org.apache.nifi.web.standard.api.AbstractStandardResource; import org.apache.nifi.web.standard.api.transformjson.dto.JoltSpecificationDTO; import org.apache.nifi.web.standard.api.transformjson.dto.ValidationDTO; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.bazaarvoice.jolt.JoltTransform; -import com.bazaarvoice.jolt.JsonUtils; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import java.io.File; +import java.io.FilenameFilter; +import java.util.Collections; +import java.util.Map; @Path("/standard/transformjson") public class TransformJSONResource extends AbstractStandardResource { @@ -101,7 +99,7 @@ public class TransformJSONResource extends AbstractStandardResource { } - protected JoltTransform getTransformation(JoltSpecificationDTO specificationDTO, boolean evaluateAttributes) throws Exception{ + protected JoltTransform getTransformation(JoltSpecificationDTO specificationDTO, boolean evaluateAttributes) throws Exception { Object specJson = getSpecificationJsonObject(specificationDTO,evaluateAttributes); String transformName = specificationDTO.getTransform(); http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/resources/META-INF/NOTICE ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/resources/META-INF/NOTICE b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/resources/META-INF/NOTICE index b91ddad..8fd1215 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/resources/META-INF/NOTICE +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/resources/META-INF/NOTICE @@ -32,12 +32,20 @@ Common Development and Distribution License 1.1 The following binary components are provided under the Common Development and Distribution License 1.1. See project link for details. - (CDDL 1.1) (GPL2 w/ CPE) jersey-core (com.sun.jersey:jersey-core:jar:1.18.3 - https://jersey.java.net/jersey-core/) - (CDDL 1.1) (GPL2 w/ CPE) jersey-server (com.sun.jersey:jersey-server:jar:1.18.3 - https://jersey.java.net/jersey-server/) - (CDDL 1.1) (GPL2 w/ CPE) jersey-json (com.sun.jersey:jersey-json:jar:1.18.3 - https://jersey.java.net/index.html) - (CDDL 1.1) (GPL2 w/ CPE) jersey-servlet (com.sun.jersey:jersey-servlet:jar:1.18.3 - https://jersey.java.net/index.html) + (CDDL 1.1) (GPL2 w/ CPE) jersey-client (org.glassfish.jersey.core:jersey-client:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-common (org.glassfish.jersey.core:jersey-common:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-container-servlet-core (org.glassfish.jersey.containers:jersey-container-servlet-core:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-entity-filtering (org.glassfish.jersey.ext:jersey-entity-filtering:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-hk2 (org.glassfish.jersey.inject:jersey-hk2:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-media-jaxb (org.glassfish.jersey.media:jersey-media-jaxb:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-media-json-jackson (org.glassfish.jersey.media:jersey-media-json-jackson:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) jersey-server (org.glassfish.jersey.core:jersey-server:jar:2.26 - https://jersey.github.io/) + (CDDL 1.1) (GPL2 w/ CPE) hk2-api (org.glassfish.hk2:hk2-api:jar:2.5.0-b42 - https://javaee.github.io/glassfish/) + (CDDL 1.1) (GPL2 w/ CPE) hk2-utils (org.glassfish.hk2:hk2-utils:jar:2.5.0-b42 - https://javaee.github.io/glassfish/) + (CDDL 1.1) (GPL2 w/ CPE) hk2-locator (org.glassfish.hk2:hk2-locator:jar:2.5.0-b42 - https://javaee.github.io/glassfish/) (CDDL 1.1) (GPL2 w/ CPE) Old JAXB Runtime (com.sun.xml.bind:jaxb-impl:jar:2.2.3-1 - http://jaxb.java.net/) (CDDL 1.1) (GPL2 w/ CPE) Java Architecture For XML Binding (javax.xml.bind:jaxb-api:jar:2.2.2 - https://jaxb.dev.java.net/) + (CDDL 1.1) (GPL2 w/ CPE) javax.ws.rs-api (javax.ws.rs:javax.ws.rs-api:jar:2.1 - http://jax-rs-spec.java.net) ************************ Common Development and Distribution License 1.0 http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/WEB-INF/web.xml ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/WEB-INF/web.xml b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/WEB-INF/web.xml index 13d0d41..1f200cd 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/WEB-INF/web.xml +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/main/webapp/WEB-INF/web.xml @@ -17,14 +17,14 @@ <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <servlet> <servlet-name>api</servlet-name> - <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class> + <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> - <param-name>com.sun.jersey.config.property.packages</param-name> + <param-name>jersey.config.server.provider.packages</param-name> <param-value>org.apache.nifi.web.standard.api.processor,org.apache.nifi.web.standard.api.transformjson</param-value> </init-param> <init-param> - <param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name> - <param-value>true</param-value> + <param-name>jersey.config.server.provider.classnames</param-name> + <param-value>org.glassfish.jersey.jackson.JacksonFeature</param-value> </init-param> </servlet> <servlet-mapping> http://git-wip-us.apache.org/repos/asf/nifi/blob/6baea8cc/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/test/java/org/apache/nifi/web/standard/api/processor/TestProcessorResource.java ---------------------------------------------------------------------- diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/test/java/org/apache/nifi/web/standard/api/processor/TestProcessorResource.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/test/java/org/apache/nifi/web/standard/api/processor/TestProcessorResource.java index 4bb39de..b083998 100644 --- a/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/test/java/org/apache/nifi/web/standard/api/processor/TestProcessorResource.java +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-jolt-transform-json-ui/src/test/java/org/apache/nifi/web/standard/api/processor/TestProcessorResource.java @@ -16,37 +16,30 @@ */ package org.apache.nifi.web.standard.api.processor; -import java.util.HashMap; -import java.util.Map; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.ext.Provider; - +import com.bazaarvoice.jolt.JsonUtils; +import com.fasterxml.jackson.databind.JsonNode; import org.apache.nifi.web.ComponentDescriptor; import org.apache.nifi.web.ComponentDetails; import org.apache.nifi.web.NiFiWebConfigurationContext; import org.apache.nifi.web.NiFiWebConfigurationRequestContext; import org.apache.nifi.web.NiFiWebRequestContext; - - -import org.codehaus.jettison.json.JSONException; -import org.codehaus.jettison.json.JSONObject; +import org.glassfish.hk2.api.Factory; +import org.glassfish.hk2.utilities.binding.AbstractBinder; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.server.ResourceConfig; +import org.glassfish.jersey.test.JerseyTest; +import org.glassfish.jersey.test.inmemory.InMemoryTestContainerFactory; +import org.glassfish.jersey.test.spi.TestContainerFactory; import org.junit.Test; import org.mockito.Mockito; -import com.bazaarvoice.jolt.JsonUtils; -import com.sun.jersey.api.client.ClientResponse; -import com.sun.jersey.api.core.ClassNamesResourceConfig; -import com.sun.jersey.spi.container.servlet.WebComponent; -import com.sun.jersey.spi.inject.SingletonTypeInjectableProvider; -import com.sun.jersey.test.framework.AppDescriptor; -import com.sun.jersey.test.framework.JerseyTest; -import com.sun.jersey.test.framework.WebAppDescriptor; -import com.sun.jersey.test.framework.spi.container.TestContainerFactory; -import com.sun.jersey.test.framework.spi.container.inmemory.InMemoryTestContainerFactory; +import javax.servlet.ServletContext; +import javax.servlet.http.HttpServletRequest; +import javax.ws.rs.client.Entity; +import javax.ws.rs.core.Application; +import javax.ws.rs.core.Response; +import java.util.HashMap; +import java.util.Map; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -60,15 +53,23 @@ public class TestProcessorResource extends JerseyTest { public static final HttpServletRequest requestContext = mock(HttpServletRequest.class); @Override - protected AppDescriptor configure() { - return new WebAppDescriptor.Builder() - .initParam(WebComponent.RESOURCE_CONFIG_CLASS, ClassNamesResourceConfig.class.getName()) - .initParam(ClassNamesResourceConfig.PROPERTY_CLASSNAMES, - ProcessorResource.class.getName() + - ";" + TestProcessorResource.MockServletContext.class.getName() + - ";" + TestProcessorResource.MockRequestContext.class.getName()+";") - .initParam("com.sun.jersey.api.json.POJOMappingFeature", "true") - .build(); + protected Application configure() { + final ResourceConfig config = new ResourceConfig(); + config.register(ProcessorResource.class); + config.register(JacksonFeature.class); + config.register(new AbstractBinder(){ + @Override + public void configure() { + bindFactory(MockRequestContext.class).to(HttpServletRequest.class); + } + }); + config.register(new AbstractBinder(){ + @Override + public void configure() { + bindFactory(MockServletContext.class).to(ServletContext.class); + } + }); + return config; } @Override @@ -78,7 +79,7 @@ public class TestProcessorResource extends JerseyTest { @Test - public void testSetProperties() throws JSONException{ + public void testSetProperties() { final NiFiWebConfigurationContext niFiWebConfigurationContext = mock(NiFiWebConfigurationContext.class); final Map<String,String> properties = new HashMap<>(); @@ -88,16 +89,18 @@ public class TestProcessorResource extends JerseyTest { Mockito.when(servletContext.getAttribute(Mockito.anyString())).thenReturn(niFiWebConfigurationContext); Mockito.when(niFiWebConfigurationContext.updateComponent(any(NiFiWebConfigurationRequestContext.class),any(String.class),any(Map.class))).thenReturn(componentDetails); - ClientResponse response = client().resource(getBaseURI()).path("/standard/processor/properties") - .queryParam("processorId","1") - .queryParam("clientId","1") - .queryParam("revisionId","1") - .type(MediaType.APPLICATION_JSON_TYPE) - .put(ClientResponse.class,JsonUtils.toJsonString(properties)); + Response response = client().target(getBaseUri()) + .path("/standard/processor/properties") + .queryParam("processorId","1") + .queryParam("clientId","1") + .queryParam("revisionId","1") + .request() + .put(Entity.json(JsonUtils.toJsonString(properties))); + assertNotNull(response); - JSONObject jsonObject = response.getEntity(JSONObject.class); - assertNotNull(jsonObject); - assertTrue(jsonObject.getJSONObject("properties").get("jolt-transform").equals("jolt-transform-chain")); + JsonNode jsonNode = response.readEntity(JsonNode.class); + assertNotNull(jsonNode); + assertTrue(jsonNode.get("properties").get("jolt-transform").asText().equals("jolt-transform-chain")); } @@ -115,34 +118,42 @@ public class TestProcessorResource extends JerseyTest { Mockito.when(servletContext.getAttribute(Mockito.anyString())).thenReturn(niFiWebConfigurationContext); Mockito.when(niFiWebConfigurationContext.getComponentDetails(any(NiFiWebRequestContext.class))).thenReturn(componentDetails); - JSONObject value = client().resource(getBaseURI()).path("/standard/processor/details").queryParam("processorId","1").get(JSONObject.class); + JsonNode value = client().target(getBaseUri()) + .path("/standard/processor/details") + .queryParam("processorId","1") + .request() + .get(JsonNode.class); + assertNotNull(value); try{ - assertTrue(value.get("name").equals("mytransform")); + assertTrue(value.get("name").asText().equals("mytransform")); } catch (Exception e){ fail("Failed due to: " + e.toString()); } } - @Provider - public static class MockServletContext extends SingletonTypeInjectableProvider<Context, ServletContext> { - - public MockServletContext(){ - super(ServletContext.class, servletContext); + public static class MockRequestContext implements Factory<HttpServletRequest> { + @Override + public HttpServletRequest provide() { + return requestContext; } + @Override + public void dispose(HttpServletRequest t) { + } } - @Provider - public static class MockRequestContext extends SingletonTypeInjectableProvider<Context, HttpServletRequest> { - - public MockRequestContext(){ - super(HttpServletRequest.class, requestContext); + public static class MockServletContext implements Factory<ServletContext> { + @Override + public ServletContext provide() { + return servletContext; } + @Override + public void dispose(ServletContext t) { + } } - }
