f6736aa1caae0c282b3c2ebde311fd263b9b345f
[utils] / test / enterprise / src / main / java / org / wamblee / support / persistence / DatabaseProvider.java
1 package org.wamblee.support.persistence;
2
3 /**
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.
7  * 
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.
11  */
12 public interface DatabaseProvider {
13
14         /**
15          * Capability that all databases that run inmemory have.
16          */
17         String CAPABILITY_IN_MEMORY = "INMEMORY";
18
19         /**
20          * Capability that all databases that are external have.
21          */
22         String CAPABILITY_EXTERNAL = "EXTERNAL";
23
24         /**
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. 
28          */
29         boolean supportsCapabilities(String[] aCapabilities);
30
31         /**
32          * Gets the description for the database. 
33          * @return Description.
34          */
35         DatabaseDescription getDescription();
36
37         /**
38          * Creates a database instance that represents a running instance of that database. 
39          * @return Database. 
40          */
41         Database create();
42 }