Hyunsun Moon | 8947866 | 2016-06-09 17:52:34 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Hyunsun Moon | 8947866 | 2016-06-09 17:52:34 -0700 | [diff] [blame] | 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.net.behaviour; |
| 17 | |
| 18 | import org.onosproject.net.Annotated; |
| 19 | import org.onosproject.net.Description; |
| 20 | |
| 21 | import java.util.Optional; |
| 22 | |
| 23 | /** |
| 24 | * Describes a patch interface. |
| 25 | */ |
| 26 | public interface PatchDescription extends Description, Annotated { |
| 27 | |
| 28 | /** |
| 29 | * Returns the identifier of the device where this patch interface is. |
| 30 | * |
| 31 | * @return device identifier; empty value if not set |
| 32 | */ |
| 33 | Optional<String> deviceId(); |
| 34 | |
| 35 | /** |
| 36 | * Return the name of the patch interface. |
| 37 | * |
| 38 | * @return patch interface name |
| 39 | */ |
| 40 | String ifaceName(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the name of the interface for the other side of the patch. |
| 44 | * |
| 45 | * @return peer patch interface name |
| 46 | */ |
| 47 | String peer(); |
| 48 | |
| 49 | /** |
| 50 | * Builder of patch interface description entities. |
| 51 | */ |
| 52 | interface Builder { |
| 53 | |
| 54 | /** |
| 55 | * Returns new patch interface description. |
| 56 | * |
| 57 | * @return patch interface description |
| 58 | */ |
| 59 | PatchDescription build(); |
| 60 | |
| 61 | /** |
| 62 | * Returns new patch interface description. |
| 63 | * |
| 64 | * @param deviceId device id |
| 65 | * @return patch interface description builder |
| 66 | */ |
| 67 | Builder deviceId(String deviceId); |
| 68 | /** |
| 69 | * Returns patch interface description builder with a given interface name. |
| 70 | * |
| 71 | * @param ifaceName interface name |
| 72 | * @return patch interface description builder |
| 73 | */ |
| 74 | Builder ifaceName(String ifaceName); |
| 75 | |
| 76 | /** |
| 77 | * Returns patch interface description builder with a given peer. |
| 78 | * |
| 79 | * @param peerName peer patch interface name |
| 80 | * @return patch interface description builder |
| 81 | */ |
| 82 | Builder peer(String peerName); |
| 83 | } |
| 84 | |
| 85 | } |