blob: c2ed203ba2ce404d7e1c3fa4b5cdd2983d31b1b5 [file] [log] [blame]
Kalhee Kimba366062017-11-07 16:32:09 +00001/*
2 * Copyright 2017-present Open Networking Foundation
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 */
16
17package org.onosproject.routing.fpm.api;
18
19import org.onosproject.store.Store;
20import org.onosproject.store.StoreDelegate;
21import org.onlab.packet.IpPrefix;
22import java.util.Collection;
23import java.util.Optional;
24
25/**
26 * Interface to store Fpm records.
27 */
28public interface FpmPrefixStore extends Store<FpmPrefixStoreEvent, StoreDelegate<FpmPrefixStoreEvent>> {
29
30 /**
31 * Gets Fpm record for a prefix.
32 *
33 * @param prefix is the key
34 * @return the Fpm record; empty if record does not exist
35 */
36 Optional<FpmRecord> getFpmRecord(IpPrefix prefix);
37
38 /**
39 * Gets all Fpm records from the data store.
40 *
41 * @return all FPM records
42 */
43 Collection<FpmRecord> getFpmRecords();
44
45 /**
46 * Set a delegate on the data store to be notified of events.
47 *
48 * @param delegate is the delegate to be added
49 */
50 public void setDelegate(StoreDelegate<FpmPrefixStoreEvent> delegate);
51
52 /**
53 * Unset delegate on the data store.
54 *
55 * @param delegate us the delegate to be removed
56 */
57 public void unsetDelegate(StoreDelegate<FpmPrefixStoreEvent> delegate);
58}