blob: 884e3b15f193f6f1a9cb81796f7217245d08ba18 [file] [log] [blame]
Ray Milkey2d572dd2017-04-14 10:01:24 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Ray Milkey2d572dd2017-04-14 10:01:24 -07003 *
Shravan Ambatibb6b4452016-05-04 13:25:28 -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 Ambatibb6b4452016-05-04 13:25:28 -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.converter;
17
18import org.onosproject.event.Event;
19
Shravan Ambatibb6b4452016-05-04 13:25:28 -070020
21/**
22 *
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070023 * APIs for converting between ONOS event objects and protobuf data objects.
Shravan Ambatibb6b4452016-05-04 13:25:28 -070024 *
25 */
26public interface EventConverter {
27
28 /**
29 * Converts ONOS specific event data to a format that is suitable for export
30 * to Kafka.
31 *
32 * @param event ONOS Event object
Shravan Ambatia4875d82017-01-09 13:06:51 -080033 * @return converted data in protobuf format as a byte array.
Shravan Ambatibb6b4452016-05-04 13:25:28 -070034 */
Shravan Ambatia4875d82017-01-09 13:06:51 -080035 byte[] convertToProtoMessage(Event<?, ?> event);
Shravan Ambatibb6b4452016-05-04 13:25:28 -070036}