blob: fa73546a8109e1da25df115508d39d3474319c62 [file] [log] [blame]
Madan Jampani08822c42014-11-04 17:17:46 -08001package org.onlab.onos.store.service;
2
Yuta HIGUCHI60731cb2014-11-11 01:34:46 -08003import java.util.Collection;
Madan Jampani08822c42014-11-04 17:17:46 -08004import java.util.List;
5
Yuta HIGUCHI60731cb2014-11-11 01:34:46 -08006import org.onlab.onos.cluster.ControllerNode;
7
Madan Jampani08822c42014-11-04 17:17:46 -08008/**
Madan Jampani37c2e702014-11-04 18:11:10 -08009 * Service interface for running administrative tasks on a Database.
Madan Jampani08822c42014-11-04 17:17:46 -080010 */
11public 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 /**
Madan Jampanidef2c652014-11-12 13:50:10 -080023 * Creates a new table where last update time will be used to track and expire old entries.
24 * Table creation is idempotent. Attempting to create a table
25 * that already exists will be a noop.
26 * @param name table name.
27 * @param ttlMillis total duration in millis since last update time when entries will be expired.
28 * @return true if the table was created by this call, false otherwise.
29 */
30 public boolean createTable(String name, int ttlMillis);
31
32 /**
Madan Jampani08822c42014-11-04 17:17:46 -080033 * Lists all the tables in the database.
34 * @return list of table names.
35 */
36 public List<String> listTables();
37
38 /**
39 * Deletes a table from the database.
40 * @param name name of the table to delete.
41 */
42 public void dropTable(String name);
43
44 /**
45 * Deletes all tables from the database.
46 */
47 public void dropAllTables();
Yuta HIGUCHI60731cb2014-11-11 01:34:46 -080048
49
50 /**
51 * Add member to default Tablet.
52 *
53 * @param node to add
54 */
55 public void addMember(ControllerNode node);
56
57 /**
58 * Remove member from default Tablet.
59 *
60 * @param node node to remove
61 */
62 public void removeMember(ControllerNode node);
63
64 /**
65 * List members forming default Tablet.
66 *
67 * @return Copied collection of members forming default Tablet.
68 */
69 public Collection<ControllerNode> listMembers();
Madan Jampani08822c42014-11-04 17:17:46 -080070}