Package com.github.joschi.jadconfig
Interface Repository
- All Known Implementing Classes:
EnvironmentRepository,InMemoryRepository,PropertiesRepository,SystemPropertiesRepository
public interface Repository
Interface for configuration repositories
A configuration repository can be any data source containing configuration data, e. g. a simple in-memory store, a file, or a database.
- Author:
- jschalanda
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the underlying data source when it isn't require any more.voidopen()Opens the configuration repository, e. g. create a database connection, open a file on disk for readingReads the configuration parameter name from the backing data source.
-
Method Details
-
open
Opens the configuration repository, e. g. create a database connection, open a file on disk for reading- Throws:
RepositoryException- If an error occurred while opening the data source
-
read
Reads the configuration parameter name from the backing data source. The name is specific to the underlying data source.- Parameters:
name- The parameter name- Returns:
- The value of the provided name as
String
-
close
Closes the underlying data source when it isn't require any more.- Throws:
RepositoryException- If an error occurred while closing the underlying data source
-