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 | |
| 22 | /** |
| 23 | * Represents an abstraction of a Rest Device in ONOS. |
| 24 | */ |
| 25 | public 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 Campanella | 784ee0f | 2016-02-17 15:50:59 -0800 | [diff] [blame] | 41 | * Returns the username of this device. |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 42 | * |
Andrea Campanella | 784ee0f | 2016-02-17 15:50:59 -0800 | [diff] [blame] | 43 | * @return username |
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 | String username(); |
Andrea Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 46 | |
| 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 Campanella | 2947e62 | 2016-01-27 09:23:46 -0800 | [diff] [blame] | 82 | /** |
| 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 Campanella | 945ded2 | 2016-01-07 13:17:43 -0800 | [diff] [blame] | 88 | } |