Andrea Campanella | f9c409a | 2017-07-13 14:14:41 +0200 | [diff] [blame] | 1 | /* |
| 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 Cascone | 39c28ca | 2017-11-15 13:03:57 -0800 | [diff] [blame] | 18 | package org.onosproject.net.pi.service; |
Andrea Campanella | f9c409a | 2017-07-13 14:14:41 +0200 | [diff] [blame] | 19 | |
| 20 | import com.google.common.annotations.Beta; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.pi.model.PiPipeconfId; |
| 23 | import org.onosproject.store.Store; |
| 24 | |
| 25 | import java.util.Set; |
| 26 | |
| 27 | /** |
| 28 | * Manages the mapping of Pipeconfs that are deployed to devices; not intended for direct use. |
| 29 | */ |
| 30 | @Beta |
| 31 | public interface PiPipeconfMappingStore extends Store<PiPipeconfDeviceMappingEvent, PiPipeconfMappingStoreDelegate> { |
| 32 | |
| 33 | /** |
Carmelo Cascone | da0b559 | 2018-09-14 12:54:15 -0700 | [diff] [blame] | 34 | * Retrieves the id of the pipeconf associated to a given device. |
Andrea Campanella | f9c409a | 2017-07-13 14:14:41 +0200 | [diff] [blame] | 35 | * |
| 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 | } |