Yuta HIGUCHI | d0f8d89 | 2018-04-09 12:14:00 -0700 | [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 | package org.onosproject.odtn.behaviour; |
| 17 | |
Yuta HIGUCHI | 9ee8664 | 2018-05-15 15:25:00 -0700 | [diff] [blame] | 18 | import java.util.Collections; |
Yuta HIGUCHI | d0f8d89 | 2018-04-09 12:14:00 -0700 | [diff] [blame] | 19 | import java.util.List; |
| 20 | |
Yuta HIGUCHI | 9ee8664 | 2018-05-15 15:25:00 -0700 | [diff] [blame] | 21 | import org.onosproject.net.PortNumber; |
Yuta HIGUCHI | d0f8d89 | 2018-04-09 12:14:00 -0700 | [diff] [blame] | 22 | import org.onosproject.net.driver.HandlerBehaviour; |
| 23 | |
| 24 | import com.google.common.annotations.Beta; |
| 25 | |
| 26 | /** |
| 27 | * Behaviour for Transceiver. |
| 28 | */ |
| 29 | @Beta |
| 30 | public interface ConfigurableTransceiver extends HandlerBehaviour { |
| 31 | |
| 32 | /** |
| 33 | * Generate configuration to enable/disable transceiver. |
| 34 | * |
Yuta HIGUCHI | 01c66eb | 2018-05-22 12:12:35 -0700 | [diff] [blame] | 35 | * @param client side port of transceiver to enable/disable |
| 36 | * @param line side port of transceiver to enable/disable |
Yuta HIGUCHI | d0f8d89 | 2018-04-09 12:14:00 -0700 | [diff] [blame] | 37 | * @param enable or disable |
| 38 | * @return XML documents (List to handle configuration with multiple-roots) |
| 39 | */ |
| 40 | // return type and how component get specified are likely to change in future |
| 41 | @Beta |
Yuta HIGUCHI | 01c66eb | 2018-05-22 12:12:35 -0700 | [diff] [blame] | 42 | List<CharSequence> enable(PortNumber client, PortNumber line, boolean enable); |
Yuta HIGUCHI | 9ee8664 | 2018-05-15 15:25:00 -0700 | [diff] [blame] | 43 | |
| 44 | // defined only for the purpose of test command without device. |
| 45 | @Deprecated |
| 46 | default List<CharSequence> enable(String name, boolean enable) { |
| 47 | return Collections.emptyList(); |
| 48 | } |
| 49 | |
Yuta HIGUCHI | d0f8d89 | 2018-04-09 12:14:00 -0700 | [diff] [blame] | 50 | } |