blob: f58afd2f3b1b6d3e0768c35b1f52b4b91a89c583 [file] [log] [blame]
Jian Li75642312017-01-19 14:23:05 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Jian Li75642312017-01-19 14:23:05 -08003 *
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 */
16package org.onosproject.mapping;
17
Jian Li2dc9f002017-03-03 04:26:31 +090018import org.onosproject.core.ApplicationId;
Jian Li95edb592017-01-29 08:42:07 +090019import org.onosproject.event.ListenerService;
Jian Li2dc9f002017-03-03 04:26:31 +090020import org.onosproject.mapping.MappingStore.Type;
21import org.onosproject.net.DeviceId;
Jian Li95edb592017-01-29 08:42:07 +090022
Jian Li75642312017-01-19 14:23:05 -080023/**
24 * Interface of mapping management service.
25 */
Jian Li95edb592017-01-29 08:42:07 +090026public interface MappingService
Jian Li2dc9f002017-03-03 04:26:31 +090027 extends ListenerService<MappingEvent, MappingListener> {
28
29 /**
30 * Obtains the number of mappings in the system.
31 *
32 * @param type mapping store type
33 * @return mapping count
34 */
35 int getMappingCount(Type type);
36
37 /**
Jian Lic87b23b2017-04-24 15:28:10 +090038 * Obtains the collection of mapping entries of all devices.
39 * This will include mapping which may not yet have been applied to device.
40 *
41 * @param type mapping store type
42 * @return collection of mapping entries
43 */
44 Iterable<MappingEntry> getAllMappingEntries(Type type);
45
46 /**
Jian Li2dc9f002017-03-03 04:26:31 +090047 * Obtains the collection of mapping entries applied on the specific device.
48 * The will include mapping which may not yet have been applied to device.
49 *
50 * @param type mapping store type
51 * @param deviceId device identifier
52 * @return collection of mapping entries
53 */
54 Iterable<MappingEntry> getMappingEntries(Type type, DeviceId deviceId);
55
56 /**
57 * Obtains the collection of mapping entries with a given application ID.
58 *
59 * @param type mapping store type
60 * @param appId application identifier
61 * @return collection of mapping entries
62 */
Jian Li9552f172017-04-20 00:19:56 +090063 Iterable<MappingEntry> getMappingEntriesByAppId(Type type, ApplicationId appId);
Jian Li75642312017-01-19 14:23:05 -080064}