blob: 3cfb41a6b9bfa5004184bb8d5f637483b8267dbc [file] [log] [blame]
Andrea Campanella01e886e2017-12-15 15:27:31 +01001/*
2 * Copyright 2017-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
17package org.onosproject.t3.api;
18
19import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.flow.TrafficSelector;
21import org.onosproject.net.group.Group;
22
23import java.util.List;
24
25/**
26 * Class to represent the groups in a device for a given output and packet.
27 */
28//FIXME consider removing.
29public class GroupsInDevice {
30
31 private ConnectPoint output;
32 private List<Group> groups;
33 private TrafficSelector selector;
34
35 /**
36 * Saves the given groups for the output connect point and the selector.
37 * @param output the output connect point
38 * @param groups the groups
39 * @param selector the selector representing the final packet
40 */
41 public GroupsInDevice(ConnectPoint output, List<Group> groups, TrafficSelector selector) {
42
43 this.output = output;
44 this.groups = groups;
45 this.selector = selector;
46 }
47
48 /**
49 * Returns the output connect point.
50 * @return the connect point
51 */
52 public ConnectPoint getOutput() {
53 return output;
54 }
55
56 /**
57 * Returns the groups.
58 * @return groups.
59 */
60 public List<Group> getGroups() {
61 return groups;
62 }
63
64 /**
65 * Returns the final packet after traversing the network.
66 * @return the selector with packet info
67 */
68 public TrafficSelector getFinalPacket() {
69 return selector;
70 }
71
72 @Override
73 public String toString() {
74 return "GroupsInDevice{" +
75 "output=" + output +
76 ", groups=" + groups +
77 ", selector=" + selector +
78 '}';
79 }
80
81}