blob: 3de81999977b951e8bf6d6436f4aaf6a350a0e53 [file] [log] [blame]
Shravan Ambati7d199542016-04-22 16:09:05 -07001/**
2 * Copyright 2016-present Open Networking Laboratory
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6
7 * http://www.apache.org/licenses/LICENSE-2.0
8
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15package org.onosproject.kafkaintegration.api.dto;
Shravan Ambati7d199542016-04-22 16:09:05 -070016import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type;
17
18/**
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070019 * Abstraction of subscription to an event type.
Shravan Ambati7d199542016-04-22 16:09:05 -070020 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070021public interface EventSubscriber {
22 /**
23 * Returns the application name.
24 *
25 * @return application name.
26 */
27 String appName();
Shravan Ambati7d199542016-04-22 16:09:05 -070028
29 /**
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070030 * Returns the subscriber group ID.
31 * @return subscriber group ID.
Shravan Ambati7d199542016-04-22 16:09:05 -070032 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070033 EventSubscriberGroupId subscriberGroupId();
Shravan Ambati7d199542016-04-22 16:09:05 -070034
35 /**
36 * Returns the Event type.
37 *
38 * @return ONOS Event Type
39 */
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070040 Type eventType();
Shravan Ambati7d199542016-04-22 16:09:05 -070041
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070042 /**
43 * An event subscriber builder.
44 */
45 interface Builder {
46 Builder setAppName(String appName);
Shravan Ambati7d199542016-04-22 16:09:05 -070047
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070048 Builder setSubscriberGroupId(EventSubscriberGroupId subscriberGroupId);
Shravan Ambati7d199542016-04-22 16:09:05 -070049
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070050 Builder setEventType(Type eventType);
Shravan Ambati7d199542016-04-22 16:09:05 -070051
Sanjana Agarwaleb9f0c52016-06-07 11:10:34 -070052 EventSubscriber build();
Shravan Ambati7d199542016-04-22 16:09:05 -070053 }
54}