Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 1 | package org.onlab.onos.store.service; |
| 2 | |
Yuta HIGUCHI | 60731cb | 2014-11-11 01:34:46 -0800 | [diff] [blame] | 3 | import java.util.Collection; |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 4 | import java.util.List; |
| 5 | |
Yuta HIGUCHI | 60731cb | 2014-11-11 01:34:46 -0800 | [diff] [blame] | 6 | import org.onlab.onos.cluster.ControllerNode; |
| 7 | |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 8 | /** |
Madan Jampani | 37c2e70 | 2014-11-04 18:11:10 -0800 | [diff] [blame] | 9 | * Service interface for running administrative tasks on a Database. |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 10 | */ |
| 11 | public interface DatabaseAdminService { |
| 12 | |
| 13 | /** |
| 14 | * Creates a new table. |
| 15 | * Table creation is idempotent. Attempting to create a table |
| 16 | * that already exists will be a noop. |
| 17 | * @param name table name. |
| 18 | * @return true if the table was created by this call, false otherwise. |
| 19 | */ |
| 20 | public boolean createTable(String name); |
| 21 | |
| 22 | /** |
| 23 | * Lists all the tables in the database. |
| 24 | * @return list of table names. |
| 25 | */ |
| 26 | public List<String> listTables(); |
| 27 | |
| 28 | /** |
| 29 | * Deletes a table from the database. |
| 30 | * @param name name of the table to delete. |
| 31 | */ |
| 32 | public void dropTable(String name); |
| 33 | |
| 34 | /** |
| 35 | * Deletes all tables from the database. |
| 36 | */ |
| 37 | public void dropAllTables(); |
Yuta HIGUCHI | 60731cb | 2014-11-11 01:34:46 -0800 | [diff] [blame] | 38 | |
| 39 | |
| 40 | /** |
| 41 | * Add member to default Tablet. |
| 42 | * |
| 43 | * @param node to add |
| 44 | */ |
| 45 | public void addMember(ControllerNode node); |
| 46 | |
| 47 | /** |
| 48 | * Remove member from default Tablet. |
| 49 | * |
| 50 | * @param node node to remove |
| 51 | */ |
| 52 | public void removeMember(ControllerNode node); |
| 53 | |
| 54 | /** |
| 55 | * List members forming default Tablet. |
| 56 | * |
| 57 | * @return Copied collection of members forming default Tablet. |
| 58 | */ |
| 59 | public Collection<ControllerNode> listMembers(); |
Madan Jampani | 08822c4 | 2014-11-04 17:17:46 -0800 | [diff] [blame] | 60 | } |