blob: 1e1dd9502bc59350bd19e00bc25eacb10d218a1e [file] [log] [blame]
alshabiba9b2b5d2015-09-23 15:01:47 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
alshabiba9b2b5d2015-09-23 15:01:47 -07003 *
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 */
alshabib2ce0c732015-10-02 11:20:39 +020016package org.onosproject.net.mcast;
alshabiba9b2b5d2015-09-23 15:01:47 -070017
18import org.onosproject.event.AbstractEvent;
alshabiba9b2b5d2015-09-23 15:01:47 -070019
alshabibed0951f2015-10-02 21:39:27 +020020import static com.google.common.base.MoreObjects.toStringHelper;
21
alshabiba9b2b5d2015-09-23 15:01:47 -070022/**
23 * An entity representing a multicast event. Event either add or remove
24 * sinks or sources.
Ray Milkey50b14582017-08-23 09:55:02 -070025 *
26 * @deprecated in 1.11 ("Loon") release. To be moved into an app.
alshabiba9b2b5d2015-09-23 15:01:47 -070027 */
Ray Milkey50b14582017-08-23 09:55:02 -070028@Deprecated
alshabib79e52872015-12-07 16:01:01 -080029public class McastEvent extends AbstractEvent<McastEvent.Type, McastRouteInfo> {
alshabiba9b2b5d2015-09-23 15:01:47 -070030
alshabiba9b2b5d2015-09-23 15:01:47 -070031
32 public enum Type {
33 /**
34 * A new mcast route has been added.
35 */
36 ROUTE_ADDED,
37
38 /**
39 * A mcast route has been removed.
40 */
41 ROUTE_REMOVED,
42
43 /**
44 * A source for a mcast route (ie. the subject) has been added.
45 */
46 SOURCE_ADDED,
47
48 /**
alshabiba9b2b5d2015-09-23 15:01:47 -070049 * A sink for a mcast route (ie. the subject) has been added.
50 */
51 SINK_ADDED,
52
53 /**
54 * A source for a mcast route (ie. the subject) has been removed.
55 */
56 SINK_REMOVED
57 }
58
alshabib79e52872015-12-07 16:01:01 -080059 public McastEvent(McastEvent.Type type, McastRouteInfo subject) {
alshabiba9b2b5d2015-09-23 15:01:47 -070060 super(type, subject);
alshabiba9b2b5d2015-09-23 15:01:47 -070061 }
62
alshabibed0951f2015-10-02 21:39:27 +020063
64 @Override
65 public String toString() {
66 return toStringHelper(this)
67 .add("type", type())
alshabib79e52872015-12-07 16:01:01 -080068 .add("info", subject()).toString();
alshabibed0951f2015-10-02 21:39:27 +020069 }
alshabiba9b2b5d2015-09-23 15:01:47 -070070}