sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
sunish vk | 30637eb | 2016-02-16 15:19:32 +0530 | [diff] [blame] | 3 | * |
| 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 | */ |
| 16 | package org.onosproject.ospf.controller; |
| 17 | |
| 18 | /** |
| 19 | * Representation of a wrapper object to store LSA and associated metadata. |
| 20 | * Metadata consists about the origination of LSA, age of LSA when received etc. |
| 21 | */ |
| 22 | public interface LsaWrapper { |
| 23 | /** |
| 24 | * Gets the type of LSA, it can be a router,network,summary,external. |
| 25 | * |
| 26 | * @return lsa type |
| 27 | */ |
| 28 | public OspfLsaType lsaType(); |
| 29 | |
| 30 | /** |
| 31 | * Sets the LSA type during the initialization of wrapper. |
| 32 | * |
| 33 | * @param lsaType lsa type |
| 34 | */ |
| 35 | public void setLsaType(OspfLsaType lsaType); |
| 36 | |
| 37 | /** |
| 38 | * Determines the origination of LSA , this is called during ls refresh interval. |
| 39 | * |
| 40 | * @return true if self originated else false |
| 41 | */ |
| 42 | public boolean isSelfOriginated(); |
| 43 | |
| 44 | /** |
| 45 | * Sets is self originated or not. |
| 46 | * |
| 47 | * @param isSelfOriginated true if self originated else false |
| 48 | */ |
| 49 | public void setIsSelfOriginated(boolean isSelfOriginated); |
| 50 | |
| 51 | |
| 52 | /** |
| 53 | * Age of LSA when received during the adjacency formation. |
| 54 | * |
| 55 | * @return Age of LSA when received |
| 56 | */ |
| 57 | public int lsaAgeReceived(); |
| 58 | |
| 59 | /** |
| 60 | * Sets the Age of LSA when received during the adjacency formation. |
| 61 | * |
| 62 | * @param lsaAgeReceived Age of LSA when received |
| 63 | */ |
| 64 | public void setLsaAgeReceived(int lsaAgeReceived); |
| 65 | |
| 66 | /** |
| 67 | * Gets the LSA present in the wrapper instance. |
| 68 | * |
| 69 | * @return LSA instance |
| 70 | */ |
| 71 | public OspfLsa ospfLsa(); |
| 72 | |
| 73 | /** |
| 74 | * Sets the LSA instance to the wrapper. |
| 75 | * |
| 76 | * @param ospfLsa LSA instance |
| 77 | */ |
| 78 | public void setOspfLsa(OspfLsa ospfLsa); |
| 79 | |
| 80 | /** |
| 81 | * Gets the current LSA Age, using this we calculate current age. |
| 82 | * It is done against the age counter which is incremented every second. |
| 83 | * |
| 84 | * @return lsa age |
| 85 | */ |
| 86 | public int currentAge(); |
| 87 | |
| 88 | /** |
| 89 | * Gets the age counter when received. |
| 90 | * |
| 91 | * @return the age counter when received |
| 92 | */ |
| 93 | public int ageCounterWhenReceived(); |
| 94 | |
| 95 | /** |
| 96 | * Sets the age counter when received. |
| 97 | * |
| 98 | * @param ageCounterWhenReceived the age counter when received |
| 99 | */ |
| 100 | public void setAgeCounterWhenReceived(int ageCounterWhenReceived); |
| 101 | |
| 102 | /** |
| 103 | * Gets the LSA process command, like max age, ls refresh, based on the command set. |
| 104 | * The queue consumer will pick the LSA and start performing the actions, like flooding |
| 105 | * out of the domain or generating a new LSA and flooding. |
| 106 | * |
| 107 | * @return lsa process command |
| 108 | */ |
| 109 | public String lsaProcessing(); |
| 110 | |
| 111 | /** |
| 112 | * Sets the LSA process command, like max age , ls refresh , based on the command set. |
| 113 | * The queue consumer will pick the LSA and start performing the actions, like flooding |
| 114 | * out of the domain or generating a new LSA and flooding. |
| 115 | * |
| 116 | * @param lsaProcessing lsa process command |
| 117 | */ |
| 118 | public void setLsaProcessing(String lsaProcessing); |
| 119 | |
| 120 | /** |
| 121 | * Gets bin number into which the LSA wrapper is put for aging process. |
| 122 | * |
| 123 | * @return bin number |
| 124 | */ |
| 125 | public int binNumber(); |
| 126 | |
| 127 | /** |
| 128 | * Sets bin number into which the LSA wrapper is put for aging process. |
| 129 | * |
| 130 | * @param binNumber bin number |
| 131 | */ |
| 132 | public void setBinNumber(int binNumber); |
| 133 | |
| 134 | /** |
| 135 | * Gets the interface on which the LSA was received. |
| 136 | * |
| 137 | * @return the interface instance |
| 138 | */ |
| 139 | public OspfInterface ospfInterface(); |
| 140 | |
| 141 | /** |
| 142 | * Sets the interface on which the LSA was received, this is used later to flood the information. |
| 143 | * |
| 144 | * @param ospfInterface interface instance |
| 145 | */ |
| 146 | public void setOspfInterface(OspfInterface ospfInterface); |
| 147 | |
| 148 | /** |
| 149 | * Sets the LSDB age. |
| 150 | * Using LSDB age we are calculating age of a particular LSA. |
| 151 | * |
| 152 | * @param lsdbAge lsdbAge instance |
| 153 | */ |
| 154 | public void setLsdbAge(LsdbAge lsdbAge); |
| 155 | } |