static String getIdentifier(final String seed) { if (StringUtils.isBlank(seed)) { return null; } return UUID.nameUUIDFromBytes(seed.getBytes(StandardCharsets.UTF_8)).toString(); }
/** * @return the user authorizers file */ public File getAuthorizerConfigurationFile() { final String value = getProperty(AUTHORIZER_CONFIGURATION_FILE); if (StringUtils.isBlank(value)) { return new File(DEFAULT_AUTHORIZER_CONFIGURATION_FILE); } else { return new File(value); } }
/** * @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); } }
public File getClusterNodeFirewallFile() { final String firewallFile = getProperty(CLUSTER_FIREWALL_FILE); if (StringUtils.isBlank(firewallFile)) { return null; } else { return new File(firewallFile); } }
/** * Returns true if the Kerberos service principal and keytab location * properties are populated. * * @return true if Kerberos service support is enabled */ public boolean isKerberosSpnegoSupportEnabled() { return !StringUtils.isBlank(getKerberosSpnegoPrincipal()) && !StringUtils.isBlank(getKerberosSpnegoKeytabLocation()); }
/** * 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 String getKerberosServicePrincipal() { final String servicePrincipal = getProperty(KERBEROS_SERVICE_PRINCIPAL); if (!StringUtils.isBlank(servicePrincipal)) { return servicePrincipal.trim(); } else { return null; } }
public String getKerberosServiceKeytabLocation() { final String keytabLocation = getProperty(KERBEROS_SERVICE_KEYTAB_LOCATION); if (!StringUtils.isBlank(keytabLocation)) { return keytabLocation.trim(); } else { return null; } }
public String getKerberosSpnegoPrincipal() { final String spengoPrincipal = getProperty(KERBEROS_SPNEGO_PRINCIPAL); if (!StringUtils.isBlank(spengoPrincipal)) { return spengoPrincipal.trim(); } else { return null; } }
/** * Returns whether Knox SSO is enabled. * * @return whether Knox SSO is enabled */ public boolean isKnoxSsoEnabled() { return !StringUtils.isBlank(getKnoxUrl()); }
/** * @return the restore directory or null if not configured */ public File getRestoreDirectory() { final String value = getProperty(RESTORE_DIRECTORY); if (StringUtils.isBlank(value)) { return null; } else { return new File(value); } }
public String getKerberosSpnegoKeytabLocation() { final String keytabLocation = getProperty(KERBEROS_SPNEGO_KEYTAB_LOCATION); if (!StringUtils.isBlank(keytabLocation)) { return keytabLocation.trim(); } else { return null; } }
public String getKerberosAuthenticationExpiration() { final String authenticationExpirationString = getProperty(KERBEROS_AUTHENTICATION_EXPIRATION, DEFAULT_KERBEROS_AUTHENTICATION_EXPIRATION); if (!StringUtils.isBlank(authenticationExpirationString)) { return authenticationExpirationString.trim(); } else { return null; } }
/** * Returns true if the login identity provider has been configured. * * @return true if the login identity provider has been configured */ public boolean isLoginIdentityProviderEnabled() { return !StringUtils.isBlank(getProperty(NiFiProperties.SECURITY_USER_LOGIN_IDENTITY_PROVIDER)); }
/** * 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; }
/** * Returns whether an OpenId Connect (OIDC) URL is set. * * @return whether an OpenId Connection URL is set */ public boolean isOidcEnabled() { return !StringUtils.isBlank(getOidcDiscoveryUrl()); }
static String handleLegacyPackages(String implementationClassName) throws KeyManagementException { if (org.apache.nifi.util.StringUtils.isBlank(implementationClassName)) { throw new KeyManagementException("Invalid key provider implementation provided: " + implementationClassName); } if (implementationClassName.equalsIgnoreCase(LEGACY_SKP_FQCN)) { return StaticKeyProvider.class.getName(); } else if (implementationClassName.equalsIgnoreCase(LEGACY_FBKP_FQCN)) { return FileBasedKeyProvider.class.getName(); } else { return implementationClassName; } }
@Override public void process(final InputStream in) throws IOException { try (ByteArrayOutputStream holder = new ByteArrayOutputStream()) { StreamUtils.copy(in,holder); String hashValue = generateHash(algorithm, holder.toString()); if (StringUtils.isBlank(hashValue) == false) { hashValueHolder.set(hashValue); } } } });
public InetSocketAddress getClusterNodeProtocolAddress() { try { String socketAddress = getProperty(CLUSTER_NODE_ADDRESS); if (StringUtils.isBlank(socketAddress)) { socketAddress = "localhost"; } int socketPort = getClusterNodeProtocolPort(); return InetSocketAddress.createUnresolved(socketAddress, socketPort); } catch (Exception ex) { throw new RuntimeException("Invalid node protocol address/port due to: " + ex, ex); } }
@Override protected BigQueryOptions getServiceOptions(ProcessContext context, GoogleCredentials credentials) { final String projectId = context.getProperty(PROJECT_ID).evaluateAttributeExpressions().getValue(); final Integer retryCount = Integer.valueOf(context.getProperty(RETRY_COUNT).getValue()); final BigQueryOptions.Builder builder = BigQueryOptions.newBuilder(); if (!StringUtils.isBlank(projectId)) { builder.setProjectId(projectId); } return builder.setCredentials(credentials) .setRetrySettings(RetrySettings.newBuilder().setMaxAttempts(retryCount).build()) .setTransportOptions(getTransportOptions(context)) .build(); }