Package org.onosproject.protocol.rest
Class DefaultRestSBDevice
- java.lang.Object
-
- org.onosproject.protocol.rest.DefaultRestSBDevice
-
- All Implemented Interfaces:
RestSBDevice
public class DefaultRestSBDevice extends java.lang.Object implements RestSBDevice
Default implementation for Rest devices.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.onosproject.protocol.rest.RestSBDevice
RestSBDevice.AuthenticationScheme
-
-
Constructor Summary
Constructors Constructor Description DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive)DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive, java.lang.String testUrl, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, boolean isProxy, RestSBDevice.AuthenticationScheme authenticationScheme, java.lang.String token)DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive, java.lang.String testUrl, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, RestSBDevice.AuthenticationScheme authenticationScheme, java.lang.String token)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RestSBDevice.AuthenticationSchemeauthentication()The authentication scheme of rest device.org.onosproject.net.DeviceIddeviceId()Returns the ONOS deviceID for this device.booleanequals(java.lang.Object obj)inthashCode()java.util.Optional<java.lang.String>hwVersion()The hardware version of the rest device.org.onlab.packet.IpAddressip()Returns the ip of this device.booleanisActive()Returns the state of this device.booleanisProxy()Returns the proxy state of this device (if true, the device is proxying multiple ONOS devices).java.util.Optional<java.lang.String>manufacturer()The manufacturer of the rest device.java.lang.Stringpassword()Returns the password of this device.intport()Returns the port of this device.java.lang.Stringprotocol()Returns the protocol for the REST request, usually HTTP o HTTPS.voidsetActive(boolean active)Sets or unsets the state of the device.java.util.Optional<java.lang.String>swVersion()The software version of rest device.java.util.Optional<java.lang.String>testUrl()Returns the url for the REST TEST requests.java.lang.Stringtoken()The access token of rest device if authentication is OAuth2.java.lang.StringtoString()java.lang.Stringurl()Returns the url for the REST requests, to be used instead of IP and PORT.java.lang.Stringusername()Returns the username of this device.
-
-
-
Constructor Detail
-
DefaultRestSBDevice
public DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive)
-
DefaultRestSBDevice
public DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive, java.lang.String testUrl, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, RestSBDevice.AuthenticationScheme authenticationScheme, java.lang.String token)
-
DefaultRestSBDevice
public DefaultRestSBDevice(org.onlab.packet.IpAddress ip, int port, java.lang.String name, java.lang.String password, java.lang.String protocol, java.lang.String url, boolean isActive, java.lang.String testUrl, java.lang.String manufacturer, java.lang.String hwVersion, java.lang.String swVersion, boolean isProxy, RestSBDevice.AuthenticationScheme authenticationScheme, java.lang.String token)
-
-
Method Detail
-
ip
public org.onlab.packet.IpAddress ip()
Description copied from interface:RestSBDeviceReturns the ip of this device.- Specified by:
ipin interfaceRestSBDevice- Returns:
- ip
-
port
public int port()
Description copied from interface:RestSBDeviceReturns the port of this device.- Specified by:
portin interfaceRestSBDevice- Returns:
- port
-
username
public java.lang.String username()
Description copied from interface:RestSBDeviceReturns the username of this device.- Specified by:
usernamein interfaceRestSBDevice- Returns:
- username
-
password
public java.lang.String password()
Description copied from interface:RestSBDeviceReturns the password of this device.- Specified by:
passwordin interfaceRestSBDevice- Returns:
- password
-
deviceId
public org.onosproject.net.DeviceId deviceId()
Description copied from interface:RestSBDeviceReturns the ONOS deviceID for this device.- Specified by:
deviceIdin interfaceRestSBDevice- Returns:
- DeviceId
-
setActive
public void setActive(boolean active)
Description copied from interface:RestSBDeviceSets or unsets the state of the device.- Specified by:
setActivein interfaceRestSBDevice- Parameters:
active- boolean
-
isActive
public boolean isActive()
Description copied from interface:RestSBDeviceReturns the state of this device.- Specified by:
isActivein interfaceRestSBDevice- Returns:
- state
-
protocol
public java.lang.String protocol()
Description copied from interface:RestSBDeviceReturns the protocol for the REST request, usually HTTP o HTTPS.- Specified by:
protocolin interfaceRestSBDevice- Returns:
- protocol
-
url
public java.lang.String url()
Description copied from interface:RestSBDeviceReturns the url for the REST requests, to be used instead of IP and PORT.- Specified by:
urlin interfaceRestSBDevice- Returns:
- url
-
isProxy
public boolean isProxy()
Description copied from interface:RestSBDeviceReturns the proxy state of this device (if true, the device is proxying multiple ONOS devices).- Specified by:
isProxyin interfaceRestSBDevice- Returns:
- proxy state
-
testUrl
public java.util.Optional<java.lang.String> testUrl()
Description copied from interface:RestSBDeviceReturns the url for the REST TEST requests.- Specified by:
testUrlin interfaceRestSBDevice- Returns:
- testUrl
-
manufacturer
public java.util.Optional<java.lang.String> manufacturer()
Description copied from interface:RestSBDeviceThe manufacturer of the rest device.- Specified by:
manufacturerin interfaceRestSBDevice- Returns:
- the name of the manufacturer
-
hwVersion
public java.util.Optional<java.lang.String> hwVersion()
Description copied from interface:RestSBDeviceThe hardware version of the rest device.- Specified by:
hwVersionin interfaceRestSBDevice- Returns:
- the hardware version
-
swVersion
public java.util.Optional<java.lang.String> swVersion()
Description copied from interface:RestSBDeviceThe software version of rest device.- Specified by:
swVersionin interfaceRestSBDevice- Returns:
- the software version.
-
authentication
public RestSBDevice.AuthenticationScheme authentication()
Description copied from interface:RestSBDeviceThe authentication scheme of rest device.- Specified by:
authenticationin interfaceRestSBDevice- Returns:
- authentication
-
token
public java.lang.String token()
Description copied from interface:RestSBDeviceThe access token of rest device if authentication is OAuth2.- Specified by:
tokenin interfaceRestSBDevice- Returns:
- token
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-