Ramon Casellas | 99c1625 | 2019-05-31 14:29:00 +0200 | [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 | package org.onosproject.drivers.odtn.openroadm; |
| 19 | |
| 20 | public class OpenRoadmOmsInterface extends OpenRoadmInterface { |
| 21 | |
| 22 | public String toString() { |
| 23 | StringBuilder sb = new StringBuilder(); |
| 24 | sb.append("<interface>"); |
| 25 | sb.append("<name>" + name + "</name>"); |
| 26 | sb.append("<description>" + description + "</description>"); |
| 27 | sb.append( |
| 28 | "<type xmlns:openROADM-if=\"http://org/openroadm/interfaces\">openROADM-if:openROADMOpticalMultiplex</type>"); |
| 29 | sb.append("<administrative-state>inService</administrative-state>"); |
| 30 | sb.append("<supporting-circuit-pack-name>" + supportingCircuitPack + |
| 31 | "</supporting-circuit-pack-name>"); |
| 32 | sb.append("<supporting-port>" + supportingPort + "</supporting-port>"); |
| 33 | if (!supportingInterface.isEmpty()) { |
| 34 | sb.append("<supporting-interface>" + supportingInterface + "</supporting-interface>"); |
| 35 | } |
| 36 | return sb.toString(); |
| 37 | } |
| 38 | |
| 39 | public abstract static class Builder<T extends Builder<T>> |
| 40 | extends OpenRoadmInterface.Builder<T> { |
| 41 | // |
| 42 | } |
| 43 | |
| 44 | private static class Builder2 extends Builder<Builder2> { |
| 45 | @Override |
| 46 | protected Builder2 self() { |
| 47 | return this; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | public static Builder<?> builder() { |
| 52 | return new Builder2(); |
| 53 | } |
| 54 | |
| 55 | protected OpenRoadmOmsInterface(Builder<?> builder) { |
| 56 | super(builder); |
| 57 | } |
| 58 | } |