Shravan Ambati | 1e8471e | 2016-07-13 14:03:17 -0700 | [diff] [blame^] | 1 | /** |
| 2 | * Copyright 2016 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 | */ |
| 15 | package org.onosproject.kafkaintegration.api; |
| 16 | |
| 17 | import org.onosproject.kafkaintegration.api.dto.OnosEvent; |
| 18 | |
| 19 | /** |
| 20 | * APIs to insert and delete into a local store. This store is used to keep |
| 21 | * track of events that are being published. |
| 22 | */ |
| 23 | public interface KafkaEventStorageService { |
| 24 | |
| 25 | /** |
| 26 | * Inserts the Generated event into the local cache. |
| 27 | * |
| 28 | * @param e the ONOS Event |
| 29 | * @return true if the insertion was successful |
| 30 | */ |
| 31 | boolean insertCacheEntry(OnosEvent e); |
| 32 | |
| 33 | /** |
| 34 | * Updates the counter with the most recently published event's sequence |
| 35 | * number. |
| 36 | * |
| 37 | * @param sequenceNumber the updated value of sequence number. |
| 38 | */ |
| 39 | void updateLastPublishedEntry(Long sequenceNumber); |
| 40 | } |