NIFI-1831 Added internal logic and command-line tool to allow AES-encrypted 
sensitive configuration values in nifi.properties.

This closes #834.


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/c638191a
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/c638191a
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/c638191a

Branch: refs/heads/master
Commit: c638191a47ae5767de82b383ecb04496ce18877b
Parents: 7a4fed1
Author: Andy LoPresto <[email protected]>
Authored: Mon Aug 15 20:18:47 2016 -0700
Committer: Andy LoPresto <[email protected]>
Committed: Tue Aug 23 20:34:31 2016 -0700

----------------------------------------------------------------------
 LICENSE                                         |   22 +
 NOTICE                                          |    2 +
 .../ProcessorInitializationContext.java         |    1 -
 nifi-assembly/src/main/assembly/common.xml      |    2 +
 .../java/org/apache/nifi/bootstrap/RunNiFi.java |  109 +-
 .../org/apache/nifi/util/NiFiProperties.java    |   24 +-
 .../java/org/apache/nifi/util/StringUtils.java  |   36 +
 .../apache/nifi/util/NiFiPropertiesTest.java    |    6 +-
 .../nifi/controller/queue/SortColumn.java       |   12 +-
 .../apache/nifi/amqp/processors/AMQPUtils.java  |   83 +-
 .../ClusterProtocolHeartbeatMonitor.java        |    2 -
 .../endpoints/StatusHistoryEndpointMerger.java  |    1 -
 .../node/CuratorNodeProtocolSender.java         |    1 -
 .../node/NodeClusterCoordinator.java            |    1 -
 .../TestThreadPoolRequestReplicator.java        |   17 +-
 .../node/TestNodeClusterCoordinator.java        |    1 -
 .../apache/nifi/cluster/integration/Node.java   |    4 +-
 .../nifi-framework/nifi-framework-core/pom.xml  |    4 +
 .../nifi/connectable/StandardConnection.java    |   23 +-
 .../nifi/controller/FileSystemSwapManager.java  |    7 +-
 .../cluster/ClusterProtocolHeartbeater.java     |    2 -
 .../election/CuratorLeaderElectionManager.java  |    1 -
 .../apache/nifi/encrypt/StringEncryptor.java    |    2 +-
 .../nifi/remote/StandardRemoteProcessGroup.java |   55 +-
 .../src/main/resources/nifi-context.xml         |   12 +-
 .../nifi/controller/TestFlowController.java     |   33 +-
 .../TestStandardProcessScheduler.java           |    1 -
 .../TestStandardControllerServiceProvider.java  |    9 +-
 .../nifi/nar/NarThreadContextClassLoader.java   |   16 +-
 .../nifi-properties-loader/pom.xml              |   53 +
 .../AESSensitivePropertyProvider.java           |  251 +++
 .../AESSensitivePropertyProviderFactory.java    |   53 +
 ...pleSensitivePropertyProtectionException.java |  128 ++
 .../nifi/properties/NiFiPropertiesLoader.java   |  254 +++
 .../properties/ProtectedNiFiProperties.java     |  521 +++++++
 .../SensitivePropertyProtectionException.java   |   91 ++
 .../properties/SensitivePropertyProvider.java   |   52 +
 .../SensitivePropertyProviderFactory.java       |   23 +
 .../nifi/properties/StandardNiFiProperties.java |   81 +
 ...SSensitivePropertyProviderFactoryTest.groovy |   97 ++
 .../AESSensitivePropertyProviderTest.groovy     |  463 ++++++
 .../NiFiPropertiesLoaderGroovyTest.groovy       |  393 +++++
 .../ProtectedNiFiPropertiesGroovyTest.groovy    |  860 +++++++++++
 .../StandardNiFiPropertiesGroovyTest.groovy     |  150 ++
 .../bootstrap_tests/conf/bootstrap.conf         |   74 +
 ...ensitive_properties_protected_aes.properties |  129 ++
 .../missing_bootstrap/nifi.properties           |   14 +
 .../bootstrap_tests/missing_key/bootstrap.conf  |   74 +
 .../bootstrap_tests/missing_key/nifi.properties |   14 +
 .../missing_key_line/bootstrap.conf             |   71 +
 .../missing_key_line/nifi.properties            |   14 +
 .../unreadable_bootstrap/bootstrap.conf         |   74 +
 .../unreadable_bootstrap/nifi.properties        |   14 +
 .../unreadable_conf/bootstrap.conf              |   74 +
 .../unreadable_conf/nifi.properties             |   14 +
 .../test/resources/conf/nifi.blank.properties   |  124 ++
 .../test/resources/conf/nifi.missing.properties |  122 ++
 .../src/test/resources/conf/nifi.properties     |  124 ++
 .../conf/nifi_no_permissions.properties         |   14 +
 ...fi_with_additional_sensitive_keys.properties |  125 ++
 ...ensitive_properties_protected_aes.properties |  129 ++
 ...cursive_additional_sensitive_keys.properties |  125 ++
 ...ensitive_properties_protected_aes.properties |  128 ++
 ..._protected_aes_multiple_malformed.properties |  128 ++
 ...es_protected_aes_single_malformed.properties |  128 ++
 ...tive_properties_protected_unknown.properties |  128 ++
 ..._sensitive_properties_unprotected.properties |  125 ++
 ...properties_unprotected_extra_line.properties |  126 ++
 .../nifi-framework/nifi-resources/pom.xml       |    3 +
 .../src/main/resources/conf/bootstrap.conf      |    2 +
 .../src/main/resources/conf/nifi.properties     |    2 +
 .../nifi-framework/nifi-runtime/pom.xml         |   10 +
 .../src/main/java/org/apache/nifi/NiFi.java     |  104 +-
 .../org/apache/nifi/NiFiGroovyTest.groovy       |  277 ++++
 .../NiFiProperties/conf/nifi.properties         |  188 +++
 ...ensitive_properties_protected_aes.properties |  189 +++
 ...rties_protected_aes_different_key.properties |  192 +++
 .../src/test/resources/logback-test.xml         |   34 +
 .../StandardHttpFlowFileServerProtocol.java     |   14 +-
 .../socket/SocketFlowFileServerProtocol.java    |   27 +-
 .../nifi/web/api/DataTransferResource.java      |  198 +--
 .../apache/nifi/web/api/SiteToSiteResource.java |    7 +-
 .../nifi-framework/pom.xml                      |    1 +
 nifi-nar-bundles/nifi-framework-bundle/pom.xml  |    5 +
 .../TestVolatileProvenanceRepository.java       |    1 -
 nifi-toolkit/nifi-toolkit-assembly/NOTICE       |   14 +-
 nifi-toolkit/nifi-toolkit-assembly/pom.xml      |    6 +-
 .../src/main/assembly/dependencies.xml          |    9 +
 .../src/main/resources/bin/encrypt-config.bat   |   40 +
 .../src/main/resources/bin/encrypt-config.sh    |  120 ++
 .../nifi-toolkit-encrypt-config/LICENSE         |  225 +++
 .../nifi-toolkit-encrypt-config/pom.xml         |  162 ++
 .../nifi/properties/ConfigEncryptionTool.groovy |  578 +++++++
 .../org/apache/nifi/properties/JavaMain.java    |   23 +
 .../nifi/util/console/CharacterDevice.java      |   73 +
 .../apache/nifi/util/console/ConsoleDevice.java |   66 +
 .../nifi/util/console/ConsoleException.java     |   35 +
 .../apache/nifi/util/console/TextDevice.java    |   43 +
 .../apache/nifi/util/console/TextDevices.java   |   80 +
 .../src/main/resources/log4j.properties         |   22 +
 .../src/main/resources/logback.xml              |   34 +
 .../properties/ConfigEncryptionToolTest.groovy  | 1458 ++++++++++++++++++
 .../src/test/resources/bootstrap.conf           |   72 +
 .../bootstrap_with_empty_master_key.conf        |   74 +
 .../resources/bootstrap_with_master_key.conf    |   74 +
 .../src/test/resources/log4j.properties         |   22 +
 .../src/test/resources/logback-test.xml         |   34 +
 ...ensitive_properties_protected_aes.properties |   34 +
 ..._sensitive_properties_unprotected.properties |   31 +
 ...ensitive_properties_protected_aes.properties |  128 ++
 ..._sensitive_properties_unprotected.properties |  125 ++
 ...cted_and_empty_protection_schemes.properties |  127 ++
 nifi-toolkit/nifi-toolkit-tls/pom.xml           |    4 -
 nifi-toolkit/pom.xml                            |   21 +-
 pom.xml                                         |   12 +-
 115 files changed, 10687 insertions(+), 364 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 74473f9..3db82f6 100644
