blob: 4a9bc90a05406edaa8a13ea3dc408ad7e1ebd25b [file] [log] [blame]
Andrea Campanellaf9c409a2017-07-13 14:14:41 +02001/*
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
17
Carmelo Cascone39c28ca2017-11-15 13:03:57 -080018package org.onosproject.net.pi.service;
Andrea Campanellaf9c409a2017-07-13 14:14:41 +020019
20import com.google.common.annotations.Beta;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.pi.model.PiPipeconfId;
23import org.onosproject.store.Store;
24
25import java.util.Set;
26
27/**
28 * Manages the mapping of Pipeconfs that are deployed to devices; not intended for direct use.
29 */
30@Beta
31public interface PiPipeconfMappingStore extends Store<PiPipeconfDeviceMappingEvent, PiPipeconfMappingStoreDelegate> {
32
33 /**
Carmelo Casconeda0b5592018-09-14 12:54:15 -070034 * Retrieves the id of the pipeconf associated to a given device.
Andrea Campanellaf9c409a2017-07-13 14:14:41 +020035 *
36 * @param deviceId device identifier
37 * @return PiPipeconfId
38 */
39 PiPipeconfId getPipeconfId(DeviceId deviceId);
40
41 /**
42 * Retrieves the set of devices on which the given pipeconf is applied.
43 *
44 * @param pipeconfId pipeconf identifier
45 * @return the set of devices that have that pipeconf applied.
46 */
47 Set<DeviceId> getDevices(PiPipeconfId pipeconfId);
48
49 /**
50 * Stores or updates a binding between a device and the pipeconf deployed on it.
51 *
52 * @param deviceId deviceId
53 * @param pipeconfId pipeconfId
54 */
55
56 void createOrUpdateBinding(DeviceId deviceId, PiPipeconfId pipeconfId);
57
58 /**
59 * Removes device to pipeconf binding.
60 *
61 * @param deviceId deviceId
62 */
63
64 void removeBinding(DeviceId deviceId);
65
66}