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 java.util.Set; |
| 19 | |
| 20 | /** |
| 21 | * Interface of kubevirt instance. |
| 22 | */ |
| 23 | public interface KubevirtInstance { |
| 24 | |
| 25 | /** |
| 26 | * Returns the kubevirt instance UID. |
| 27 | * |
| 28 | * @return kubevirt instance UID |
| 29 | */ |
| 30 | String uid(); |
| 31 | |
| 32 | /** |
| 33 | * Returns the kubevirt instance name. |
| 34 | * |
| 35 | * @return kubevirt instance name |
| 36 | */ |
| 37 | String name(); |
| 38 | |
| 39 | /** |
| 40 | * Returns the kubevirt ports associated with the instance. |
| 41 | * |
| 42 | * @return kubevirt ports |
| 43 | */ |
| 44 | Set<KubevirtPort> ports(); |
| 45 | |
| 46 | interface Builder { |
| 47 | |
| 48 | /** |
| 49 | * Builds on immutable instance. |
| 50 | * |
| 51 | * @return kubevirt instance |
| 52 | */ |
| 53 | KubevirtInstance build(); |
| 54 | |
| 55 | /** |
| 56 | * Returns instance builder with supplied UID. |
| 57 | * |
| 58 | * @param uid UID of instance |
| 59 | * @return instance builder |
| 60 | */ |
| 61 | Builder uid(String uid); |
| 62 | |
| 63 | /** |
| 64 | * Returns instance builder with supplied name. |
| 65 | * |
| 66 | * @param name name of instance |
| 67 | * @return instance builder |
| 68 | */ |
| 69 | Builder name(String name); |
| 70 | |
| 71 | /** |
| 72 | * Returns instance builder with supplied ports. |
| 73 | * |
| 74 | * @param ports set of ports |
| 75 | * @return instance builder |
| 76 | */ |
| 77 | Builder ports(Set<KubevirtPort> ports); |
| 78 | } |
| 79 | } |