1 package org.wamblee.support.persistence;
4 * Database provider. This database provider represents a particular type of
5 * database such as its capabilities and the ability to create an instance
6 * representing a running database.
8 * Since the {@link DatabaseBuilder} uses a first match algorithm and the order
9 * of databaseproviders is not guaranteed, it is recommended for each database
10 * provider to also provide a unique capability that no other database has.
12 public interface DatabaseProvider {
15 * Capability that all databases that run inmemory have.
17 String CAPABILITY_IN_MEMORY = "INMEMORY";
20 * Capability that all databases that are external have.
22 String CAPABILITY_EXTERNAL = "EXTERNAL";
25 * Determines if the database has all capabilities that are requested.
26 * @param aCapabilities Capabilities it must ahve
27 * @return True if it has all capabilities.
29 boolean supportsCapabilities(String[] aCapabilities);
32 * Gets the description for the database.
33 * @return Description.
35 DatabaseDescription getDescription();
38 * Creates a database instance that represents a running instance of that database.