Marc De Leenheer | 57a5af0 | 2016-12-02 20:54:41 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Marc De Leenheer | 57a5af0 | 2016-12-02 20:54:41 -0800 | [diff] [blame] | 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.tl1; |
| 17 | |
| 18 | import com.google.common.annotations.Beta; |
| 19 | import io.netty.channel.Channel; |
| 20 | import org.onlab.packet.IpAddress; |
| 21 | |
| 22 | @Beta |
| 23 | public interface Tl1Device { |
| 24 | IpAddress ip(); |
| 25 | |
| 26 | int port(); |
| 27 | |
| 28 | /** |
| 29 | * The username to log in to the switch. |
| 30 | * |
| 31 | * @return the user name |
| 32 | */ |
| 33 | String username(); |
| 34 | |
| 35 | /** |
| 36 | * The password to log in to the switch. |
| 37 | * |
| 38 | * @return the password |
| 39 | */ |
| 40 | String password(); |
| 41 | |
| 42 | /** |
| 43 | * The target identifier (TID) of the device. |
| 44 | * |
| 45 | * @return the tid |
| 46 | */ |
| 47 | String tid(); |
| 48 | |
| 49 | /** |
| 50 | * Check if the switch is connected. |
| 51 | * |
| 52 | * @return true if connected, false otherwise |
| 53 | */ |
| 54 | boolean isConnected(); |
| 55 | |
| 56 | /** |
| 57 | * Returns the netty channel of the switch. |
| 58 | * |
| 59 | * @return the netty channel, null if disconnected |
| 60 | */ |
| 61 | Channel channel(); |
| 62 | |
| 63 | /** |
| 64 | * Connects the switch to the channel. |
| 65 | * @param channel the channel |
| 66 | */ |
| 67 | void connect(Channel channel); |
| 68 | |
| 69 | /** |
| 70 | * Disconnects the switch from its channel. |
| 71 | */ |
| 72 | void disconnect(); |
| 73 | } |