Class PropertiesSecretManager

java.lang.Object
org.deltava.util.system.PropertiesSecretManager
All Implemented Interfaces:
SecretManager

public class PropertiesSecretManager extends Object implements SecretManager
A secrets manager that uses properties files.
Since:
10.5
Version:
10.5
Author:
Luke
  • Constructor Details

    • PropertiesSecretManager

      public PropertiesSecretManager(String srcFile)
      Creates the Secret Manager.
      Parameters:
      srcFile - the source property file name
  • Method Details

    • getKeys

      public Collection<String> getKeys()
      Description copied from interface: SecretManager
      Returns the names of all the secrets.
      Specified by:
      getKeys in interface SecretManager
      Returns:
      a Collection of secret names
    • get

      public String get(String name)
      Description copied from interface: SecretManager
      Retrieves a secret.
      Specified by:
      get in interface SecretManager
      Parameters:
      name - the secret name
      Returns:
      the secret value, or null if not found
    • size

      public int size()
      Description copied from interface: SecretManager
      Returns the number of loaded secrets.
      Specified by:
      size in interface SecretManager
      Returns:
      the number of secrets
    • load

      public void load() throws IOException
      Description copied from interface: SecretManager
      Optional initialization method
      Specified by:
      load in interface SecretManager
      Throws:
      IOException - if an erorr occurs