Class CredentialFactory

java.lang.Object
org.frankframework.credentialprovider.CredentialFactory

public class CredentialFactory extends Object
  • Field Details

  • Constructor Details

    • CredentialFactory

      protected CredentialFactory(boolean allowFallbackProvider)
  • Method Details

    • getInstance

      public static CredentialFactory getInstance()
    • reset

      public static void reset()
      Reset factory to its default state.
    • getProperties

      public static Properties getProperties()
      Get the configuration properties of the CredentialFactory. This is a convenience method; you should never modify the properties obtained via this method.
    • setProperty

      public static @Nullable String setProperty(String key, String value)
      Update the value of a property. This method is for test-usage. Changing the value of any property will clear the loaded CredentialProviders, so that the changes will be reflected in any CredentialProviders accessed since.
      Parameters:
      key - Name of property to update
      value - New value of the property, may not be null.
      Returns:
      Previous value of the property if set, otherwise null.
    • getProperty

      public static @Nullable String getProperty(String key)
      Get a property of the CredentialFactory, or null if not set
    • getProperty

      @Contract("_, !null -> !null") public static @Nullable String getProperty(String key, @Nullable String defaultValue)
      Get a property of the CredentialFactory, or defaultValue if not set
    • createInstance

      public static void createInstance(ISecretProvider... providers) throws Exception
      Create an instance using the given ISecretProviders, ignoring the providers specified in the configuration.
      Throws:
      Exception
    • exit

      protected void exit()
    • hasCredential

      public static boolean hasCredential(String rawAlias)
    • getCredentials

      public static @Nullable ICredentials getCredentials(@Nullable String rawAlias)
      Entrypoint. Attempts to find the credential for the specified alias. If none is found, returns NULL, else the credential.
    • getCredentials

      public static ICredentials getCredentials(@Nullable String rawAlias, @Nullable String defaultUsername, @Nullable String defaultPassword) throws NoSuchElementException
      Entrypoint. Attempts to find the credential for the specified alias. When none is found, uses the default (provided) fallback user/pass combination.
      Throws:
      NoSuchElementException
    • getConfiguredAliases

      public static Collection<String> getConfiguredAliases()