blob: 8863225537e9c4de484cf7ba634b893eda03d9ba [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;
Shravan Ambati7d199542016-04-22 16:09:05 -070017import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type;
18
19/**
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070020 * Abstraction of subscription to an event type.
Shravan Ambati7d199542016-04-22 16:09:05 -070021 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070022public interface EventSubscriber {
23 /**
24 * Returns the application name.
25 *
26 * @return application name.
27 */
28 String appName();
Shravan Ambati7d199542016-04-22 16:09:05 -070029
30 /**
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070031 * Returns the subscriber group ID.
32 * @return subscriber group ID.
Shravan Ambati7d199542016-04-22 16:09:05 -070033 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070034 EventSubscriberGroupId subscriberGroupId();
Shravan Ambati7d199542016-04-22 16:09:05 -070035
36 /**
37 * Returns the Event type.
38 *
39 * @return ONOS Event Type
40 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070041 Type eventType();
Shravan Ambati7d199542016-04-22 16:09:05 -070042
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070043 /**
44 * An event subscriber builder.
45 */
46 interface Builder {
47 Builder setAppName(String appName);
Shravan Ambati7d199542016-04-22 16:09:05 -070048
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070049 Builder setSubscriberGroupId(EventSubscriberGroupId subscriberGroupId);
Shravan Ambati7d199542016-04-22 16:09:05 -070050
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070051 Builder setEventType(Type eventType);
Shravan Ambati7d199542016-04-22 16:09:05 -070052
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070053 EventSubscriber build();
Shravan Ambati7d199542016-04-22 16:09:05 -070054 }
55}