Jian Li | 47e7af7 | 2021-03-05 01:32:04 +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.IpPrefix; |
| 19 | |
| 20 | /** |
| 21 | * Representation of security group rule. |
| 22 | */ |
| 23 | public interface KubevirtSecurityGroupRule { |
| 24 | |
| 25 | /** |
| 26 | * Returns the security group rule identifier. |
| 27 | * |
| 28 | * @return security group rule identifier |
| 29 | */ |
| 30 | String id(); |
| 31 | |
| 32 | /** |
| 33 | * Returns the security group identifier. |
| 34 | * |
| 35 | * @return security group identifier |
| 36 | */ |
| 37 | String securityGroupId(); |
| 38 | |
| 39 | /** |
| 40 | * Returns the traffic direction. |
| 41 | * |
| 42 | * @return traffic direction |
| 43 | */ |
| 44 | String direction(); |
| 45 | |
| 46 | /** |
| 47 | * Returns the ethernet type. |
| 48 | * |
| 49 | * @return ethernet type |
| 50 | */ |
| 51 | String etherType(); |
| 52 | |
| 53 | /** |
| 54 | * Returns the maximum port range. |
| 55 | * |
| 56 | * @return maximum port range |
| 57 | */ |
| 58 | Integer portRangeMax(); |
| 59 | |
| 60 | /** |
| 61 | * Returns the minimum port range. |
| 62 | * |
| 63 | * @return minimum port range |
| 64 | */ |
| 65 | Integer portRangeMin(); |
| 66 | |
| 67 | /** |
| 68 | * Returns the network protocol. |
| 69 | * |
| 70 | * @return network protocol |
| 71 | */ |
| 72 | String protocol(); |
| 73 | |
| 74 | /** |
| 75 | * Returns the remote IP prefix. |
| 76 | * |
| 77 | * @return remote IP prefix |
| 78 | */ |
| 79 | IpPrefix remoteIpPrefix(); |
| 80 | |
| 81 | /** |
| 82 | * Returns the remote group identifier. |
| 83 | * |
| 84 | * @return remote group identifier |
| 85 | */ |
| 86 | String remoteGroupId(); |
| 87 | |
| 88 | /** |
| 89 | * A default builder interface. |
| 90 | */ |
| 91 | interface Builder { |
| 92 | /** |
| 93 | * Builds an immutable security group rule instance. |
| 94 | * |
| 95 | * @return kubevirt security group rule |
| 96 | */ |
| 97 | KubevirtSecurityGroupRule build(); |
| 98 | |
| 99 | /** |
| 100 | * Returns kubevirt security group rule builder with supplied id. |
| 101 | * |
| 102 | * @param id security group rule id |
| 103 | * @return security group rule builder |
| 104 | */ |
| 105 | Builder id(String id); |
| 106 | |
| 107 | /** |
| 108 | * Returns kubevirt security group rule builder with supplied security group id. |
| 109 | * |
| 110 | * @param securityGroupId security group id |
| 111 | * @return security group rule builder |
| 112 | */ |
| 113 | Builder securityGroupId(String securityGroupId); |
| 114 | |
| 115 | /** |
| 116 | * Returns kubevirt security group rule builder with supplied direction. |
| 117 | * |
| 118 | * @param direction traffic direction |
| 119 | * @return security group rule builder |
| 120 | */ |
| 121 | Builder direction(String direction); |
| 122 | |
| 123 | /** |
| 124 | * Returns kubevirt security group rule builder with supplied etherType. |
| 125 | * |
| 126 | * @param etherType network etherType |
| 127 | * @return security group rule builder |
| 128 | */ |
| 129 | Builder etherType(String etherType); |
| 130 | |
| 131 | /** |
| 132 | * Returns kubevirt security group rule builder with supplied maximum port range. |
| 133 | * |
| 134 | * @param portRangeMax maximum port range |
| 135 | * @return security group rule builder |
| 136 | */ |
| 137 | Builder portRangeMax(Integer portRangeMax); |
| 138 | |
| 139 | /** |
| 140 | * Returns kubevirt security group rule builder with supplied minimum port range. |
| 141 | * |
| 142 | * @param portRangeMin minimum port range |
| 143 | * @return security group rule builder |
| 144 | */ |
| 145 | Builder portRangeMin(Integer portRangeMin); |
| 146 | |
| 147 | /** |
| 148 | * Returns kubevirt security group rule builder with supplied protocol. |
| 149 | * |
| 150 | * @param protocol network protocol |
| 151 | * @return security group rule builder |
| 152 | */ |
| 153 | Builder protocol(String protocol); |
| 154 | |
| 155 | /** |
| 156 | * Returns kubevirt security group rule builder with supplied remote IP prefix. |
| 157 | * |
| 158 | * @param remoteIpPrefix remote IP prefix |
| 159 | * @return security group rule builder |
| 160 | */ |
| 161 | Builder remoteIpPrefix(IpPrefix remoteIpPrefix); |
| 162 | |
| 163 | /** |
| 164 | * Returns kubevirt security group rule builder with supplied remote group id. |
| 165 | * |
| 166 | * @param remoteGroupId remote group id |
| 167 | * @return security group rule builder |
| 168 | */ |
| 169 | Builder remoteGroupId(String remoteGroupId); |
| 170 | } |
| 171 | } |