Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -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 | |
| 17 | package org.onosproject.protocol.rest; |
| 18 | |
| 19 | import org.onlab.packet.IpAddress; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | |
Michele Santuari | c372c22 | 2017-01-12 09:41:25 +0100 | [diff] [blame^] | 22 | import java.util.Optional; |
| 23 | |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 24 | /** |
| 25 | * Represents an abstraction of a Rest Device in ONOS. |
| 26 | */ |
| 27 | public 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 Campanella | 784ee0f | 2016-02-17 15:50:59 -0800 | [diff] [blame] | 43 | * Returns the username of this device. |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 44 | * |
Andrea Campanella | 784ee0f | 2016-02-17 15:50:59 -0800 | [diff] [blame] | 45 | * @return username |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 46 | */ |
Andrea Campanella | 784ee0f | 2016-02-17 15:50:59 -0800 | [diff] [blame] | 47 | String username(); |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 48 | |
| 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 Campanella | 2947e62 | 2016-01-27 09:23:46 -0800 | [diff] [blame] | 84 | /** |
| 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 Santuari | c372c22 | 2017-01-12 09:41:25 +0100 | [diff] [blame^] | 90 | |
| 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 Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 125 | } |