Ramon Casellas | 03f194f | 2018-11-15 16:06:02 +0100 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 2018-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 was partially supported by EC H2020 project METRO-HAUL (761727). |
| 17 | */ |
| 18 | |
| 19 | package org.onosproject.drivers.odtn.openconfig; |
| 20 | |
| 21 | import org.onosproject.driver.optical.query.CBandLambdaQuery; |
| 22 | import org.onosproject.net.ChannelSpacing; |
| 23 | import org.onosproject.net.OchSignal; |
| 24 | import org.onosproject.net.PortNumber; |
| 25 | import org.slf4j.Logger; |
| 26 | |
| 27 | import java.util.Set; |
| 28 | |
| 29 | import static org.slf4j.LoggerFactory.getLogger; |
| 30 | |
| 31 | |
| 32 | /** |
| 33 | * Lambda Query for OpenConfig based terminal devices. |
| 34 | */ |
| 35 | public class TerminalDeviceLambdaQuery extends CBandLambdaQuery { |
| 36 | |
| 37 | protected static final Logger log = getLogger(TerminalDeviceLambdaQuery.class); |
| 38 | |
| 39 | @Override |
| 40 | public Set<OchSignal> queryLambdas(PortNumber port) { |
| 41 | log.debug("OPENCONFIG: queried lambdas for port {}", port); |
| 42 | |
| 43 | // Profile 1 |
| 44 | channelSpacing = ChannelSpacing.CHL_50GHZ; |
| 45 | lambdaCount = 96; |
| 46 | slotGranularity = 4; |
| 47 | return super.queryLambdas(port); |
| 48 | |
| 49 | // Another option, commented until best option for transceiver tunability deduction is chosen Profile 2 |
| 50 | // short lambdaCount = 96; |
| 51 | // // fixed grid lambdas of 50GHz width |
| 52 | // return IntStream.rangeClosed(1, lambdaCount) |
| 53 | // .mapToObj(x -> OchSignal.newDwdmSlot(ChannelSpacing.CHL_50GHZ, x)) |
| 54 | // .collect(Collectors.toSet()); |
| 55 | } |
| 56 | } |