blob: bacbbfec1633e5a3c77d4ecc81ca36592f354969 [file] [log] [blame]
Andrea Campanella945ded22016-01-07 13:17:43 -08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Andrea Campanella945ded22016-01-07 13:17:43 -08003 *
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
Michele Santuaric372c222017-01-12 09:41:25 +010022import java.util.Optional;
23
Andrea Campanella945ded22016-01-07 13:17:43 -080024/**
25 * Represents an abstraction of a Rest Device in ONOS.
26 */
27public interface RestSBDevice {
28 /**
29 * Returns the ip of this device.
30 *
31 * @return ip
32 */
33 IpAddress ip();
34
35 /**
36 * Returns the password of this device.
37 *
38 * @return port
39 */
40 int port();
41
42 /**
Andrea Campanella784ee0f2016-02-17 15:50:59 -080043 * Returns the username of this device.
Andrea Campanella945ded22016-01-07 13:17:43 -080044 *
Andrea Campanella784ee0f2016-02-17 15:50:59 -080045 * @return username
Andrea Campanella945ded22016-01-07 13:17:43 -080046 */
Andrea Campanella784ee0f2016-02-17 15:50:59 -080047 String username();
Andrea Campanella945ded22016-01-07 13:17:43 -080048
49 /**
50 * Returns the password of this device.
51 *
52 * @return password
53 */
54 String password();
55
56 /**
57 * Returns the ONOS deviceID for this device.
58 *
59 * @return DeviceId
60 */
61 DeviceId deviceId();
62
63 /**
64 * Sets or unsets the state of the device.
65 *
66 * @param active boolean
67 */
68 void setActive(boolean active);
69
70 /**
71 * Returns the state of this device.
72 *
73 * @return state
74 */
75 boolean isActive();
76
77 /**
78 * Returns the protocol for the REST request, usually HTTP o HTTPS.
79 *
80 * @return protocol
81 */
82 String protocol();
83
Andrea Campanella2947e622016-01-27 09:23:46 -080084 /**
85 * Returns the url for the REST requests, to be used instead of IP and PORT.
86 *
87 * @return url
88 */
89 String url();
Michele Santuaric372c222017-01-12 09:41:25 +010090
91 /**
92 * Returns the proxy state of this device
93 * (if true, the device is proxying multiple ONOS devices).
94 * @return proxy state
95 */
96 boolean isProxy();
97
98 /**
99 * Returns the url for the REST TEST requests.
100 *
101 * @return testUrl
102 */
103 Optional<String> testUrl();
104
105 /**
106 * The manufacturer of the rest device.
107 *
108 * @return the name of the manufacturer
109 */
110 Optional<String> manufacturer();
111
112 /**
113 * The hardware version of the rest device.
114 *
115 * @return the hardware version
116 */
117 Optional<String> hwVersion();
118
119 /**
120 * The software version of rest device.
121 *
122 * @return the software version.
123 */
124 Optional<String> swVersion();
Andrea Campanella945ded22016-01-07 13:17:43 -0800125}