Seyeon Jeong | ac12956 | 2020-02-28 01:17:34 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2020-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.t3.api; |
| 18 | |
| 19 | /** |
| 20 | * Base abstraction of Network Information Base (NIB). |
| 21 | */ |
| 22 | public abstract class AbstractNib { |
| 23 | |
| 24 | protected NibProfile nibProfile; |
| 25 | |
| 26 | /** |
| 27 | * Sets a profile describing this NIB. |
| 28 | * |
| 29 | * @param nibProfile NIB profile |
| 30 | */ |
| 31 | public void setProfile(NibProfile nibProfile) { |
| 32 | this.nibProfile = nibProfile; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Returns the current profile of this NIB. |
| 37 | * |
| 38 | * @return NIB profile |
| 39 | */ |
| 40 | public NibProfile getProfile() { |
| 41 | return nibProfile; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Checks this NIB is valid. |
| 46 | * |
| 47 | * @return true (valid) only if this NIB is already filled with any source. false means invalid |
| 48 | */ |
| 49 | public boolean isValid() { |
| 50 | if (nibProfile != null) { |
| 51 | return nibProfile.isValid(); |
| 52 | } else { |
| 53 | return false; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | } |