Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 1 | /* |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 3 | * |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 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 |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 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.kafkaintegration.api.dto; |
| 17 | |
| 18 | import org.onosproject.event.AbstractEvent; |
| 19 | |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 20 | /** |
Sanjana Agarwal | cb4a3db | 2016-07-14 11:42:48 -0700 | [diff] [blame] | 21 | * Represents the converted Onos Event data into protobuf format. |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 22 | * |
| 23 | */ |
Yuta HIGUCHI | 9efba1e | 2016-07-09 11:07:13 -0700 | [diff] [blame] | 24 | // FIXME lack of abstraction in subject type is biting us |
Shravan Ambati | a4875d8 | 2017-01-09 13:06:51 -0800 | [diff] [blame] | 25 | public class OnosEvent extends AbstractEvent<OnosEvent.Type, byte[]> { |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 26 | |
| 27 | /** |
| 28 | * Creates a new Onos Event. |
| 29 | * |
| 30 | * @param type The Type of Onos Event |
| 31 | * @param subject Protobuf message corresponding to the Onos Event |
| 32 | */ |
Shravan Ambati | a4875d8 | 2017-01-09 13:06:51 -0800 | [diff] [blame] | 33 | public OnosEvent(Type type, byte[] subject) { |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 34 | super(type, subject); |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * List of Event Types supported. |
| 39 | */ |
| 40 | public enum Type { |
Sanjana Agarwal | cb4a3db | 2016-07-14 11:42:48 -0700 | [diff] [blame] | 41 | /** |
| 42 | * Signifies Device events. |
| 43 | */ |
Yuta HIGUCHI | 156d780 | 2016-08-18 14:03:23 -0700 | [diff] [blame] | 44 | DEVICE, |
Sanjana Agarwal | cb4a3db | 2016-07-14 11:42:48 -0700 | [diff] [blame] | 45 | |
| 46 | /** |
| 47 | * Signifies Link events. |
| 48 | */ |
Jon Hall | 8c7b06a | 2017-02-22 13:37:33 -0800 | [diff] [blame] | 49 | LINK |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 50 | } |
| 51 | } |