[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/3005 ---
[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
Github user markap14 commented on a diff in the pull request: https://github.com/apache/nifi/pull/3005#discussion_r218439155 --- Diff: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JndiJmsConnectionFactoryProvider.java --- @@ -0,0 +1,165 @@ +/* + * 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.jms.cf; + +import org.apache.nifi.annotation.behavior.DynamicProperty; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.annotation.lifecycle.OnDisabled; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.PropertyDescriptor.Builder; +import org.apache.nifi.components.Validator; +import org.apache.nifi.controller.AbstractControllerService; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import javax.jms.ConnectionFactory; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.List; + +import static org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_VALIDATOR; + +@Tags({"jms", "jndi", "messaging", "integration", "queue", "topic", "publish", "subscribe"}) +@CapabilityDescription("Provides a service to lookup an existing JMS ConnectionFactory using the Java Naming and Directory Interface (JNDI).") +@DynamicProperty( +description = "In order to perform a JNDI Lookup, an Initial Context must be established. When this is done, an Environment can be established for the context. Any dynamic/user-defined property" + +" that is added to this Controller Service will be added as an Environment configuration/variable to this Context.", +name = "The name of a JNDI Initial Context environment variable.", +value = "The value of the JNDI Initial Context Environment variable.", +expressionLanguageScope = ExpressionLanguageScope.VARIABLE_REGISTRY) +@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS", "org.apache.nifi.jms.cf.JMSConnectionFactoryProvider"}) +public class JndiJmsConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition{ + +static final PropertyDescriptor INITIAL_NAMING_FACTORY_CLASS = new Builder() +.name("java.naming.factory.initial") +.displayName("Initial Naming Factory Class") +.description("The fully qualified class name of the Java Initial Naming Factory (java.naming.factory.initial).") +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.required(true) +.build(); +static final PropertyDescriptor NAMING_PROVIDER_URL = new Builder() +.name("java.naming.provider.url") +.displayName("Naming Provider URL") +.description("The URL of the JNDI Naming Provider to use") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final PropertyDescriptor CONNECTION_FACTORY_NAME = new Builder() +.name("connection.factory.name") +.displayName("Connection Factory Name") +.description("The name of the JNDI Object to lookup for the Connection Factory") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final
[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
Github user markap14 commented on a diff in the pull request: https://github.com/apache/nifi/pull/3005#discussion_r218438047 --- Diff: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JndiJmsConnectionFactoryProvider.java --- @@ -0,0 +1,165 @@ +/* + * 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.jms.cf; + +import org.apache.nifi.annotation.behavior.DynamicProperty; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.annotation.lifecycle.OnDisabled; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.PropertyDescriptor.Builder; +import org.apache.nifi.components.Validator; +import org.apache.nifi.controller.AbstractControllerService; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import javax.jms.ConnectionFactory; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.List; + +import static org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_VALIDATOR; + +@Tags({"jms", "jndi", "messaging", "integration", "queue", "topic", "publish", "subscribe"}) +@CapabilityDescription("Provides a service to lookup an existing JMS ConnectionFactory using the Java Naming and Directory Interface (JNDI).") +@DynamicProperty( +description = "In order to perform a JNDI Lookup, an Initial Context must be established. When this is done, an Environment can be established for the context. Any dynamic/user-defined property" + +" that is added to this Controller Service will be added as an Environment configuration/variable to this Context.", +name = "The name of a JNDI Initial Context environment variable.", +value = "The value of the JNDI Initial Context Environment variable.", +expressionLanguageScope = ExpressionLanguageScope.VARIABLE_REGISTRY) +@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS", "org.apache.nifi.jms.cf.JMSConnectionFactoryProvider"}) +public class JndiJmsConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition{ + +static final PropertyDescriptor INITIAL_NAMING_FACTORY_CLASS = new Builder() +.name("java.naming.factory.initial") +.displayName("Initial Naming Factory Class") +.description("The fully qualified class name of the Java Initial Naming Factory (java.naming.factory.initial).") +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.required(true) +.build(); +static final PropertyDescriptor NAMING_PROVIDER_URL = new Builder() +.name("java.naming.provider.url") +.displayName("Naming Provider URL") +.description("The URL of the JNDI Naming Provider to use") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final PropertyDescriptor CONNECTION_FACTORY_NAME = new Builder() +.name("connection.factory.name") +.displayName("Connection Factory Name") +.description("The name of the JNDI Object to lookup for the Connection Factory") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final
[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
Github user bdesert commented on a diff in the pull request: https://github.com/apache/nifi/pull/3005#discussion_r218387623 --- Diff: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JndiJmsConnectionFactoryProvider.java --- @@ -0,0 +1,165 @@ +/* + * 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.jms.cf; + +import org.apache.nifi.annotation.behavior.DynamicProperty; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.annotation.lifecycle.OnDisabled; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.PropertyDescriptor.Builder; +import org.apache.nifi.components.Validator; +import org.apache.nifi.controller.AbstractControllerService; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import javax.jms.ConnectionFactory; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.List; + +import static org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_VALIDATOR; + +@Tags({"jms", "jndi", "messaging", "integration", "queue", "topic", "publish", "subscribe"}) +@CapabilityDescription("Provides a service to lookup an existing JMS ConnectionFactory using the Java Naming and Directory Interface (JNDI).") +@DynamicProperty( +description = "In order to perform a JNDI Lookup, an Initial Context must be established. When this is done, an Environment can be established for the context. Any dynamic/user-defined property" + +" that is added to this Controller Service will be added as an Environment configuration/variable to this Context.", +name = "The name of a JNDI Initial Context environment variable.", +value = "The value of the JNDI Initial Context Environment variable.", +expressionLanguageScope = ExpressionLanguageScope.VARIABLE_REGISTRY) +@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS", "org.apache.nifi.jms.cf.JMSConnectionFactoryProvider"}) +public class JndiJmsConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition{ + +static final PropertyDescriptor INITIAL_NAMING_FACTORY_CLASS = new Builder() +.name("java.naming.factory.initial") +.displayName("Initial Naming Factory Class") +.description("The fully qualified class name of the Java Initial Naming Factory (java.naming.factory.initial).") +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.required(true) +.build(); +static final PropertyDescriptor NAMING_PROVIDER_URL = new Builder() +.name("java.naming.provider.url") +.displayName("Naming Provider URL") +.description("The URL of the JNDI Naming Provider to use") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final PropertyDescriptor CONNECTION_FACTORY_NAME = new Builder() +.name("connection.factory.name") +.displayName("Connection Factory Name") +.description("The name of the JNDI Object to lookup for the Connection Factory") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final
[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
Github user bdesert commented on a diff in the pull request: https://github.com/apache/nifi/pull/3005#discussion_r218386884 --- Diff: nifi-nar-bundles/nifi-jms-bundle/nifi-jms-processors/src/main/java/org/apache/nifi/jms/cf/JndiJmsConnectionFactoryProvider.java --- @@ -0,0 +1,165 @@ +/* + * 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.jms.cf; + +import org.apache.nifi.annotation.behavior.DynamicProperty; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import org.apache.nifi.annotation.documentation.SeeAlso; +import org.apache.nifi.annotation.documentation.Tags; +import org.apache.nifi.annotation.lifecycle.OnDisabled; +import org.apache.nifi.components.PropertyDescriptor; +import org.apache.nifi.components.PropertyDescriptor.Builder; +import org.apache.nifi.components.Validator; +import org.apache.nifi.controller.AbstractControllerService; +import org.apache.nifi.controller.ConfigurationContext; +import org.apache.nifi.expression.ExpressionLanguageScope; +import org.apache.nifi.processor.exception.ProcessException; +import org.apache.nifi.processor.util.StandardValidators; + +import javax.jms.ConnectionFactory; +import javax.naming.Context; +import javax.naming.InitialContext; +import javax.naming.NamingException; +import java.util.Arrays; +import java.util.Hashtable; +import java.util.List; + +import static org.apache.nifi.processor.util.StandardValidators.NON_EMPTY_VALIDATOR; + +@Tags({"jms", "jndi", "messaging", "integration", "queue", "topic", "publish", "subscribe"}) +@CapabilityDescription("Provides a service to lookup an existing JMS ConnectionFactory using the Java Naming and Directory Interface (JNDI).") +@DynamicProperty( +description = "In order to perform a JNDI Lookup, an Initial Context must be established. When this is done, an Environment can be established for the context. Any dynamic/user-defined property" + +" that is added to this Controller Service will be added as an Environment configuration/variable to this Context.", +name = "The name of a JNDI Initial Context environment variable.", +value = "The value of the JNDI Initial Context Environment variable.", +expressionLanguageScope = ExpressionLanguageScope.VARIABLE_REGISTRY) +@SeeAlso(classNames = {"org.apache.nifi.jms.processors.ConsumeJMS", "org.apache.nifi.jms.processors.PublishJMS", "org.apache.nifi.jms.cf.JMSConnectionFactoryProvider"}) +public class JndiJmsConnectionFactoryProvider extends AbstractControllerService implements JMSConnectionFactoryProviderDefinition{ + +static final PropertyDescriptor INITIAL_NAMING_FACTORY_CLASS = new Builder() +.name("java.naming.factory.initial") +.displayName("Initial Naming Factory Class") +.description("The fully qualified class name of the Java Initial Naming Factory (java.naming.factory.initial).") +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.required(true) +.build(); +static final PropertyDescriptor NAMING_PROVIDER_URL = new Builder() +.name("java.naming.provider.url") +.displayName("Naming Provider URL") +.description("The URL of the JNDI Naming Provider to use") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final PropertyDescriptor CONNECTION_FACTORY_NAME = new Builder() +.name("connection.factory.name") +.displayName("Connection Factory Name") +.description("The name of the JNDI Object to lookup for the Connection Factory") +.required(true) +.addValidator(NON_EMPTY_VALIDATOR) + .expressionLanguageSupported(ExpressionLanguageScope.VARIABLE_REGISTRY) +.build(); +static final
[GitHub] nifi pull request #3005: NIFI-5598: Allow JMS Processors to lookup Connectio...
GitHub user markap14 opened a pull request: https://github.com/apache/nifi/pull/3005 NIFI-5598: Allow JMS Processors to lookup Connection Factory via JNDI Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: ### For all changes: - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? - [ ] Does your PR title start with NIFI- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [ ] Has your PR been rebased against the latest commit within the target branch (typically master)? - [ ] Is your initial contribution a single, squashed commit? ### For code changes: - [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? - [ ] Have you written or updated unit tests to verify your changes? - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? - [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? - [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? ### For documentation related changes: - [ ] Have you ensured that format looks appropriate for the output in which it is rendered? ### Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/markap14/nifi NIFI-5598 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/3005.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3005 commit 4d7313aac0dcbc2b2533e3c2581240020bcb9037 Author: Mark Payne Date: 2018-09-14T14:48:59Z NIFI-5598: Allow JMS Processors to lookup Connection Factory via JNDI ---