blob: 5f9fdc75200b6efba1510c4d110b0fde61423afe [file] [log] [blame]
sunish vk30637eb2016-02-16 15:19:32 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
sunish vk30637eb2016-02-16 15:19:32 +05303 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.ospf.controller;
17
18import java.util.Map;
19
20/**
21 * Representation of a bin where an LSA is stored for aging.
22 * A bin is identified by a bin number and can have one or more LSAs
23 * stored in a particular bin location.
24 */
25public interface LsaBin {
26
27 /**
28 * Adds the given LSA to this bin with the given key.
29 *
30 * @param lsaKey key of the stored LSA
31 * @param lsaWrapper wrapper instance to store
32 */
33 public void addOspfLsa(String lsaKey, LsaWrapper lsaWrapper);
34
35 /**
36 * Retrieves the LSA from the bin for verification of max age and ls refresh.
37 *
38 * @param lsaKey key to search the LSA
39 * @return LSA Wrapper instance
40 */
41 public LsaWrapper ospfLsa(String lsaKey);
42
43 /**
44 * Removes the given LSA from the bin. when ever it reaches max age or ls refresh time.
45 *
46 * @param lsaKey key to search LSA
47 * @param lsaWrapper wrapper instance of the particular LSA
48 */
49 public void removeOspfLsa(String lsaKey, LsaWrapper lsaWrapper);
50
51 /**
52 * Gets the list of LSAs in this bin as key value pair.
53 * with key being the LSA key formed from the LSA header.
54 *
55 * @return list of LSAs in this bin as key value pair
56 */
57 public Map<String, LsaWrapper> listOfLsa();
58
59 /**
60 * Gets the bin number assigned during the initialization process of the bins .
61 *
62 * @return the bin number
63 */
64 public int binNumber();
65}