alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Foundation |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 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 | */ |
alshabib | 2ce0c73 | 2015-10-02 11:20:39 +0200 | [diff] [blame] | 16 | package org.onosproject.net.mcast; |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 19 | |
alshabib | ed0951f | 2015-10-02 21:39:27 +0200 | [diff] [blame] | 20 | import static com.google.common.base.MoreObjects.toStringHelper; |
| 21 | |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 22 | /** |
| 23 | * An entity representing a multicast event. Event either add or remove |
| 24 | * sinks or sources. |
Ray Milkey | aa8de85 | 2017-08-23 09:55:02 -0700 | [diff] [blame] | 25 | * |
| 26 | * @deprecated in 1.11 ("Loon") release. To be moved into an app. |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 27 | */ |
Ray Milkey | aa8de85 | 2017-08-23 09:55:02 -0700 | [diff] [blame] | 28 | @Deprecated |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 29 | public class McastEvent extends AbstractEvent<McastEvent.Type, McastRouteInfo> { |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 30 | |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 31 | |
| 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 | /** |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 49 | * 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 | |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 59 | public McastEvent(McastEvent.Type type, McastRouteInfo subject) { |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 60 | super(type, subject); |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 61 | } |
| 62 | |
alshabib | ed0951f | 2015-10-02 21:39:27 +0200 | [diff] [blame] | 63 | |
| 64 | @Override |
| 65 | public String toString() { |
| 66 | return toStringHelper(this) |
| 67 | .add("type", type()) |
alshabib | 79e5287 | 2015-12-07 16:01:01 -0800 | [diff] [blame] | 68 | .add("info", subject()).toString(); |
alshabib | ed0951f | 2015-10-02 21:39:27 +0200 | [diff] [blame] | 69 | } |
alshabib | a9b2b5d | 2015-09-23 15:01:47 -0700 | [diff] [blame] | 70 | } |