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;
11 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);
70 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
71 * @return The parent prefix of the longest prefix match for the key.
73 Eid getParentPrefix(Eid key);
79 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
80 * @return The sibling prefix of the longest prefix match for the key.
82 Eid getSiblingPrefix(Eid key);
85 * Get widest negative prefix.
88 * The eid prefix, IPv4 or IPv6, to be looked up. Key must be normalized.
89 * @return The widest negative prefix found.
91 Eid getWidestNegativePrefix(Eid key);
94 * Enumerate all the entries from the DAO.
99 void getAll(IRowVisitor visitor);
102 * Remove an entry from the DAO.
105 * The key of the entry to delete
107 void remove(Object key);
110 * Remove an entry from the DAO.
113 * The key of the entry
115 * The value to delete
117 void removeSpecific(Object key, String valueKey);
120 * Clear the DAO and remove all of the entries.
125 * Insert a new table for given key.
128 * The key for the table
129 * @return The inserted table
131 ILispDAO putTable(String key);
134 * Inserts a new, nested table for given key and subkey. Also acts as factory method.
137 * The key for which a new table is linked in
139 * The subkey under which to insert the new table
140 * @return The inserted table
142 ILispDAO putNestedTable(Object key, String valueKey);