blob: e601a9f7fde8e8a41701b4cbc55f957cc351c049 [file] [log] [blame]
Marc De Leenheerbb382352015-04-23 18:20:34 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Marc De Leenheerbb382352015-04-23 18:20:34 -07003 *
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.device;
17
18import com.google.common.base.MoreObjects;
Toru Furusawa72ee30c2016-01-08 13:29:04 -080019import org.onosproject.net.CltSignalType;
Marc De Leenheerbb382352015-04-23 18:20:34 -070020import org.onosproject.net.Port;
21import org.onosproject.net.PortNumber;
22import org.onosproject.net.SparseAnnotations;
23
24/**
25 * Default implementation of immutable ODU client port description.
HIGUCHI Yuta4c0ef6b2016-05-02 19:45:41 -070026 *
27 * @deprecated in Goldeneye (1.6.0)
Marc De Leenheerbb382352015-04-23 18:20:34 -070028 */
HIGUCHI Yuta4c0ef6b2016-05-02 19:45:41 -070029@Deprecated
Marc De Leenheerbb382352015-04-23 18:20:34 -070030public class OduCltPortDescription extends DefaultPortDescription {
31
Toru Furusawa72ee30c2016-01-08 13:29:04 -080032 private final CltSignalType signalType;
Marc De Leenheerbb382352015-04-23 18:20:34 -070033
34 /**
35 * Creates ODU client port description based on the supplied information.
36 *
37 * @param number port number
38 * @param isEnabled port enabled state
39 * @param signalType ODU client signal type
40 * @param annotations optional key/value annotations map
41 */
Toru Furusawa72ee30c2016-01-08 13:29:04 -080042 public OduCltPortDescription(PortNumber number, boolean isEnabled, CltSignalType signalType,
Marc De Leenheerbb382352015-04-23 18:20:34 -070043 SparseAnnotations... annotations) {
44 super(number, isEnabled, Port.Type.ODUCLT, 0, annotations);
45 this.signalType = signalType;
46 }
47
48 /**
49 * Creates ODU client port description based on the supplied information.
50 *
51 * @param base PortDescription to get basic information from
52 * @param signalType ODU client signal type
53 * @param annotations optional key/value annotations map
54 */
Toru Furusawa72ee30c2016-01-08 13:29:04 -080055 public OduCltPortDescription(PortDescription base, CltSignalType signalType,
Marc De Leenheerbb382352015-04-23 18:20:34 -070056 SparseAnnotations annotations) {
57 super(base, annotations);
58 this.signalType = signalType;
59 }
60
61 /**
62 * Returns ODU client signal type.
63 *
64 * @return ODU client signal type
65 */
Toru Furusawa72ee30c2016-01-08 13:29:04 -080066 public CltSignalType signalType() {
Marc De Leenheerbb382352015-04-23 18:20:34 -070067 return signalType;
68 }
69
70 @Override
71 public String toString() {
72 return MoreObjects.toStringHelper(getClass())
73 .add("number", portNumber())
74 .add("isEnabled", isEnabled())
75 .add("type", type())
76 .add("signalType", signalType)
77 .toString();
78 }
79
80}