--- a/LICENSE
+++ b/LICENSE
@@ -583,3 +583,25 @@ This product bundles 'jsonlint' which is available under 
an MIT license.
     LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
     OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
     THE SOFTWARE.
+
+This product bundles source from 'AbstractingTheJavaConsole'. The source is 
available under an MIT LICENSE.
+
+    Copyright (C) 2010 McDowell
+
+    Permission is hereby granted, free of charge, to any person obtaining a 
copy
+    of this software and associated documentation files (the "Software"), to 
deal
+    in the Software without restriction, including without limitation the 
rights
+    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+    copies of the Software, and to permit persons to whom the Software is
+    furnished to do so, subject to the following conditions:
+
+    The above copyright notice and this permission notice shall be included in
+    all copies or substantial portions of the Software.
+
+    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
+    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+    THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index f6ac349..c2026ba 100644
--- a/NOTICE
+++ b/NOTICE
@@ -13,6 +13,8 @@ Copyright 2012, 2013 Willi Ballenthin 
[email protected]
 while at Mandiant http://www.mandiant.com
 The derived work is adapted from Evtx/Evtx.py, Evtx/BinaryParser.py, 
Evtx/Nodes.py, Evtx/Views.py and can be found in the 
org.apache.nifi.processors.evtx.parser package.
 
+
+
 This includes derived works from the Apache Storm (ASLv2 licensed) project 
