public abstract class AbstractBootstrapPropertiesLoader extends Object
| Modifier and Type | Field and Description |
|---|---|
private static String |
BOOTSTRAP_CONF |
private static org.slf4j.Logger |
logger |
private static String |
RELATIVE_APPLICATION_PROPERTIES_PATTERN |
| Constructor and Description |
|---|
AbstractBootstrapPropertiesLoader() |
| Modifier and Type | Method and Description |
|---|---|
String |
extractKeyFromBootstrapFile()
Returns the key (if any) used to encrypt sensitive properties, extracted from
$APPLICATION_HOME/conf/bootstrap.conf. |
String |
extractKeyFromBootstrapFile(String bootstrapPath)
Returns the key (if any) used to encrypt sensitive properties, extracted from
$APPLICATION_HOME/conf/bootstrap.conf. |
protected abstract String |
getApplicationPrefix()
Return the property prefix used in the bootstrap.conf file for this application.
|
protected abstract String |
getApplicationPropertiesFilename()
Return the name of the main application properties file (e.g., nifi.properties).
|
protected abstract String |
getApplicationPropertiesFilePathSystemProperty()
Return the system property name that should specify the file path of the main
application properties file.
|
private File |
getBootstrapFile(String bootstrapPath)
Returns the file for bootstrap.conf.
|
String |
getDefaultApplicationPropertiesFilePath()
Returns the default file path to
$APPLICATION_HOME/conf/$APPLICATION.properties. |
static BootstrapProperties |
loadBootstrapProperties(Path bootstrapPath,
String propertyPrefix)
Loads a properties file into a BootstrapProperties object.
|
BootstrapProperties |
loadBootstrapProperties(String bootstrapPath)
Loads the bootstrap.conf file into a BootstrapProperties object.
|
private static final org.slf4j.Logger logger
private static final String RELATIVE_APPLICATION_PROPERTIES_PATTERN
private static final String BOOTSTRAP_CONF
protected abstract String getApplicationPrefix()
protected abstract String getApplicationPropertiesFilename()
protected abstract String getApplicationPropertiesFilePathSystemProperty()
public String extractKeyFromBootstrapFile() throws IOException
$APPLICATION_HOME/conf/bootstrap.conf.IOException - if the file is not readablepublic BootstrapProperties loadBootstrapProperties(String bootstrapPath) throws IOException
bootstrapPath - the path to the bootstrap fileIOException - If the file is not readablepublic static BootstrapProperties loadBootstrapProperties(Path bootstrapPath, String propertyPrefix) throws IOException
bootstrapPath - The path to the properties filepropertyPrefix - The property prefix to enforceIOException - If the properties file could not be readpublic String extractKeyFromBootstrapFile(String bootstrapPath) throws IOException
$APPLICATION_HOME/conf/bootstrap.conf.bootstrapPath - the path to the bootstrap file (if null, returns the sensitive key
found in $APPLICATION_HOME/conf/bootstrap.conf)IOException - if the file is not readableprivate File getBootstrapFile(String bootstrapPath) throws IOException
bootstrapPath - the path to the bootstrap file (defaults to $APPLICATION_HOME/conf/bootstrap.conf
if null)$APPLICATION_HOME/conf/bootstrap.conf fileIOException - if the directory containing the file is not readablepublic String getDefaultApplicationPropertiesFilePath()
$APPLICATION_HOME/conf/$APPLICATION.properties. If the system
property provided by AbstractBootstrapPropertiesLoader#getApplicationPropertiesFilePathSystemProperty()
is not set, it will be set to the relative path provided by
AbstractBootstrapPropertiesLoader#getRelativeApplicationPropertiesFilePath().Copyright © 2023 Apache NiFi Project. All rights reserved.