Phaneendra Manda
Committed by Ray Milkey

[ONOS-3116] Port Pair interface for SFC

Change-Id: Iecb72132bb84f062c9696a3f46bd6617519f8f68
1 +/*
2 + * Copyright 2015 Open Networking Laboratory
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.vtnrsc;
17 +
18 +
19 +/**
20 + * Abstraction of an entity providing Port Pair information.
21 + * A port pair represents a service function instance.
22 + */
23 +public interface PortPair {
24 +
25 + /**
26 + * Returns the ID of this port Pair.
27 + *
28 + * @return the port pair id
29 + */
30 + PortPairId portPairId();
31 +
32 + /**
33 + * Returns the tenant id of this port pair.
34 + *
35 + * @return an tenant id
36 + */
37 + TenantId tenantId();
38 +
39 + /**
40 + * Returns the description of this port pair.
41 + *
42 + * @return description of port pair
43 + */
44 + String name();
45 +
46 + /**
47 + * Returns the description of this port pair.
48 + *
49 + * @return description of port pair
50 + */
51 + String description();
52 +
53 + /**
54 + * Returns the ingress port of this port pair.
55 + *
56 + * @return ingress of port pair
57 + */
58 + String ingress();
59 +
60 + /**
61 + * Returns the egress port of this port pair.
62 + *
63 + * @return egress of port pair
64 + */
65 + String egress();
66 +
67 + /**
68 + * Returns whether this port pair is an exact match to the port pair given
69 + * in the argument.
70 + * <p>
71 + * Exact match means the Port port pairs match with the given port pair.
72 + * It does not consider the port pair id, name and description.
73 + * </p>
74 + * @param portPair other port pair to match against
75 + * @return true if the port pairs are an exact match, otherwise false
76 + */
77 + boolean exactMatch(PortPair portPair);
78 +
79 + /**
80 + * A port pair builder..
81 + */
82 + interface Builder {
83 +
84 + /**
85 + * Assigns the port pair id to this object.
86 + *
87 + * @param portPairId the port pair id
88 + * @return this the builder object
89 + */
90 + Builder setId(PortPairId portPairId);
91 +
92 + /**
93 + * Assigns tenant id to this object.
94 + *
95 + * @param tenantId tenant id of the port pair
96 + * @return this the builder object
97 + */
98 + Builder setTenantId(TenantId tenantId);
99 +
100 + /**
101 + * Assigns the name to this object.
102 + *
103 + * @param name name of the port pair
104 + * @return this the builder object
105 + */
106 + Builder setName(String name);
107 +
108 + /**
109 + * Assigns the description to this object.
110 + *
111 + * @param description description of the port pair
112 + * @return this the builder object
113 + */
114 + Builder setDescription(String description);
115 +
116 + /**
117 + * Assigns the ingress port to this object.
118 + *
119 + * @param port ingress port of the port pair
120 + * @return this the builder object
121 + */
122 + Builder setIngress(String port);
123 +
124 + /**
125 + * Assigns the egress port to this object.
126 + *
127 + * @param port egress port of the port pair
128 + * @return this the builder object
129 + */
130 + Builder setEgress(String port);
131 +
132 + /**
133 + * Builds a port pair object.
134 + *
135 + * @return a port pair.
136 + */
137 + PortPair build();
138 + }
139 +}