Rohit Singh | 16d4df9 | 2019-07-15 19:33:05 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-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 | * This Work is contributed by Sterlite Technologies |
| 17 | */ |
| 18 | package org.onosproject.net.behaviour; |
| 19 | |
| 20 | import com.google.common.annotations.Beta; |
| 21 | import org.onosproject.net.ModulationScheme; |
| 22 | import org.onosproject.net.PortNumber; |
| 23 | import org.onosproject.net.driver.HandlerBehaviour; |
| 24 | |
| 25 | import java.util.Optional; |
| 26 | |
| 27 | /* |
| 28 | * |
| 29 | * Modulation operations act on a network port and a component thereof. |
| 30 | * Supported components are either the full directed port ({@link org.onosproject.net.Direction}) |
| 31 | * or a wavelength on a port ({@link org.onosproject.net.OchSignal}). |
| 32 | * |
| 33 | * Modulation are dependent on channel spacing and bitrate |
| 34 | */ |
| 35 | @Beta |
| 36 | public interface ModulationConfig<T> extends HandlerBehaviour { |
| 37 | |
| 38 | /** |
| 39 | * Get the target Modulation Scheme on the component. |
| 40 | * |
| 41 | * @param port the port |
| 42 | * @param component the port component |
| 43 | * @return ModulationScheme as per bitRate value |
| 44 | */ |
| 45 | Optional<ModulationScheme> getModulationScheme(PortNumber port, T component); |
| 46 | |
| 47 | /** |
| 48 | * Set the target Modulation Scheme on the component. |
| 49 | * |
| 50 | * @param port the port |
| 51 | * @param component the port component |
| 52 | * @param bitRate bit rate in bps |
| 53 | */ |
| 54 | void setModulationScheme(PortNumber port, T component, long bitRate); |
| 55 | |
| 56 | } |
| 57 | |