Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 1 | /* |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 3 | * |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 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 |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame^] | 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 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 | */ |
| 16 | package org.onosproject.kafkaintegration.api.dto; |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 17 | import org.onosproject.kafkaintegration.api.dto.OnosEvent.Type; |
| 18 | |
| 19 | /** |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 20 | * Abstraction of subscription to an event type. |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 21 | */ |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 22 | public interface EventSubscriber { |
| 23 | /** |
| 24 | * Returns the application name. |
| 25 | * |
| 26 | * @return application name. |
| 27 | */ |
| 28 | String appName(); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 29 | |
| 30 | /** |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 31 | * Returns the subscriber group ID. |
| 32 | * @return subscriber group ID. |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 33 | */ |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 34 | EventSubscriberGroupId subscriberGroupId(); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 35 | |
| 36 | /** |
| 37 | * Returns the Event type. |
| 38 | * |
| 39 | * @return ONOS Event Type |
| 40 | */ |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 41 | Type eventType(); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 42 | |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 43 | /** |
| 44 | * An event subscriber builder. |
| 45 | */ |
| 46 | interface Builder { |
| 47 | Builder setAppName(String appName); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 48 | |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 49 | Builder setSubscriberGroupId(EventSubscriberGroupId subscriberGroupId); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 50 | |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 51 | Builder setEventType(Type eventType); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 52 | |
Sanjana Agarwal | eb9f0c5 | 2016-06-07 11:10:34 -0700 | [diff] [blame] | 53 | EventSubscriber build(); |
Shravan Ambati | 7d19954 | 2016-04-22 16:09:05 -0700 | [diff] [blame] | 54 | } |
| 55 | } |