blob: 35acb31d1c197ca7d38de33000766feb0a09888f [file] [log] [blame]
Ray Milkey2d572dd2017-04-14 10:01:24 -07001/*
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -07002 * Copyright 2016-present Open Networking Laboratory
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 */
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070016package org.onosproject.kafkaintegration.api;
17
Shravan Ambati4c6295e2016-12-20 14:53:06 -080018import java.util.concurrent.Future;
Shravan Ambati4c6295e2016-12-20 14:53:06 -080019import org.apache.kafka.clients.producer.ProducerRecord;
20import org.apache.kafka.clients.producer.RecordMetadata;
Shravan Ambatia4875d82017-01-09 13:06:51 -080021
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070022/**
Shravan Ambati4c6295e2016-12-20 14:53:06 -080023 * APIs for controlling the Kafka Producer.
24 *
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070025 */
26public interface KafkaPublisherService {
Shravan Ambati4c6295e2016-12-20 14:53:06 -080027 /**
28 * Sends message to Kafka Server.
29 *
30 * @param record a message to be sent
31 * @return metadata for a record that as been acknowledged
32 */
Shravan Ambatia4875d82017-01-09 13:06:51 -080033 Future<RecordMetadata> send(ProducerRecord<String, byte[]> record);
Sanjana Agarwalcb4a3db2016-07-14 11:42:48 -070034}