blob: f553c71ca0d2fef1560e0d1335c27eb9ec65533d [file] [log] [blame]
HIGUCHI Yuta95d83e82016-04-26 12:13:48 -07001/*
2 * Copyright 2016-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.net.optical;
17
18import org.onlab.util.Frequency;
HIGUCHI Yuta95d83e82016-04-26 12:13:48 -070019import com.google.common.annotations.Beta;
20
21/**
22 * OMS port (Optical Multiplexing Section).
23 * Also referred to as a WDM port or W-port.
24 * See ITU G.709 "Interfaces for the Optical Transport Network (OTN)"
25 *
26 * Assumes we only support fixed grid for now.
27 */
28@Beta
Yuta HIGUCHI1d547bf2016-08-02 21:44:48 -070029public interface OmsPort extends ProjectedPort {
HIGUCHI Yuta95d83e82016-04-26 12:13:48 -070030
31 /**
32 * Returns the total number of channels on the port.
33 *
34 * @return total number of channels
35 */
36 default short totalChannels() {
37 Frequency diff = maxFrequency().subtract(minFrequency());
Jimmy Yan4deb03b2016-06-24 10:53:54 -070038 return (short) (diff.asHz() / grid().asHz() + 1);
HIGUCHI Yuta95d83e82016-04-26 12:13:48 -070039 }
40
41 /**
42 * Returns the minimum frequency.
43 *
44 * @return minimum frequency
45 */
46 Frequency minFrequency();
47
48 /**
49 * Returns the maximum frequency.
50 *
51 * @return maximum frequency
52 */
53 Frequency maxFrequency();
54
55 /**
56 * Returns the grid spacing frequency.
57 *
58 * @return grid spacing frequency
59 */
60 Frequency grid();
61
62}