blob: d827e7bb0153df091640cd727cdee2f9431ff4d2 [file] [log] [blame]
Ray Milkey2d572dd2017-04-14 10:01:24 -07001/*
Shravan Ambati7d199542016-04-22 16:09:05 -07002 * Copyright 2016-present Open Networking Laboratory
Ray Milkey2d572dd2017-04-14 10:01:24 -07003 *
Shravan Ambati7d199542016-04-22 16:09:05 -07004 * 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 Milkey2d572dd2017-04-14 10:01:24 -07007 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
Shravan Ambati7d199542016-04-22 16:09:05 -070010 * 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 */
16package org.onosproject.kafkaintegration.api.dto;
17
18import org.onosproject.event.AbstractEvent;
19
Shravan Ambati7d199542016-04-22 16:09:05 -070020/**
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070021 * Represents the converted Onos Event data into protobuf format.
Shravan Ambati7d199542016-04-22 16:09:05 -070022 *
23 */
Yuta HIGUCHI9efba1e2016-07-09 11:07:13 -070024// FIXME lack of abstraction in subject type is biting us
Shravan Ambatia4875d82017-01-09 13:06:51 -080025public class OnosEvent extends AbstractEvent<OnosEvent.Type, byte[]> {
Shravan Ambati7d199542016-04-22 16:09:05 -070026
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 Ambatia4875d82017-01-09 13:06:51 -080033 public OnosEvent(Type type, byte[] subject) {
Shravan Ambati7d199542016-04-22 16:09:05 -070034 super(type, subject);
35 }
36
37 /**
38 * List of Event Types supported.
39 */
40 public enum Type {
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070041 /**
42 * Signifies Device events.
43 */
Yuta HIGUCHI156d7802016-08-18 14:03:23 -070044 DEVICE,
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070045
46 /**
47 * Signifies Link events.
48 */
Jon Hall8c7b06a2017-02-22 13:37:33 -080049 LINK
Shravan Ambati7d199542016-04-22 16:09:05 -070050 }
51}