blob: 898fce976a27abe9fd7c1a4a068769c594ba866b [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;
19import org.onosproject.net.Port;
20
21import com.google.common.annotations.Beta;
22
23/**
24 * OMS port (Optical Multiplexing Section).
25 * Also referred to as a WDM port or W-port.
26 * See ITU G.709 "Interfaces for the Optical Transport Network (OTN)"
27 *
28 * Assumes we only support fixed grid for now.
29 */
30@Beta
31public interface OmsPort extends Port {
32
33 /**
34 * Returns the total number of channels on the port.
35 *
36 * @return total number of channels
37 */
38 default short totalChannels() {
39 Frequency diff = maxFrequency().subtract(minFrequency());
Jimmy Yan4deb03b2016-06-24 10:53:54 -070040 return (short) (diff.asHz() / grid().asHz() + 1);
HIGUCHI Yuta95d83e82016-04-26 12:13:48 -070041 }
42
43 /**
44 * Returns the minimum frequency.
45 *
46 * @return minimum frequency
47 */
48 Frequency minFrequency();
49
50 /**
51 * Returns the maximum frequency.
52 *
53 * @return maximum frequency
54 */
55 Frequency maxFrequency();
56
57 /**
58 * Returns the grid spacing frequency.
59 *
60 * @return grid spacing frequency
61 */
62 Frequency grid();
63
64}