blob: cedc84ad067dad26b547dd4a98911cabf80387d0 [file] [log] [blame]
Jian Li75642312017-01-19 14:23:05 -08001/*
2 * Copyright 2017-present Open Networking Laboratory
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 */
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 Li2dc9f002017-03-03 04:26:31 +090038 * Obtains the collection of mapping entries applied on the specific device.
39 * The will include mapping which may not yet have been applied to device.
40 *
41 * @param type mapping store type
42 * @param deviceId device identifier
43 * @return collection of mapping entries
44 */
45 Iterable<MappingEntry> getMappingEntries(Type type, DeviceId deviceId);
46
47 /**
48 * Obtains the collection of mapping entries with a given application ID.
49 *
50 * @param type mapping store type
51 * @param appId application identifier
52 * @return collection of mapping entries
53 */
Jian Li9552f172017-04-20 00:19:56 +090054 Iterable<MappingEntry> getMappingEntriesByAppId(Type type, ApplicationId appId);
Jian Li75642312017-01-19 14:23:05 -080055}