Jian Li | b964283 | 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.onosproject.store.Store; |
| 19 | |
| 20 | import java.util.Set; |
| 21 | |
| 22 | /** |
| 23 | * Manages inventory of kubevirt instance; not intended for direct use. |
| 24 | */ |
| 25 | public interface KubevirtInstanceStore |
| 26 | extends Store<KubevirtInstanceEvent, KubevirtInstanceStoreDelegate> { |
| 27 | |
| 28 | /** |
| 29 | * Creates a new kubevirt instance. |
| 30 | * |
| 31 | * @param instance kubevirt instance |
| 32 | */ |
| 33 | void createInstance(KubevirtInstance instance); |
| 34 | |
| 35 | /** |
| 36 | * Updates the kubevirt instance. |
| 37 | * |
| 38 | * @param instance kubevirt instance |
| 39 | */ |
| 40 | void updateInstance(KubevirtInstance instance); |
| 41 | |
| 42 | /** |
| 43 | * Removes the kubevirt instance with the given instance UID. |
| 44 | * |
| 45 | * @param uid kubevirt instance UID |
| 46 | * @return remove kubevirt instance; null if failed |
| 47 | */ |
| 48 | KubevirtInstance removeInstance(String uid); |
| 49 | |
| 50 | /** |
| 51 | * Returns the kubevirt instance with the given instance UID. |
| 52 | * |
| 53 | * @param uid kubevirt instance UID |
| 54 | * @return kubevirt instance; null if not found |
| 55 | */ |
| 56 | KubevirtInstance instance(String uid); |
| 57 | |
| 58 | /** |
| 59 | * Returns all kubevirt instances. |
| 60 | * |
| 61 | * @return set of kubevirt instance |
| 62 | */ |
| 63 | Set<KubevirtInstance> instances(); |
| 64 | |
| 65 | /** |
| 66 | * Removes all kubevirt instances. |
| 67 | */ |
| 68 | void clear(); |
| 69 | } |