Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 1 | package org.onlab.onos.store.service; |
| 2 | |
| 3 | import java.util.List; |
| 4 | |
| 5 | /** |
| 6 | * Service for running administrative tasks on a Database. |
| 7 | */ |
| 8 | public interface DatabaseAdminService { |
| 9 | |
| 10 | /** |
| 11 | * Creates a new table. |
| 12 | * Table creation is idempotent. Attempting to create a table |
| 13 | * that already exists will be a noop. |
| 14 | * @param name table name. |
| 15 | * @return true if the table was created by this call, false otherwise. |
| 16 | */ |
| 17 | public boolean createTable(String name); |
| 18 | |
| 19 | /** |
| 20 | * Lists all the tables in the database. |
| 21 | * @return list of table names. |
| 22 | */ |
| 23 | public List<String> listTables(); |
| 24 | |
| 25 | /** |
| 26 | * Deletes a table from the database. |
| 27 | * @param name name of the table to delete. |
| 28 | */ |
| 29 | public void dropTable(String name); |
| 30 | |
| 31 | /** |
| 32 | * Deletes all tables from the database. |
| 33 | */ |
| 34 | public void dropAllTables(); |
| 35 | } |