blob: 0b571b171371a66db540e81324007bbb238b8be5 [file] [log] [blame]
Phaneendra Manda3e128832015-10-26 22:13:38 +05301/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Phaneendra Manda3e128832015-10-26 22:13:38 +05303 *
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.vtnrsc;
17
18import java.util.List;
19
20/**
21 * Abstraction of an entity providing Port Pair Group information.
22 * A port pair group consists of one or more port pairs.
23 */
24public interface PortPairGroup {
25
26 /**
27 * Returns the ID of this port pair group.
28 *
29 * @return the port pair group id
30 */
31 PortPairGroupId portPairGroupId();
32
33 /**
34 * Returns the tenant id of this port pair group.
35 *
36 * @return the tenant id
37 */
38 TenantId tenantId();
39
40 /**
41 * Returns the name of this port pair group.
42 *
43 * @return name of port pair group
44 */
45 String name();
46
47 /**
48 * Returns the description of this port pair group.
49 *
50 * @return description of port pair group
51 */
52 String description();
53
54 /**
55 * Returns the list of port pairs associated with this port pair group.
56 *
57 * @return list of port pairs
58 */
59 List<PortPairId> portPairs();
60
61 /**
Phaneendra Manda329a1272016-02-10 22:57:00 +053062 * Adds the load on the given port pair id.
63 *
64 * @param portPairId port pair id.
65 */
66 public void addLoad(PortPairId portPairId);
67
68 /**
69 * Get the load on the given port pair id.
70 *
71 * @param portPairId port pair id
72 * @return load on the given port pair id.
73 */
74 public int getLoad(PortPairId portPairId);
75
76 /**
Phaneendra Manda3e128832015-10-26 22:13:38 +053077 * Returns whether this port pair group is an exact match to the
78 * port pair group given in the argument.
79 * <p>
80 * Exact match means the Port pairs match with the given port pair group.
81 * It does not consider the port pair group id, name and description.
82 * </p>
83 * @param portPairGroup other port pair group to match against
84 * @return true if the port pairs are an exact match, otherwise false
85 */
86 boolean exactMatch(PortPairGroup portPairGroup);
87
88 /**
89 * A port pair group builder..
90 */
91 interface Builder {
92
93 /**
94 * Assigns the port pair group id to this object.
95 *
96 * @param portPairGroupId the port pair group id
97 * @return this the builder object
98 */
99 Builder setId(PortPairGroupId portPairGroupId);
100
101 /**
102 * Assigns tenant id to this object.
103 *
104 * @param tenantId tenant id of port pair group
105 * @return this the builder object
106 */
107 Builder setTenantId(TenantId tenantId);
108
109 /**
110 * Assigns the name to this object.
111 *
112 * @param name name of the port pair group
113 * @return this the builder object
114 */
115 Builder setName(String name);
116
117 /**
118 * Assigns the description to this object.
119 *
120 * @param description description of the port pair group
121 * @return this the builder object
122 */
123 Builder setDescription(String description);
124
125 /**
126 * Assigns the port pairs associated with the port pair group
127 * to this object.
128 *
129 * @param portPairs list of port pairs
130 * @return this the builder object
131 */
132 Builder setPortPairs(List<PortPairId> portPairs);
133
134 /**
135 * Builds a port pair group object.
136 *
137 * @return a port pair group object.
138 */
139 PortPairGroup build();
140 }
141}