Update DAO API
[lispflowmapping.git] / mappingservice / api / src / main / java / org / opendaylight / lispflowmapping / interfaces / dao / ILispDAO.java
1 /*
2  * Copyright (c) 2014 Contextream, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.lispflowmapping.interfaces.dao;
10
11 import java.util.Map;
12
13 public interface ILispDAO {
14
15     /**
16      * Put a entry into the DAO.
17      *
18      * @param key
19      *            The entry's key.
20      * @param values
21      *            The entry's value.
22      */
23     public void put(Object key, MappingEntry<?>... values);
24
25     /**
26      * Get a specific value from the DAO.
27      *
28      * @param key
29      *            The key of the value to fetch
30      * @param valueKey
31      *            The value to fetch
32      * @return The value from the DAO.
33      */
34     public Object getSpecific(Object key, String valueKey);
35
36     /**
37      * Get the entries from the DAO
38      *
39      * @param key
40      *            The key.
41      * @return The value from the DAO.
42      */
43     public Map<String, Object> get(Object key);
44
45     /**
46      * Enumerate all the entries from the DAO
47      *
48      * @param visitor
49      *            The visitor object.
50      */
51     public void getAll(IRowVisitor visitor);
52
53     /**
54      * Remove an entry from the DAO
55      *
56      * @param key
57      *            The key of the entry to delete
58      */
59     public void remove(Object key);
60
61     /**
62      * Remove an entry from the DAO
63      *
64      * @param key
65      *            The key of the entry
66      * @param valueKey
67      *            The value to delete
68      */
69     public void removeSpecific(Object key, String valueKey);
70
71     /**
72      * Clear the DAO and remove all of the entries.
73      */
74     public void removeAll();
75
76     /**
77      * Inserts a new, nested table for given key and subkey. Also acts as factory method.
78      *
79      * @param key
80      *              The key for which a new table is linked in
81      * @param valueKey
82      *              The subkey under which to insert the new table
83      * @return The inserted table
84      */
85     public ILispDAO putNestedTable(Object key, String valueKey);
86 }