View Javadoc

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      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      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      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      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      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      void removeSpecific(Object key, String valueKey);
70  
71      /**
72       * Clear the DAO and remove all of the entries.
73       */
74      void removeAll();
75  
76      /**
77       * Insert a new table for given key.
78       *
79       * @param key
80       *            The key for the table
81       * @return The inserted table
82       */
83      ILispDAO putTable(String key);
84  
85      /**
86       * Inserts a new, nested table for given key and subkey. Also acts as factory method.
87       *
88       * @param key
89       *              The key for which a new table is linked in
90       * @param valueKey
91       *              The subkey under which to insert the new table
92       * @return The inserted table
93       */
94      ILispDAO putNestedTable(Object key, String valueKey);
95  }