/** * Returns the OpenId Connect (OIDC) URL. Null otherwise. * * @return OIDC discovery url */ public String getOidcDiscoveryUrl() { return getProperty(SECURITY_USER_OIDC_DISCOVERY_URL); }
/** * Returns the preferred json web signature algorithm. May be null/blank. * * @return OIDC preferred json web signature algorithm */ public String getOidcPreferredJwsAlgorithm() { return getProperty(SECURITY_USER_OIDC_PREFERRED_JWSALGORITHM); }
/** * Returns the auto refresh interval in seconds. * * @return the interval over which the properties should auto refresh */ public String getAutoRefreshInterval() { return getProperty(UI_AUTO_REFRESH_INTERVAL); }
/** * Returns the OpenId Connect client secret. * * @return OIDC client secret */ public String getOidcClientSecret() { return getProperty(SECURITY_USER_OIDC_CLIENT_SECRET); }
public Integer getPort() { Integer port = null; try { port = Integer.parseInt(getProperty(WEB_HTTP_PORT)); } catch (NumberFormatException nfe) { } return port; }
public Integer getSslPort() { Integer sslPort = null; try { sslPort = Integer.parseInt(getProperty(WEB_HTTPS_PORT)); } catch (NumberFormatException nfe) { } return sslPort; }
/** * Returns the path to the Knox public key. * * @return path to the Knox public key */ public Path getKnoxPublicKeyPath() { return Paths.get(getProperty(SECURITY_USER_KNOX_PUBLIC_KEY)); }
/** * @return True if property value is 'true'; False otherwise. */ public Boolean isSiteToSiteHttpEnabled() { final String remoteInputHttpEnabled = getProperty(SITE_TO_SITE_HTTP_ENABLED, "false"); return "true".equalsIgnoreCase(remoteInputHttpEnabled); }
/** * Returns the number of partitions that should be used for the FlowFile * Repository * * @return the number of partitions */ public int getFlowFileRepositoryPartitions() { final String rawProperty = getProperty(FLOWFILE_REPOSITORY_PARTITIONS, DEFAULT_FLOWFILE_REPO_PARTITIONS); return Integer.parseInt(rawProperty); }
private String getDatabaseUrl(File databaseFile) { String databaseUrl = "jdbc:h2:" + databaseFile + ";AUTOCOMMIT=OFF;DB_CLOSE_ON_EXIT=FALSE;LOCK_MODE=3"; String databaseUrlAppend = properties.getProperty(NiFiProperties.H2_URL_APPEND); if (StringUtils.isNotBlank(databaseUrlAppend)) { databaseUrl += databaseUrlAppend; } return databaseUrl; }
public File getFlowConfigurationFile() { try { return new File(getProperty(FLOW_CONFIGURATION_FILE)); } catch (Exception ex) { return null; } }
private String determineServerHostname(NiFiProperties props) { if (props.getSslPort() != null) { return props.getProperty(NiFiProperties.WEB_HTTPS_HOST, "localhost"); } else { return props.getProperty(NiFiProperties.WEB_HTTP_HOST, "localhost"); } }
/** * Returns the whitelisted proxy context paths as a list of paths. The paths have been normalized to the form {@code /some/context/path}. * * @return the path(s) */ public List<String> getWhitelistedContextPathsAsList() { String rawProperty = getProperty(WEB_PROXY_CONTEXT_PATH, ""); List<String> contextPaths = Arrays.asList(rawProperty.split(",")); return contextPaths.stream() .map(this::normalizeContextPath).collect(Collectors.toList()); }
public File getClusterNodeFirewallFile() { final String firewallFile = getProperty(CLUSTER_FIREWALL_FILE); if (StringUtils.isBlank(firewallFile)) { return null; } else { return new File(firewallFile); } }
/** * Returns the whitelisted proxy hostnames (and IP addresses) as a List. The hosts have been normalized to the form {@code somehost.com}, {@code somehost.com:port}, or {@code 127.0.0.1}. * * @return the hostname(s) */ public List<String> getWhitelistedHostsAsList() { String rawProperty = getProperty(WEB_PROXY_HOST, ""); List<String> hosts = Arrays.asList(rawProperty.split(",")); return hosts.stream() .map(this::normalizeHost).filter(host -> !StringUtils.isBlank(host)).collect(Collectors.toList()); }
public AbstractHeartbeatMonitor(final ClusterCoordinator clusterCoordinator, final NiFiProperties nifiProperties) { this.clusterCoordinator = clusterCoordinator; final String heartbeatInterval = nifiProperties.getProperty(NiFiProperties.CLUSTER_PROTOCOL_HEARTBEAT_INTERVAL, NiFiProperties.DEFAULT_CLUSTER_PROTOCOL_HEARTBEAT_INTERVAL); this.heartbeatIntervalMillis = (int) FormatUtils.getTimeDuration(heartbeatInterval, TimeUnit.MILLISECONDS); }
/** * The host name that will be given out to clients to connect to the Remote * Input Port. * * @return the remote input host name or null if not configured */ public String getRemoteInputHost() { final String value = getProperty(REMOTE_INPUT_HOST); return StringUtils.isBlank(value) ? null : value; }
private ProvenanceRepository createProvenanceRepository(final NiFiProperties properties) throws InstantiationException, IllegalAccessException, ClassNotFoundException { final String implementationClassName = properties.getProperty(NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS, DEFAULT_PROVENANCE_REPO_IMPLEMENTATION); if (implementationClassName == null) { throw new RuntimeException("Cannot create Provenance Repository because the NiFi Properties is missing the following property: " + NiFiProperties.PROVENANCE_REPO_IMPLEMENTATION_CLASS); } try { return NarThreadContextClassLoader.createInstance(extensionManager, implementationClassName, ProvenanceRepository.class, properties); } catch (final Exception e) { throw new RuntimeException(e); } }
/** * @return the user login identity provider file */ public File getLoginIdentityProviderConfigurationFile() { final String value = getProperty(LOGIN_IDENTITY_PROVIDER_CONFIGURATION_FILE); if (StringUtils.isBlank(value)) { return new File(DEFAULT_LOGIN_IDENTITY_PROVIDER_CONFIGURATION_FILE); } else { return new File(value); } }
private ComponentStatusRepository createComponentStatusRepository() { final String implementationClassName = nifiProperties.getProperty(NiFiProperties.COMPONENT_STATUS_REPOSITORY_IMPLEMENTATION, DEFAULT_COMPONENT_STATUS_REPO_IMPLEMENTATION); if (implementationClassName == null) { throw new RuntimeException("Cannot create Component Status Repository because the NiFi Properties is missing the following property: " + NiFiProperties.COMPONENT_STATUS_REPOSITORY_IMPLEMENTATION); } try { return NarThreadContextClassLoader.createInstance(extensionManager, implementationClassName, ComponentStatusRepository.class, nifiProperties); } catch (final Exception e) { throw new RuntimeException(e); } }