blob: 81860f35915c1be09febb9eaa8b0fa06ca6c46e9 [file] [log] [blame]
Andrea Campanella945ded22016-01-07 13:17:43 -08001/*
2 * Copyright 2016 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 */
16
17package org.onosproject.protocol.rest;
18
19import org.onlab.packet.IpAddress;
20import org.onosproject.net.DeviceId;
21
22/**
23 * Represents an abstraction of a Rest Device in ONOS.
24 */
25public interface RestSBDevice {
26 /**
27 * Returns the ip of this device.
28 *
29 * @return ip
30 */
31 IpAddress ip();
32
33 /**
34 * Returns the password of this device.
35 *
36 * @return port
37 */
38 int port();
39
40 /**
Andrea Campanella784ee0f2016-02-17 15:50:59 -080041 * Returns the username of this device.
Andrea Campanella945ded22016-01-07 13:17:43 -080042 *
Andrea Campanella784ee0f2016-02-17 15:50:59 -080043 * @return username
Andrea Campanella945ded22016-01-07 13:17:43 -080044 */
Andrea Campanella784ee0f2016-02-17 15:50:59 -080045 String username();
Andrea Campanella945ded22016-01-07 13:17:43 -080046
47 /**
48 * Returns the password of this device.
49 *
50 * @return password
51 */
52 String password();
53
54 /**
55 * Returns the ONOS deviceID for this device.
56 *
57 * @return DeviceId
58 */
59 DeviceId deviceId();
60
61 /**
62 * Sets or unsets the state of the device.
63 *
64 * @param active boolean
65 */
66 void setActive(boolean active);
67
68 /**
69 * Returns the state of this device.
70 *
71 * @return state
72 */
73 boolean isActive();
74
75 /**
76 * Returns the protocol for the REST request, usually HTTP o HTTPS.
77 *
78 * @return protocol
79 */
80 String protocol();
81
Andrea Campanella2947e622016-01-27 09:23:46 -080082 /**
83 * Returns the url for the REST requests, to be used instead of IP and PORT.
84 *
85 * @return url
86 */
87 String url();
Andrea Campanella945ded22016-01-07 13:17:43 -080088}