Jian Li | 0b93b00 | 2018-07-31 13:41:08 +0900 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018-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.openstacktroubleshoot.api; |
| 17 | |
| 18 | import org.onlab.packet.IpAddress; |
| 19 | |
| 20 | /** |
| 21 | * Reachbility interface which stores VM to VM connectivity. |
| 22 | */ |
| 23 | public interface Reachability { |
| 24 | |
| 25 | /** |
| 26 | * Source IP address. |
| 27 | * |
| 28 | * @return source IP address |
| 29 | */ |
| 30 | IpAddress srcIp(); |
| 31 | |
| 32 | /** |
| 33 | * Destination IP address. |
| 34 | * |
| 35 | * @return destination IP address |
| 36 | */ |
| 37 | IpAddress dstIp(); |
| 38 | |
| 39 | /** |
| 40 | * Indicates whether the given source and destination VMs are reachable. |
| 41 | * |
| 42 | * @return reachability indicator |
| 43 | */ |
| 44 | boolean isReachable(); |
| 45 | |
| 46 | /** |
| 47 | * Builder of new reachability object. |
| 48 | */ |
| 49 | interface Builder { |
| 50 | |
| 51 | /** |
| 52 | * Returns reachability builder with supplied IP address. |
| 53 | * |
| 54 | * @param srcIp source IP address |
| 55 | * @return reachability builder |
| 56 | */ |
| 57 | Builder srcIp(IpAddress srcIp); |
| 58 | |
| 59 | /** |
| 60 | * Returns reachability builder with supplied IP address. |
| 61 | * |
| 62 | * @param dstIp destination IP address |
| 63 | * @return reachability builder |
| 64 | */ |
| 65 | Builder dstIp(IpAddress dstIp); |
| 66 | |
| 67 | /** |
| 68 | * Returns reachability builder with supplied reachability flag. |
| 69 | * |
| 70 | * @param isReachable reachability flag |
| 71 | * @return reachability builder |
| 72 | */ |
| 73 | Builder isReachable(boolean isReachable); |
| 74 | |
| 75 | /** |
| 76 | * Builds an immutable reachability instance. |
| 77 | * |
| 78 | * @return reachability instance |
| 79 | */ |
| 80 | Reachability build(); |
| 81 | } |
| 82 | } |