blob: 71dc01eaf24175ec544767cb7a5834dfa407694b [file] [log] [blame]
Marc De Leenheer57a5af02016-12-02 20:54:41 -08001/*
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.tl1;
17
18import com.google.common.annotations.Beta;
19import io.netty.channel.Channel;
20import org.onlab.packet.IpAddress;
21
22@Beta
23public 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}