2 * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved.
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
9 package org.opendaylight.lispflowmapping.interfaces.dao;
12 import java.util.AbstractMap.SimpleImmutableEntry;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.lfm.lisp.proto.rev151105.eid.container.Eid;
16 public interface ILispDAO {
19 * Put a entry into the DAO.
26 void put(Object key, MappingEntry<?>... values);
29 * Get a specific value from the DAO.
32 * The key of the value to fetch
35 * @return The value from the DAO.
37 Object getSpecific(Object key, String valueKey);
40 * Get the entries from the DAO
43 * The key to be looked up as exact match.
44 * @return The value from the DAO.
46 Map<String, Object> get(Object key);
49 * Get value for longest prefix match from the DAO
52 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
53 * @return The value from the DAO.
55 Map<String, Object> getBest(Object key);
58 * Get longest prefix match and value from the DAO
61 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized
62 * @return The best match and value pair from the DAO.
64 SimpleImmutableEntry<Eid, Map<String, ?>> getBestPair(Object key);
67 * Get widest negative prefix
70 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
71 * @return The widest negative prefix found.
73 Eid getWidestNegativePrefix(Eid key);
76 * Enumerate all the entries from the DAO
81 void getAll(IRowVisitor visitor);
84 * Remove an entry from the DAO
87 * The key of the entry to delete
89 void remove(Object key);
92 * Remove an entry from the DAO
95 * The key of the entry
99 void removeSpecific(Object key, String valueKey);
102 * Clear the DAO and remove all of the entries.
107 * Insert a new table for given key.
110 * The key for the table
111 * @return The inserted table
113 ILispDAO putTable(String key);
116 * Inserts a new, nested table for given key and subkey. Also acts as factory method.
119 * The key for which a new table is linked in
121 * The subkey under which to insert the new table
122 * @return The inserted table
124 ILispDAO putNestedTable(Object key, String valueKey);