Jian Li | e1fe06a | 2021-01-08 03:18:35 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-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 | package org.onosproject.kubevirtnetworking.api; |
| 17 | |
| 18 | import org.onlab.packet.MacAddress; |
| 19 | import org.onosproject.store.Store; |
| 20 | |
| 21 | import java.util.Set; |
| 22 | |
| 23 | /** |
| 24 | * Manages inventory of kubevirt port; not intended for direct use. |
| 25 | */ |
| 26 | public interface KubevirtPortStore |
| 27 | extends Store<KubevirtPortEvent, KubevirtPortStoreDelegate> { |
| 28 | |
| 29 | /** |
| 30 | * Creates a new kubevirt port. |
| 31 | * |
| 32 | * @param port kubevirt port |
| 33 | */ |
| 34 | void createPort(KubevirtPort port); |
| 35 | |
| 36 | /** |
| 37 | * Updates the kubevirt port. |
| 38 | * |
| 39 | * @param port kubevirt port |
| 40 | */ |
| 41 | void updatedPort(KubevirtPort port); |
| 42 | |
| 43 | /** |
| 44 | * Removes the kubevirt port with the given MAC address. |
| 45 | * |
| 46 | * @param mac port MAC address |
| 47 | * @return removed kubevirt port; null if failed |
| 48 | */ |
| 49 | KubevirtPort removePort(MacAddress mac); |
| 50 | |
| 51 | /** |
| 52 | * Returns the kubevirt port with the given port MAC. |
| 53 | * |
| 54 | * @param mac port MAC address |
| 55 | * @return kubevirt port; null if not found |
| 56 | */ |
| 57 | KubevirtPort port(MacAddress mac); |
| 58 | |
| 59 | /** |
| 60 | * Returns all kubevirt ports. |
| 61 | * |
| 62 | * @return set of kubevirt ports |
| 63 | */ |
| 64 | Set<KubevirtPort> ports(); |
| 65 | |
| 66 | /** |
| 67 | * Removes all kubevirt ports. |
| 68 | */ |
| 69 | void clear(); |
| 70 | } |