(https://github.com/apache/storm):
 Copyright 2015 The Apache Software Foundation
 The derived work is adapted from

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java
----------------------------------------------------------------------
diff --git 
a/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java
 
b/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java
index df18193..b4c7643 100644
--- 
a/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java
+++ 
b/nifi-api/src/main/java/org/apache/nifi/processor/ProcessorInitializationContext.java
@@ -52,5 +52,4 @@ public interface ProcessorInitializationContext extends 
KerberosContext {
      * type of this NiFi instance.
      */
     NodeTypeProvider getNodeTypeProvider();
-
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-assembly/src/main/assembly/common.xml
----------------------------------------------------------------------
diff --git a/nifi-assembly/src/main/assembly/common.xml 
b/nifi-assembly/src/main/assembly/common.xml
index ec26548..80af552 100644
--- a/nifi-assembly/src/main/assembly/common.xml
+++ b/nifi-assembly/src/main/assembly/common.xml
@@ -28,6 +28,8 @@
                 <include>slf4j-api</include>
                 <include>logback-classic</include>
                 <include>nifi-api</include>
+                <include>commons-lang3</include>
+                <include>bcprov-jdk15on</include>
             </includes>
         </dependencySet>
 

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
----------------------------------------------------------------------
diff --git 
a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java 
b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
index 173a199..eb3d8ec 100644
--- a/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
+++ b/nifi-bootstrap/src/main/java/org/apache/nifi/bootstrap/RunNiFi.java
@@ -53,7 +53,6 @@ import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Condition;
 import java.util.concurrent.locks.Lock;
 import java.util.concurrent.locks.ReentrantLock;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.bootstrap.notification.NotificationType;
 import org.apache.nifi.util.file.FileUtils;
@@ -61,7 +60,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 /**
- *
  * <p>
  * The class which bootstraps Apache NiFi. This class looks for the
  * bootstrap.conf file by looking in the following places (in order):</p>
@@ -73,7 +71,7 @@ import org.slf4j.LoggerFactory;
  * <li>./conf/bootstrap.conf, where {@code ./} represents the working
  * directory.</li>
  * </ol>
- *
+ * <p>
  * If the {@code bootstrap.conf} file cannot be found, throws a {@code 
FileNotFoundException}.
  */
 public class RunNiFi {
@@ -98,6 +96,7 @@ public class RunNiFi {
     public static final String NIFI_PID_FILE_NAME = "nifi.pid";
     public static final String NIFI_STATUS_FILE_NAME = "nifi.status";
     public static final String NIFI_LOCK_FILE_NAME = "nifi.lock";
+    public static final String NIFI_BOOTSTRAP_SENSITIVE_KEY = 
"nifi.bootstrap.sensitive.key";
 
     public static final String PID_KEY = "pid";
 
@@ -332,7 +331,7 @@ public class RunNiFi {
     }
 
 
-    private File getBootstrapFile(final Logger logger, String directory, 
String defaultDirectory, String fileName) throws IOException{
+    private File getBootstrapFile(final Logger logger, String directory, 
String defaultDirectory, String fileName) throws IOException {
 
         final File confDir = bootstrapConfigFile.getParentFile();
         final File nifiHome = confDir.getParentFile();
@@ -341,9 +340,9 @@ public class RunNiFi {
 
         final File fileDir;
 
-        if(confFileDir != null){
+        if (confFileDir != null) {
             fileDir = new File(confFileDir.trim());
-        } else{
+        } else {
             fileDir = new File(nifiHome, defaultDirectory);
         }
 
@@ -353,19 +352,19 @@ public class RunNiFi {
         return statusFile;
     }
 
-    File getPidFile(final Logger logger) throws IOException{
-        return 
getBootstrapFile(logger,NIFI_PID_DIR_PROP,DEFAULT_PID_DIR,NIFI_PID_FILE_NAME);
+    File getPidFile(final Logger logger) throws IOException {
+        return getBootstrapFile(logger, NIFI_PID_DIR_PROP, DEFAULT_PID_DIR, 
NIFI_PID_FILE_NAME);
     }
 
-    File getStatusFile(final Logger logger) throws IOException{
-        return 
getBootstrapFile(logger,NIFI_PID_DIR_PROP,DEFAULT_PID_DIR,NIFI_STATUS_FILE_NAME);
+    File getStatusFile(final Logger logger) throws IOException {
+        return getBootstrapFile(logger, NIFI_PID_DIR_PROP, DEFAULT_PID_DIR, 
NIFI_STATUS_FILE_NAME);
     }
 
-    File getLockFile(final Logger logger) throws IOException{
-        return 
getBootstrapFile(logger,NIFI_PID_DIR_PROP,DEFAULT_PID_DIR,NIFI_LOCK_FILE_NAME);
+    File getLockFile(final Logger logger) throws IOException {
+        return getBootstrapFile(logger, NIFI_PID_DIR_PROP, DEFAULT_PID_DIR, 
NIFI_LOCK_FILE_NAME);
     }
 
-    File getStatusFile() throws IOException{
+    File getStatusFile() throws IOException {
         return getStatusFile(defaultLogger);
     }
 
@@ -388,8 +387,8 @@ public class RunNiFi {
         return props;
     }
 
-    private synchronized void saveProperties(final Properties nifiProps, final 
Logger logger) throws IOException {
-        final String pid = nifiProps.getProperty(PID_KEY);
+    private synchronized void savePidProperties(final Properties 
pidProperties, final Logger logger) throws IOException {
+        final String pid = pidProperties.getProperty(PID_KEY);
         if (!StringUtils.isBlank(pid)) {
             writePidFile(pid, logger);
         }
@@ -410,16 +409,16 @@ public class RunNiFi {
             Files.setPosixFilePermissions(statusFile.toPath(), perms);
         } catch (final Exception e) {
             logger.warn("Failed to set permissions so that only the owner can 
read status file {}; "
-                + "this may allows others to have access to the key needed to 
communicate with NiFi. "
-                + "Permissions should be changed so that only the owner can 
read this file", statusFile);
+                    + "this may allows others to have access to the key needed 
to communicate with NiFi. "
+                    + "Permissions should be changed so that only the owner 
can read this file", statusFile);
         }
 
         try (final FileOutputStream fos = new FileOutputStream(statusFile)) {
-            nifiProps.store(fos, null);
+            pidProperties.store(fos, null);
             fos.getFD().sync();
         }
 
-        logger.debug("Saved Properties {} to {}", new Object[]{nifiProps, 
statusFile});
+        logger.debug("Saved Properties {} to {}", new Object[]{pidProperties, 
statusFile});
     }
 
     private synchronized void writePidFile(final String pid, final Logger 
logger) throws IOException {
@@ -519,8 +518,8 @@ public class RunNiFi {
             boolean running = false;
             String line;
             try (final InputStream in = proc.getInputStream();
-                final Reader streamReader = new InputStreamReader(in);
-                final BufferedReader reader = new 
BufferedReader(streamReader)) {
+                 final Reader streamReader = new InputStreamReader(in);
+                 final BufferedReader reader = new 
BufferedReader(streamReader)) {
 
                 while ((line = reader.readLine()) != null) {
                     if (line.trim().startsWith(pid)) {
@@ -578,7 +577,7 @@ public class RunNiFi {
             return new Status(port, pid, true, true);
         }
 
-        final boolean alive = (pid == null) ? false : isProcessRunning(pid, 
logger);
+        final boolean alive = pid != null && isProcessRunning(pid, logger);
         return new Status(port, pid, pingSuccess, alive);
     }
 
@@ -587,7 +586,7 @@ public class RunNiFi {
         final Status status = getStatus(logger);
         if (status.isRespondingToPing()) {
             logger.info("Apache NiFi is currently running, listening to 
Bootstrap on port {}, PID={}",
-                new Object[]{status.getPort(), status.getPid() == null ? 
"unknown" : status.getPid()});
+                    new Object[]{status.getPort(), status.getPid() == null ? 
"unknown" : status.getPid()});
             return;
         }
 
@@ -608,7 +607,7 @@ public class RunNiFi {
         }
     }
 
-    public void env(){
+    public void env() {
         final Logger logger = cmdLogger;
         final Status status = getStatus(logger);
         if (status.getPid() == null) {
@@ -641,19 +640,19 @@ public class RunNiFi {
             return;
         }
 
-        try{
+        try {
             final Method getSystemPropertiesMethod = 
virtualMachine.getClass().getMethod("getSystemProperties");
 
-            final Properties sysProps = 
(Properties)getSystemPropertiesMethod.invoke(virtualMachine);
+            final Properties sysProps = (Properties) 
getSystemPropertiesMethod.invoke(virtualMachine);
             for (Entry<Object, Object> syspropEntry : sysProps.entrySet()) {
-                logger.info(syspropEntry.getKey().toString() + " = " 
+syspropEntry.getValue().toString());
+                logger.info(syspropEntry.getKey().toString() + " = " + 
syspropEntry.getValue().toString());
             }
         } catch (Throwable t) {
             throw new RuntimeException(t);
         } finally {
             try {
                 detachMethod.invoke(virtualMachine);
-            } catch (final Exception e){
+            } catch (final Exception e) {
                 logger.warn("Caught exception detaching from process", e);
             }
         }
@@ -721,7 +720,7 @@ public class RunNiFi {
         }
 
         serviceManager.notify(NotificationType.NIFI_STOPPED, "NiFi Stopped on 
Host " + hostname,
-            "Hello,\n\nApache NiFi has been told to initiate a shutdown on 
host " + hostname + " at " + now + " by user " + user);
+                "Hello,\n\nApache NiFi has been told to initiate a shutdown on 
host " + hostname + " at " + now + " by user " + user);
     }
 
     public void stop() throws IOException {
@@ -824,9 +823,9 @@ public class RunNiFi {
         } catch (final IOException ioe) {
             if (pid == null) {
                 logger.error("Failed to send shutdown command to port {} due 
to {}. No PID found for the NiFi process, so unable to kill process; "
-                    + "the process should be killed manually.", new Object[] 
{port, ioe.toString()});
+                        + "the process should be killed manually.", new 
Object[]{port, ioe.toString()});
             } else {
-                logger.error("Failed to send shutdown command to port {} due 
to {}. Will kill the NiFi Process with PID {}.", new Object[] {port, 
ioe.toString(), pid});
+                logger.error("Failed to send shutdown command to port {} due 
to {}. Will kill the NiFi Process with PID {}.", port, ioe.toString(), pid);
                 notifyStop();
                 killProcessTree(pid, logger);
                 if (statusFile.exists() && !statusFile.delete()) {
@@ -844,7 +843,7 @@ public class RunNiFi {
         final Process proc = Runtime.getRuntime().exec(new String[]{"ps", 
"-o", "pid", "--no-headers", "--ppid", ppid});
         final List<String> childPids = new ArrayList<>();
         try (final InputStream in = proc.getInputStream();
-            final BufferedReader reader = new BufferedReader(new 
InputStreamReader(in))) {
+             final BufferedReader reader = new BufferedReader(new 
InputStreamReader(in))) {
 
             String line;
             while ((line = reader.readLine()) != null) {
@@ -900,7 +899,7 @@ public class RunNiFi {
         }
 
         final File prevLockFile = getLockFile(cmdLogger);
-        if (prevLockFile.exists() && !prevLockFile.delete()){
+        if (prevLockFile.exists() && !prevLockFile.delete()) {
             cmdLogger.warn("Failed to delete previous lock file {}; this file 
should be cleaned up manually", prevLockFile);
         }
 
@@ -931,7 +930,7 @@ public class RunNiFi {
             builder.directory(workingDir);
         }
 
-        final String nifiLogDir = 
replaceNull(System.getProperty("org.apache.nifi.bootstrap.config.log.dir"),DEFAULT_LOG_DIR).trim();
+        final String nifiLogDir = 
replaceNull(System.getProperty("org.apache.nifi.bootstrap.config.log.dir"), 
DEFAULT_LOG_DIR).trim();
 
         final String libFilename = replaceNull(props.get("lib.dir"), 
"./lib").trim();
         File libDir = getFile(libFilename, workingDir);
@@ -1001,7 +1000,7 @@ public class RunNiFi {
             if (javaHome != null) {
                 String fileExtension = isWindows() ? ".exe" : "";
                 File javaFile = new File(javaHome + File.separatorChar + "bin"
-                    + File.separatorChar + "java" + fileExtension);
+                        + File.separatorChar + "java" + fileExtension);
                 if (javaFile.exists() && javaFile.canExecute()) {
                     javaCmd = javaFile.getAbsolutePath();
                 }
@@ -1020,14 +1019,22 @@ public class RunNiFi {
         cmd.add("-Dnifi.properties.file.path=" + nifiPropsFilename);
         cmd.add("-Dnifi.bootstrap.listen.port=" + listenPort);
         cmd.add("-Dapp=NiFi");
-        cmd.add("-Dorg.apache.nifi.bootstrap.config.log.dir="+nifiLogDir);
+        cmd.add("-Dorg.apache.nifi.bootstrap.config.log.dir=" + nifiLogDir);
         cmd.add("org.apache.nifi.NiFi");
+        if (props.containsKey(NIFI_BOOTSTRAP_SENSITIVE_KEY) && 
props.get(NIFI_BOOTSTRAP_SENSITIVE_KEY) != null) {
+            cmd.add("-k " + props.get(NIFI_BOOTSTRAP_SENSITIVE_KEY));
+        }
 
         builder.command(cmd);
 
         final StringBuilder cmdBuilder = new StringBuilder();
         for (final String s : cmd) {
-            cmdBuilder.append(s).append(" ");
+            // Mask the key
+            if (s.startsWith("-k ")) {
+                cmdBuilder.append("-k ****");
+            } else {
+                cmdBuilder.append(s).append(" ");
+            }
         }
 
         cmdLogger.info("Starting Apache NiFi...");
@@ -1044,12 +1051,12 @@ public class RunNiFi {
             gracefulShutdownSeconds = Integer.parseInt(gracefulShutdown);
         } catch (final NumberFormatException nfe) {
             throw new NumberFormatException("The '" + GRACEFUL_SHUTDOWN_PROP + 
"' property in Bootstrap Config File "
-                + bootstrapConfigAbsoluteFile.getAbsolutePath() + " has an 
invalid value. Must be a non-negative integer");
+                    + bootstrapConfigAbsoluteFile.getAbsolutePath() + " has an 
invalid value. Must be a non-negative integer");
         }
 
         if (gracefulShutdownSeconds < 0) {
             throw new NumberFormatException("The '" + GRACEFUL_SHUTDOWN_PROP + 
"' property in Bootstrap Config File "
-                + bootstrapConfigAbsoluteFile.getAbsolutePath() + " has an 
invalid value. Must be a non-negative integer");
+                    + bootstrapConfigAbsoluteFile.getAbsolutePath() + " has an 
invalid value. Must be a non-negative integer");
         }
 
         Process process = builder.start();
@@ -1057,9 +1064,9 @@ public class RunNiFi {
         Long pid = getPid(process, cmdLogger);
         if (pid != null) {
             nifiPid = pid;
-            final Properties nifiProps = new Properties();
-            nifiProps.setProperty(PID_KEY, String.valueOf(nifiPid));
-            saveProperties(nifiProps, cmdLogger);
+            final Properties pidProperties = new Properties();
+            pidProperties.setProperty(PID_KEY, String.valueOf(nifiPid));
+            savePidProperties(pidProperties, cmdLogger);
         }
 
         shutdownHook = new ShutdownHook(process, this, secretKey, 
gracefulShutdownSeconds, loggingExecutor);
@@ -1098,7 +1105,7 @@ public class RunNiFi {
                         return;
                     }
 
-                    final File  lockFile = getLockFile(defaultLogger);
+                    final File lockFile = getLockFile(defaultLogger);
                     if (lockFile.exists()) {
                         defaultLogger.info("A shutdown was initiated. Will not 
restart NiFi");
                         return;
@@ -1119,9 +1126,9 @@ public class RunNiFi {
                     pid = getPid(process, defaultLogger);
                     if (pid != null) {
                         nifiPid = pid;
-                        final Properties nifiProps = new Properties();
-                        nifiProps.setProperty(PID_KEY, 
String.valueOf(nifiPid));
-                        saveProperties(nifiProps, defaultLogger);
+                        final Properties pidProperties = new Properties();
+                        pidProperties.setProperty(PID_KEY, 
String.valueOf(nifiPid));
+                        savePidProperties(pidProperties, defaultLogger);
                     }
 
                     shutdownHook = new ShutdownHook(process, this, secretKey, 
gracefulShutdownSeconds, loggingExecutor);
@@ -1134,14 +1141,14 @@ public class RunNiFi {
                         // We are expected to restart nifi, so send a 
notification that it died. If we are not restarting nifi,
                         // then this means that we are intentionally stopping 
the service.
                         serviceManager.notify(NotificationType.NIFI_DIED, 
"NiFi Died on Host " + hostname,
-                            "Hello,\n\nIt appears that Apache NiFi has died on 
host " + hostname + " at " + now + "; automatically restarting NiFi");
+                                "Hello,\n\nIt appears that Apache NiFi has 
died on host " + hostname + " at " + now + "; automatically restarting NiFi");
                     } else {
                         defaultLogger.error("Apache NiFi does not appear to 
have started");
                         // We are expected to restart nifi, so send a 
notification that it died. If we are not restarting nifi,
                         // then this means that we are intentionally stopping 
the service.
                         serviceManager.notify(NotificationType.NIFI_DIED, 
"NiFi Died on Host " + hostname,
-                            "Hello,\n\nIt appears that Apache NiFi has died on 
host " + hostname + " at " + now +
-                                ". Attempted to restart NiFi but the services 
does not appear to have restarted!");
+                                "Hello,\n\nIt appears that Apache NiFi has 
died on host " + hostname + " at " + now +
+                                        ". Attempted to restart NiFi but the 
services does not appear to have restarted!");
                     }
                 } else {
                     return;
@@ -1261,7 +1268,7 @@ public class RunNiFi {
         this.autoRestartNiFi = restart;
     }
 
-    void setNiFiCommandControlPort(final int port, final String secretKey) 
throws IOException{
+    void setNiFiCommandControlPort(final int port, final String secretKey) 
throws IOException {
         this.ccPort = port;
         this.secretKey = secretKey;
 
@@ -1279,7 +1286,7 @@ public class RunNiFi {
         nifiProps.setProperty("secret.key", secretKey);
 
         try {
-            saveProperties(nifiProps, defaultLogger);
+            savePidProperties(nifiProps, defaultLogger);
         } catch (final IOException ioe) {
             defaultLogger.warn("Apache NiFi has started but failed to persist 
NiFi Port information to {} due to {}", new 
Object[]{statusFile.getAbsolutePath(), ioe});
         }

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
----------------------------------------------------------------------
diff --git 
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
 
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
index 4a7e5d8..619c104 100644
--- 
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
+++ 
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/NiFiProperties.java
@@ -38,7 +38,7 @@ import java.util.Set;
  * values to be available at runtime. It is strongly tied to the startup
  * properties needed and is often refer to as the 'nifi.properties' file. The
  * properties contains keys and values. Great care should be taken in 
leveraging
- * this class or passing it along. It's use should be refactored and minimized
+ * this class or passing it along. Its use should be refactored and minimized
  * over time.
  */
 public abstract class NiFiProperties {
@@ -247,9 +247,9 @@ public abstract class NiFiProperties {
     public static final String DEFAULT_KERBEROS_AUTHENTICATION_EXPIRATION = 
"12 hours";
 
     /**
-     * Retrieves the property value for the given property key
+     * Retrieves the property value for the given property key.
      *
-     * @param key the key of property value to lookup.
+     * @param key the key of property value to lookup
      * @return value of property at given key or null if not found
      */
     public abstract String getProperty(String key);
@@ -257,7 +257,7 @@ public abstract class NiFiProperties {
     /**
      * Retrieves all known property keys.
      *
-     * @return all known property keys.
+     * @return all known property keys
      */
     public abstract Set<String> getPropertyKeys();
 
@@ -375,11 +375,7 @@ public abstract class NiFiProperties {
     public Boolean isSiteToSiteSecure() {
         final String secureVal = getProperty(SITE_TO_SITE_SECURE, "true");
 
-        if ("false".equalsIgnoreCase(secureVal)) {
-            return false;
-        } else {
-            return true;
-        }
+        return !"false".equalsIgnoreCase(secureVal);
 
     }
 
@@ -389,11 +385,7 @@ public abstract class NiFiProperties {
     public Boolean isSiteToSiteHttpEnabled() {
         final String remoteInputHttpEnabled = 
getProperty(SITE_TO_SITE_HTTP_ENABLED, "false");
 
-        if ("true".equalsIgnoreCase(remoteInputHttpEnabled)) {
-            return true;
-        } else {
-            return false;
-        }
+        return "true".equalsIgnoreCase(remoteInputHttpEnabled);
 
     }
 
@@ -769,8 +761,8 @@ public abstract class NiFiProperties {
      * Returns true if client certificates are required for REST API. 
Determined
      * if the following conditions are all true:
      *
-     * - login identity provider is not populated - Kerberos service support is
-     * not enabled
+     * - login identity provider is not populated
+     * - Kerberos service support is not enabled
      *
      * @return true if client certificates are required for access to the REST
      * API

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/StringUtils.java
----------------------------------------------------------------------
diff --git 
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/StringUtils.java
 
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/StringUtils.java
index aa6f8f3..37408f7 100644
--- 
a/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/StringUtils.java
+++ 
b/nifi-commons/nifi-properties/src/main/java/org/apache/nifi/util/StringUtils.java
@@ -16,6 +16,8 @@
  */
 package org.apache.nifi.util;
 
+import java.util.Collection;
+
 /**
  * String Utils based on the Apache Commons Lang String Utils.
  * These simple util methods here allow us to avoid a dependency in the core
@@ -63,4 +65,38 @@ public class StringUtils {
         }
         return str.substring(pos + separator.length());
     }
+
+    public static String join(final Collection collection, String delimiter) {
+        if (collection == null || collection.size() == 0) {
+            return EMPTY;
+        }
+        final StringBuilder sb = new StringBuilder(collection.size() * 16);
+        for (Object element : collection) {
+            sb.append((String) element);
+            sb.append(delimiter);
+        }
+        return sb.toString().substring(0, sb.lastIndexOf(delimiter));
+    }
+
+    public static String padLeft(final String source, int length, char 
padding) {
+        if (source != null) {
+            StringBuilder sb = new StringBuilder(source).reverse();
+            while (sb.length() < length) {
+                sb.append(padding);
+            }
+            return sb.reverse().toString();
+        }
+        return null;
+    }
+
+    public static String padRight(final String source, int length, char 
padding) {
+        if (source != null) {
+            StringBuilder sb = new StringBuilder(source);
+            while (sb.length() < length) {
+                sb.append(padding);
+            }
+            return sb.toString();
+        }
+        return null;
+    }
 }

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-commons/nifi-properties/src/test/java/org/apache/nifi/util/NiFiPropertiesTest.java
----------------------------------------------------------------------
diff --git 
a/nifi-commons/nifi-properties/src/test/java/org/apache/nifi/util/NiFiPropertiesTest.java
 
b/nifi-commons/nifi-properties/src/test/java/org/apache/nifi/util/NiFiPropertiesTest.java
index 3547b92..e174d14 100644
--- 
a/nifi-commons/nifi-properties/src/test/java/org/apache/nifi/util/NiFiPropertiesTest.java
+++ 
b/nifi-commons/nifi-properties/src/test/java/org/apache/nifi/util/NiFiPropertiesTest.java
@@ -80,11 +80,11 @@ public class NiFiPropertiesTest {
 
     }
 
-    private NiFiProperties loadNiFiProperties(final String propsPath) {
+    private NiFiProperties loadNiFiProperties(final String propsPath){
         String realPath = null;
-        try {
+        try{
             realPath = 
NiFiPropertiesTest.class.getResource(propsPath).toURI().getPath();
-        } catch (final URISyntaxException ex) {
+        }catch(final URISyntaxException ex){
             throw new RuntimeException(ex);
         }
         return NiFiProperties.createBasicNiFiProperties(realPath, null);

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/SortColumn.java
----------------------------------------------------------------------
diff --git 
a/nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/SortColumn.java
 
b/nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/SortColumn.java
index 30d285c..9f03769 100644
--- 
a/nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/SortColumn.java
+++ 
b/nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/SortColumn.java
@@ -27,7 +27,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
     /**
      * Sort based on the current position in the queue
      */
-    QUEUE_POSITION (new Comparator<FlowFileSummary>() {
+    QUEUE_POSITION(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return Integer.compare(o1.getPosition(), o2.getPosition());
@@ -37,7 +37,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
     /**
      * Sort based on the UUID of the FlowFile
      */
-    FLOWFILE_UUID (new Comparator<FlowFileSummary>() {
+    FLOWFILE_UUID(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return o1.getUuid().compareTo(o2.getUuid());
@@ -47,7 +47,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
     /**
      * Sort based on the 'filename' attribute of the FlowFile
      */
-    FILENAME (new Comparator<FlowFileSummary>() {
+    FILENAME(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return o1.getFilename().compareTo(o2.getFilename());
@@ -67,7 +67,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
     /**
      * Sort based on how long the FlowFile has been sitting in the queue
      */
-    QUEUED_DURATION (new Comparator<FlowFileSummary>() {
+    QUEUED_DURATION(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return -Long.compare(o1.getLastQueuedTime(), 
o2.getLastQueuedTime());
@@ -78,7 +78,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
      * Sort based on the age of the FlowFile. I.e., the time at which the 
FlowFile's
      * "greatest ancestor" entered the flow
      */
-    FLOWFILE_AGE (new Comparator<FlowFileSummary>() {
+    FLOWFILE_AGE(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return Long.compare(o1.getLineageStartDate(), 
o2.getLineageStartDate());
@@ -88,7 +88,7 @@ public enum SortColumn implements Comparator<FlowFileSummary> 
{
     /**
      * Sort based on when the FlowFile's penalization ends
      */
-    PENALIZATION (new Comparator<FlowFileSummary>() {
+    PENALIZATION(new Comparator<FlowFileSummary>() {
         @Override
         public int compare(final FlowFileSummary o1, final FlowFileSummary o2) 
{
             return Boolean.compare(o1.isPenalized(), o2.isPenalized());

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPUtils.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPUtils.java
 
b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPUtils.java
index 6cfa2c7..68302a2 100644
--- 
a/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPUtils.java
+++ 
b/nifi-nar-bundles/nifi-amqp-bundle/nifi-amqp-processors/src/main/java/org/apache/nifi/amqp/processors/AMQPUtils.java
@@ -32,7 +32,6 @@ import com.rabbitmq.client.AMQP.BasicProperties;
 
 /**
  * Utility helper class simplify interactions with target AMQP API and NIFI 
API.
- *
  */
 abstract class AMQPUtils {
 
@@ -43,20 +42,20 @@ abstract class AMQPUtils {
     private final static Logger logger = 
LoggerFactory.getLogger(AMQPUtils.class);
 
     public enum PropertyNames {
-        CONTENT_TYPE (AMQP_PROP_PREFIX + "contentType"),
-        CONTENT_ENCODING (AMQP_PROP_PREFIX + "contentEncoding"),
-        HEADERS (AMQP_PROP_PREFIX + "headers"),
-        DELIVERY_MODE (AMQP_PROP_PREFIX + "deliveryMode"),
-        PRIORITY (AMQP_PROP_PREFIX + "priority"),
-        CORRELATION_ID (AMQP_PROP_PREFIX + "correlationId"),
-        REPLY_TO (AMQP_PROP_PREFIX + "replyTo"),
-        EXPIRATION (AMQP_PROP_PREFIX + "expiration"),
-        MESSAGE_ID (AMQP_PROP_PREFIX + "messageId"),
-        TIMESTAMP (AMQP_PROP_PREFIX + "timestamp"),
-        TYPE (AMQP_PROP_PREFIX + "type"),
-        USER_ID (AMQP_PROP_PREFIX + "userId"),
-        APP_ID (AMQP_PROP_PREFIX + "appId"),
-        CLUSTER_ID (AMQP_PROP_PREFIX + "clusterId");
+        CONTENT_TYPE(AMQP_PROP_PREFIX + "contentType"),
+        CONTENT_ENCODING(AMQP_PROP_PREFIX + "contentEncoding"),
+        HEADERS(AMQP_PROP_PREFIX + "headers"),
+        DELIVERY_MODE(AMQP_PROP_PREFIX + "deliveryMode"),
+        PRIORITY(AMQP_PROP_PREFIX + "priority"),
+        CORRELATION_ID(AMQP_PROP_PREFIX + "correlationId"),
+        REPLY_TO(AMQP_PROP_PREFIX + "replyTo"),
+        EXPIRATION(AMQP_PROP_PREFIX + "expiration"),
+        MESSAGE_ID(AMQP_PROP_PREFIX + "messageId"),
+        TIMESTAMP(AMQP_PROP_PREFIX + "timestamp"),
+        TYPE(AMQP_PROP_PREFIX + "type"),
+        USER_ID(AMQP_PROP_PREFIX + "userId"),
+        APP_ID(AMQP_PROP_PREFIX + "appId"),
+        CLUSTER_ID(AMQP_PROP_PREFIX + "clusterId");
 
         PropertyNames(String value) {
             this.value = value;
@@ -71,7 +70,7 @@ abstract class AMQPUtils {
         }
 
         static {
-            for(PropertyNames propertyNames : PropertyNames.values()) {
+            for (PropertyNames propertyNames : PropertyNames.values()) {
                 lookup.put(propertyNames.getValue(), propertyNames);
             }
         }
@@ -89,15 +88,12 @@ abstract class AMQPUtils {
     /**
      * Updates {@link FlowFile} with attributes representing AMQP properties
      *
-     * @param amqpProperties
-     *            instance of {@link BasicProperties}
-     * @param flowFile
-     *            instance of target {@link FlowFile}
-     * @param processSession
-     *            instance of {@link ProcessSession}
+     * @param amqpProperties instance of {@link BasicProperties}
+     * @param flowFile       instance of target {@link FlowFile}
+     * @param processSession instance of {@link ProcessSession}
      */
     public static FlowFile 
updateFlowFileAttributesWithAmqpProperties(BasicProperties amqpProperties, 
FlowFile flowFile, ProcessSession processSession) {
-        if (amqpProperties != null){
+        if (amqpProperties != null) {
             try {
                 Method[] methods = BasicProperties.class.getDeclaredMethods();
                 Map<String, String> attributes = new HashMap<>();
@@ -126,8 +122,7 @@ abstract class AMQPUtils {
     /**
      * Will validate if provided name corresponds to valid AMQP property.
      *
-     * @param name
-     *            the name of the property
+     * @param name the name of the property
      * @return 'true' if valid otherwise 'false'
      */
     public static boolean isValidAmqpPropertyName(String name) {
@@ -147,11 +142,10 @@ abstract class AMQPUtils {
      * Will validate if provided amqpPropValue can be converted to a {@link 
Map}.
      * Should be passed in the format: amqp$headers=key=value,key=value etc.
      *
-     * @param amqpPropValue
-     *            the value of the property
+     * @param amqpPropValue the value of the property
      * @return {@link Map} if valid otherwise null
      */
-    public static Map<String, Object> validateAMQPHeaderProperty(String 
amqpPropValue){
+    public static Map<String, Object> validateAMQPHeaderProperty(String 
amqpPropValue) {
         String[] strEntries = amqpPropValue.split(",");
         Map<String, Object> headers = new HashMap<>();
         for (String strEntry : strEntries) {
@@ -170,11 +164,10 @@ abstract class AMQPUtils {
      * Will validate if provided amqpPropValue can be converted to an {@link 
Integer}, and that its
      * value is 1 or 2.
      *
-     * @param amqpPropValue
-     *            the value of the property
+     * @param amqpPropValue the value of the property
      * @return {@link Integer} if valid otherwise null
      */
-    public static Integer validateAMQPDeliveryModeProperty(String 
amqpPropValue){
+    public static Integer validateAMQPDeliveryModeProperty(String 
amqpPropValue) {
         Integer deliveryMode = toInt(amqpPropValue);
 
         if (deliveryMode == null || !(deliveryMode == 1 || deliveryMode == 2)) 
{
@@ -187,14 +180,13 @@ abstract class AMQPUtils {
      * Will validate if provided amqpPropValue can be converted to an {@link 
Integer} and that its
      * value is between 0 and 9 (inclusive).
      *
-     * @param amqpPropValue
-     *            the value of the property
+     * @param amqpPropValue the value of the property
      * @return {@link Integer} if valid otherwise null
      */
-    public static Integer validateAMQPPriorityProperty(String amqpPropValue){
+    public static Integer validateAMQPPriorityProperty(String amqpPropValue) {
         Integer priority = toInt(amqpPropValue);
 
-        if (priority == null || !(priority >= 0 && priority <= 9)){
+        if (priority == null || !(priority >= 0 && priority <= 9)) {
             logger.warn("Invalid value for AMQP priority property: " + 
amqpPropValue);
         }
         return priority;
@@ -203,14 +195,13 @@ abstract class AMQPUtils {
     /**
      * Will validate if provided amqpPropValue can be converted to a {@link 
Date}.
      *
-     * @param amqpPropValue
-     *            the value of the property
+     * @param amqpPropValue the value of the property
      * @return {@link Date} if valid otherwise null
      */
-    public static Date validateAMQPTimestampProperty(String amqpPropValue){
+    public static Date validateAMQPTimestampProperty(String amqpPropValue) {
         Long timestamp = toLong(amqpPropValue);
 
-        if (timestamp == null){
+        if (timestamp == null) {
             logger.warn("Invalid value for AMQP timestamp property: " + 
amqpPropValue);
             return null;
         }
@@ -222,14 +213,13 @@ abstract class AMQPUtils {
     /**
      * Takes a {@link String} and tries to convert to an {@link Integer}.
      *
-     * @param strVal
-     *            the value to be converted
+     * @param strVal the value to be converted
      * @return {@link Integer} if valid otherwise null
      */
-    private static Integer toInt(String strVal){
+    private static Integer toInt(String strVal) {
         try {
             return Integer.parseInt(strVal);
-        } catch (NumberFormatException aE){
+        } catch (NumberFormatException aE) {
             return null;
         }
     }
@@ -237,14 +227,13 @@ abstract class AMQPUtils {
     /**
      * Takes a {@link String} and tries to convert to a {@link Long}.
      *
-     * @param strVal
-     *            the value to be converted
+     * @param strVal the value to be converted
      * @return {@link Long} if valid otherwise null
      */
-    private static Long toLong(String strVal){
+    private static Long toLong(String strVal) {
         try {
             return Long.parseLong(strVal);
-        } catch (NumberFormatException aE){
+        } catch (NumberFormatException aE) {
             return null;
         }
     }

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
index 20fbfd2..716610c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/heartbeat/ClusterProtocolHeartbeatMonitor.java
@@ -25,10 +25,8 @@ import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
 import java.util.function.Function;
 import java.util.stream.Collectors;
-
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.Unmarshaller;
-
 import org.apache.nifi.cluster.coordination.ClusterCoordinator;
 import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
 import org.apache.nifi.cluster.coordination.node.NodeConnectionStatus;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/StatusHistoryEndpointMerger.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/StatusHistoryEndpointMerger.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/StatusHistoryEndpointMerger.java
index ddd8759..60b40f7 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/StatusHistoryEndpointMerger.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/http/endpoints/StatusHistoryEndpointMerger.java
@@ -26,7 +26,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
 import java.util.regex.Pattern;
-
 import org.apache.nifi.cluster.coordination.http.EndpointResponseMerger;
 import org.apache.nifi.cluster.manager.NodeResponse;
 import org.apache.nifi.cluster.protocol.NodeIdentifier;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/CuratorNodeProtocolSender.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/CuratorNodeProtocolSender.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/CuratorNodeProtocolSender.java
index 1847461..0806959 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/CuratorNodeProtocolSender.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/CuratorNodeProtocolSender.java
@@ -19,7 +19,6 @@ package org.apache.nifi.cluster.coordination.node;
 import java.io.IOException;
 import java.net.InetSocketAddress;
 import java.nio.charset.StandardCharsets;
-
 import org.apache.curator.RetryPolicy;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
index 2d25c8e..b1a088e 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/main/java/org/apache/nifi/cluster/coordination/node/NodeClusterCoordinator.java
@@ -31,7 +31,6 @@ import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.Supplier;
 import java.util.regex.Pattern;
 import java.util.stream.Collectors;
-
 import org.apache.commons.collections4.queue.CircularFifoQueue;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.nifi.cluster.coordination.ClusterCoordinator;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/replication/TestThreadPoolRequestReplicator.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/replication/TestThreadPoolRequestReplicator.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/replication/TestThreadPoolRequestReplicator.java
index 9c56fb9..e699fca 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/replication/TestThreadPoolRequestReplicator.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/http/replication/TestThreadPoolRequestReplicator.java
@@ -22,6 +22,13 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
+import com.sun.jersey.api.client.Client;
+import com.sun.jersey.api.client.ClientHandlerException;
+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.core.header.InBoundHeaders;
+import com.sun.jersey.core.header.OutBoundHeaders;
 import java.io.ByteArrayInputStream;
 import java.net.SocketTimeoutException;
 import java.net.URI;
@@ -34,9 +41,7 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicInteger;
-
 import javax.ws.rs.HttpMethod;
-
 import org.apache.commons.collections4.map.MultiValueMap;
 import org.apache.nifi.cluster.coordination.ClusterCoordinator;
 import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
@@ -57,14 +62,6 @@ import org.mockito.internal.util.reflection.Whitebox;
 import org.mockito.invocation.InvocationOnMock;
 import org.mockito.stubbing.Answer;
 
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientHandlerException;
-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.core.header.InBoundHeaders;
-import com.sun.jersey.core.header.OutBoundHeaders;
-
 public class TestThreadPoolRequestReplicator {
 
     @BeforeClass

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/node/TestNodeClusterCoordinator.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/node/TestNodeClusterCoordinator.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/node/TestNodeClusterCoordinator.java
index 00edbc4..e55605b 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/node/TestNodeClusterCoordinator.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/coordination/node/TestNodeClusterCoordinator.java
@@ -32,7 +32,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.stream.Collectors;
-
 import 
org.apache.nifi.cluster.manager.exception.IllegalNodeDisconnectionException;
 import org.apache.nifi.cluster.protocol.ConnectionRequest;
 import org.apache.nifi.cluster.protocol.ConnectionResponse;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/integration/Node.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/integration/Node.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/integration/Node.java
index a8b51f2..b9372a6 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/integration/Node.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-cluster/src/test/java/org/apache/nifi/cluster/integration/Node.java
@@ -28,7 +28,6 @@ import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
-
 import org.apache.commons.lang3.builder.HashCodeBuilder;
 import org.apache.nifi.authorization.Authorizer;
 import org.apache.nifi.cluster.ReportedEvent;
@@ -65,7 +64,6 @@ import org.apache.nifi.registry.VariableRegistry;
 import org.apache.nifi.reporting.BulletinRepository;
 import org.apache.nifi.reporting.Severity;
 import org.apache.nifi.util.NiFiProperties;
-import org.apache.nifi.web.Revision;
 import org.apache.nifi.web.revision.RevisionManager;
 import org.junit.Assert;
 import org.mockito.Mockito;
@@ -117,7 +115,7 @@ public class Node {
         };
 
         revisionManager = Mockito.mock(RevisionManager.class);
-        
Mockito.when(revisionManager.getAllRevisions()).thenReturn(Collections.<Revision>
 emptyList());
+        
Mockito.when(revisionManager.getAllRevisions()).thenReturn(Collections.emptyList());
 
         electionManager = new CuratorLeaderElectionManager(4, nodeProperties);
     }

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
index f46792f..094490b 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/pom.xml
@@ -30,6 +30,10 @@
         </dependency>
         <dependency>
             <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-properties-loader</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
             <artifactId>nifi-api</artifactId>
         </dependency>
         <dependency>

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/connectable/StandardConnection.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/connectable/StandardConnection.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/connectable/StandardConnection.java
index 2a0f0de..6d22281 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/connectable/StandardConnection.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/connectable/StandardConnection.java
@@ -16,6 +16,17 @@
  */
 package org.apache.nifi.connectable;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.stream.Collectors;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.builder.EqualsBuilder;
@@ -41,18 +52,6 @@ import org.apache.nifi.processor.FlowFileFilter;
 import org.apache.nifi.processor.Relationship;
 import org.apache.nifi.provenance.ProvenanceEventRepository;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.stream.Collectors;
-
 /**
  * Models a connection between connectable components. A connection may contain
  * one or more relationships that map the source component to the destination

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
index a61d7fe..3c4610f 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/FileSystemSwapManager.java
@@ -37,7 +37,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.UUID;
 import java.util.regex.Pattern;
-
 import org.apache.nifi.controller.queue.FlowFileQueue;
 import org.apache.nifi.controller.queue.QueueSize;
 import org.apache.nifi.controller.repository.FlowFileRecord;
@@ -351,7 +350,7 @@ public class FileSystemSwapManager implements 
FlowFileSwapManager {
             out.flush();
         }
 
-        logger.info("Successfully swapped out {} FlowFiles from {} to Swap 
File {}", new Object[]{toSwap.size(), queue, swapLocation});
+        logger.info("Successfully swapped out {} FlowFiles from {} to Swap 
File {}", toSwap.size(), queue, swapLocation);
 
         return toSwap.size();
     }
@@ -399,8 +398,8 @@ public class FileSystemSwapManager implements 
FlowFileSwapManager {
             }
         } catch (final EOFException eof) {
             final QueueSize queueSize = new QueueSize(numRecords, contentSize);
-            final SwapSummary summary = new StandardSwapSummary(queueSize, 
maxRecordId, Collections.<ResourceClaim>emptyList());
-            final SwapContents partialContents = new 
StandardSwapContents(summary, Collections.<FlowFileRecord>emptyList());
+            final SwapSummary summary = new StandardSwapSummary(queueSize, 
maxRecordId, Collections.emptyList());
+            final SwapContents partialContents = new 
StandardSwapContents(summary, Collections.emptyList());
             throw new IncompleteSwapFileException(swapLocation, 
partialContents);
         }
 

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/cluster/ClusterProtocolHeartbeater.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/cluster/ClusterProtocolHeartbeater.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/cluster/ClusterProtocolHeartbeater.java
index efc0588..e2e7f9c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/cluster/ClusterProtocolHeartbeater.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/cluster/ClusterProtocolHeartbeater.java
@@ -17,11 +17,9 @@
 package org.apache.nifi.controller.cluster;
 
 import java.io.IOException;
-
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
-
 import org.apache.nifi.cluster.coordination.ClusterCoordinator;
 import org.apache.nifi.cluster.coordination.node.ClusterRoles;
 import org.apache.nifi.cluster.coordination.node.NodeConnectionStatus;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
index 977580e..dfe456b 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/leader/election/CuratorLeaderElectionManager.java
@@ -18,7 +18,6 @@ package org.apache.nifi.controller.leader.election;
 
 import java.util.HashMap;
 import java.util.Map;
-
 import org.apache.commons.lang3.StringUtils;
 import org.apache.curator.RetryPolicy;
 import org.apache.curator.framework.CuratorFramework;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
index 15043c3..dc0e7c7 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
@@ -17,8 +17,8 @@
 package org.apache.nifi.encrypt;
 
 import java.security.Security;
-import org.apache.nifi.util.NiFiProperties;
 import org.apache.commons.lang3.StringUtils;
+import org.apache.nifi.util.NiFiProperties;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.jasypt.encryption.pbe.StandardPBEStringEncryptor;
 import org.jasypt.exceptions.EncryptionInitializationException;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
index 5fd0f1a..989e8dd 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/remote/StandardRemoteProcessGroup.java
@@ -16,10 +16,34 @@
  */
 package org.apache.nifi.remote;
 
+import static java.util.Objects.requireNonNull;
+
 import com.sun.jersey.api.client.ClientHandlerException;
 import com.sun.jersey.api.client.ClientResponse;
 import com.sun.jersey.api.client.ClientResponse.Status;
 import com.sun.jersey.api.client.UniformInterfaceException;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicReference;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import javax.net.ssl.SSLContext;
+import javax.ws.rs.core.Response;
 import org.apache.nifi.authorization.Resource;
 import org.apache.nifi.authorization.resource.Authorizable;
 import org.apache.nifi.authorization.resource.ResourceFactory;
@@ -52,31 +76,6 @@ import org.apache.nifi.web.api.dto.PortDTO;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import javax.net.ssl.SSLContext;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import static java.util.Objects.requireNonNull;
-
 /**
  * Represents the Root Process Group of a remote NiFi Instance. Holds
  * information about that remote instance, as well as {@link IncomingPort}s and
@@ -837,7 +836,7 @@ public class StandardRemoteProcessGroup implements 
RemoteProcessGroup {
             // perform the request
             final ControllerDTO dto;
             try (
-                    final SiteToSiteRestApiClient apiClient = 
getSiteToSiteRestApiClient();) {
+                    final SiteToSiteRestApiClient apiClient = 
getSiteToSiteRestApiClient()) {
                 dto = apiClient.getController();
             } catch (IOException e) {
                 writeLock.lock();
@@ -1202,8 +1201,8 @@ public class StandardRemoteProcessGroup implements 
RemoteProcessGroup {
                             if 
(Response.Status.Family.SUCCESSFUL.equals(requestAccountResponse.getStatusInfo().getFamily()))
 {
                                 logger.info("{} Issued a Request to 
communicate with remote instance", this);
                             } else {
-                                logger.error("{} Failed to request account: 
got unexpected response code of {}:{}", new Object[]{
-                                    this, requestAccountResponse.getStatus(), 
requestAccountResponse.getStatusInfo().getReasonPhrase()});
+                                logger.error("{} Failed to request account: 
got unexpected response code of {}:{}", this,
+                                        requestAccountResponse.getStatus(), 
requestAccountResponse.getStatusInfo().getReasonPhrase());
                             }
                         } catch (final Exception re) {
                             logger.error("{} Failed to request account due to 
{}", this, re.toString());

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml
index 7ca0130..bf3fd2a 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/resources/nifi-context.xml
@@ -16,18 +16,10 @@
 <beans default-lazy-init="true"
        xmlns="http://www.springframework.org/schema/beans";
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
-       xmlns:util="http://www.springframework.org/schema/util";
-       xmlns:context="http://www.springframework.org/schema/context";
-       xmlns:aop="http://www.springframework.org/schema/aop";
-       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
-    http://www.springframework.org/schema/util 
http://www.springframework.org/schema/util/spring-util-3.1.xsd
-    http://www.springframework.org/schema/context 
http://www.springframework.org/schema/context/spring-context-3.1.xsd
-    http://www.springframework.org/schema/aop 
http://www.springframework.org/schema/aop/spring-aop-3.1.xsd";>
+       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd";>
 
     <!-- nifi properties created via getInstance using a file path specified 
as a system property -->
-    <bean id="nifiProperties" class="org.apache.nifi.util.NiFiProperties" 
factory-method="createBasicNiFiProperties">
-        <constructor-arg index="0"><null /></constructor-arg>
-        <constructor-arg index="1"><null /></constructor-arg>
+    <bean id="nifiProperties" 
class="org.apache.nifi.properties.NiFiPropertiesLoader" 
factory-method="loadDefaultWithKeyFromBootstrap">
     </bean>
 
     <!-- variable registry -->

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
index 602ddce..bbcdc3b 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/TestFlowController.java
@@ -16,6 +16,21 @@
  */
 package org.apache.nifi.controller;
 
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.when;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.nio.charset.StandardCharsets;
+import java.util.HashMap;
+import java.util.LinkedHashSet;
+import java.util.Map;
+import java.util.Set;
 import org.apache.commons.io.IOUtils;
 import org.apache.nifi.admin.service.AuditService;
 import org.apache.nifi.authorization.AbstractPolicyBasedAuthorizer;
@@ -35,29 +50,13 @@ import org.apache.nifi.processor.Relationship;
 import org.apache.nifi.provenance.MockProvenanceRepository;
 import org.apache.nifi.registry.VariableRegistry;
 import org.apache.nifi.reporting.BulletinRepository;
+import org.apache.nifi.util.FileBasedVariableRegistry;
 import org.apache.nifi.util.NiFiProperties;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.mockito.Mockito;
 
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import java.util.HashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import org.apache.nifi.util.FileBasedVariableRegistry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.mockito.Mockito.when;
-
 public class TestFlowController {
 
     private FlowController controller;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java
index ff787be..e8185cb 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/TestStandardProcessScheduler.java
@@ -29,7 +29,6 @@ import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.concurrent.atomic.AtomicInteger;
-
 import org.apache.nifi.annotation.lifecycle.OnDisabled;
 import org.apache.nifi.annotation.lifecycle.OnEnabled;
 import org.apache.nifi.annotation.lifecycle.OnScheduled;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceProvider.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceProvider.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceProvider.java
index 3403346..f0e1566 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceProvider.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/service/TestStandardControllerServiceProvider.java
@@ -29,7 +29,6 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
-
 import org.apache.nifi.components.state.StateManager;
 import org.apache.nifi.components.state.StateManagerProvider;
 import org.apache.nifi.controller.FlowController;
@@ -430,7 +429,7 @@ public class TestStandardControllerServiceProvider {
         E.setProperty(ServiceA.OTHER_SERVICE.getName(), "A");
         E.setProperty(ServiceA.OTHER_SERVICE_2.getName(), "F");
 
-        provider.enableControllerServices(Arrays.asList(new 
ControllerServiceNode[]{A, B, C, D, E, F}));
+        provider.enableControllerServices(Arrays.asList(A, B, C, D, E, F));
 
         assertTrue(A.isActive());
         assertTrue(B.isActive());
@@ -473,7 +472,7 @@ public class TestStandardControllerServiceProvider {
         F.setProperty(ServiceA.OTHER_SERVICE.getName(), "D");
         D.setProperty(ServiceA.OTHER_SERVICE.getName(), "C");
 
-        provider.enableControllerServices(Arrays.asList(new 
ControllerServiceNode[]{C, F, A, B, D}));
+        provider.enableControllerServices(Arrays.asList(C, F, A, B, D));
 
         assertTrue(A.isActive());
         assertTrue(B.isActive());
@@ -516,7 +515,7 @@ public class TestStandardControllerServiceProvider {
         serviceNode7.setProperty(ServiceC.REQ_SERVICE_2.getName(), "3");
 
         provider.enableControllerServices(Arrays.asList(
-                new ControllerServiceNode[]{serviceNode1, serviceNode2, 
serviceNode3, serviceNode4, serviceNode5, serviceNode7}));
+                serviceNode1, serviceNode2, serviceNode3, serviceNode4, 
serviceNode5, serviceNode7));
         assertFalse(serviceNode1.isActive());
         assertFalse(serviceNode2.isActive());
         assertFalse(serviceNode3.isActive());
@@ -526,7 +525,7 @@ public class TestStandardControllerServiceProvider {
 
         provider.enableControllerService(serviceNode6);
         provider.enableControllerServices(Arrays.asList(
-                new ControllerServiceNode[]{serviceNode1, serviceNode2, 
serviceNode3, serviceNode4, serviceNode5}));
+                serviceNode1, serviceNode2, serviceNode3, serviceNode4, 
serviceNode5));
 
         assertTrue(serviceNode1.isActive());
         assertTrue(serviceNode2.isActive());

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
index 827abdd..ff11a9e 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-nar-utils/src/main/java/org/apache/nifi/nar/NarThreadContextClassLoader.java
@@ -173,14 +173,14 @@ public class NarThreadContextClassLoader extends 
URLClassLoader {
      * constructor or a constructor which takes a NiFiProperties object
      * (preferred).
      *
-     * @param <T> type
-     * @param implementationClassName class
-     * @param typeDefinition def
-     * @param nifiProperties props
+     * @param <T> the type to create an instance for
+     * @param implementationClassName the implementation class name
+     * @param typeDefinition the type definition
+     * @param nifiProperties the NiFiProperties instance
      * @return constructed instance
-     * @throws InstantiationException ex
-     * @throws IllegalAccessException ex
-     * @throws ClassNotFoundException ex
+     * @throws InstantiationException if there is an error instantiating the 
class
+     * @throws IllegalAccessException if there is an error accessing the type
+     * @throws ClassNotFoundException if the class cannot be found
      */
     public static <T> T createInstance(final String implementationClassName, 
final Class<T> typeDefinition, final NiFiProperties nifiProperties)
             throws InstantiationException, IllegalAccessException, 
ClassNotFoundException {
@@ -199,7 +199,7 @@ public class NarThreadContextClassLoader extends 
URLClassLoader {
 
             
Thread.currentThread().setContextClassLoader(detectedClassLoaderForType);
             final Class<?> desiredClass = rawClass.asSubclass(typeDefinition);
-            if (nifiProperties == null) {
+            if(nifiProperties == null){
                 return typeDefinition.cast(desiredClass.newInstance());
             }
             Constructor<?> constructor = null;

http://git-wip-us.apache.org/repos/asf/nifi/blob/c638191a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
----------------------------------------------------------------------
diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
new file mode 100644
index 0000000..f540b22
--- /dev/null
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-properties-loader/pom.xml
@@ -0,0 +1,53 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd";>
+    <!--
+      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.
+    -->
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.nifi</groupId>
+        <artifactId>nifi-framework</artifactId>
+        <version>1.0.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>nifi-properties-loader</artifactId>
+    <name>NiFi Properties Loader</name>
+    <description>Handles the loading of the nifi.properties file to an 
instance of NiFiProperties, and transparently
+        performs any decryption/retrieval of sensitive configuration 
properties.
+    </description>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-properties</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jul-to-slf4j</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>ch.qos.logback</groupId>
+            <artifactId>logback-classic</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.commons</groupId>
+            <artifactId>commons-lang3</artifactId>
+        </dependency>
+    </dependencies>
+</project>
\ No newline at end of file

Reply via email to