blob: 665024ae4e8ba960c0ea091b2110d612f7a9a944 [file] [log] [blame]
Jian Lidaa7d6a2021-04-13 17:22:56 +09001/*
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 */
16package org.onosproject.kubevirtnetworking.api;
17
18/**
19 * Representation of load balancer rule.
20 */
21public interface KubevirtLoadBalancerRule {
22
23 /**
24 * Returns the maximum port range.
25 *
26 * @return maximum port range
27 */
28 Integer portRangeMax();
29
30 /**
31 * Returns the minimum port range.
32 *
33 * @return minimum port range
34 */
35 Integer portRangeMin();
36
37 /**
38 * Returns the network protocol.
39 *
40 * @return network protocol
41 */
42 String protocol();
43
44 /**
45 * A default builder interface.
46 */
47 interface Builder {
48 /**
49 * Builds an immutable load balancer rule instance.
50 *
51 * @return kubevirt load balancer rule
52 */
53 KubevirtLoadBalancerRule build();
54
55 /**
56 * Returns kubevirt load balancer rule builder with supplied maximum port range.
57 *
58 * @param portRangeMax maximum port range
59 * @return balancer rule rule builder
60 */
61 Builder portRangeMax(Integer portRangeMax);
62
63 /**
64 * Returns kubevirt load balancer rule builder with supplied minimum port range.
65 *
66 * @param portRangeMin minimum port range
67 * @return balancer rule rule builder
68 */
69 Builder portRangeMin(Integer portRangeMin);
70
71 /**
72 * Returns kubevirt load balancer rule builder with supplied protocol.
73 *
74 * @param protocol network protocol
75 * @return balancer rule rule builder
76 */
77 Builder protocol(String protocol);
78
79 }
80}