Class DefaultRestSBDevice

  • All Implemented Interfaces:
    RestSBDevice

    public class DefaultRestSBDevice
    extends java.lang.Object
    implements RestSBDevice
    Default implementation for Rest devices.
    • 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.AuthenticationScheme authentication()
      The authentication scheme of rest device.
      org.onosproject.net.DeviceId deviceId()
      Returns the ONOS deviceID for this device.
      boolean equals​(java.lang.Object obj)  
      int hashCode()  
      java.util.Optional<java.lang.String> hwVersion()
      The hardware version of the rest device.
      org.onlab.packet.IpAddress ip()
      Returns the ip of this device.
      boolean isActive()
      Returns the state of this device.
      boolean isProxy()
      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.String password()
      Returns the password of this device.
      int port()
      Returns the port of this device.
      java.lang.String protocol()
      Returns the protocol for the REST request, usually HTTP o HTTPS.
      void setActive​(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.String token()
      The access token of rest device if authentication is OAuth2.
      java.lang.String toString()  
      java.lang.String url()
      Returns the url for the REST requests, to be used instead of IP and PORT.
      java.lang.String username()
      Returns the username of this device.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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: RestSBDevice
        Returns the ip of this device.
        Specified by:
        ip in interface RestSBDevice
        Returns:
        ip
      • port

        public int port()
        Description copied from interface: RestSBDevice
        Returns the port of this device.
        Specified by:
        port in interface RestSBDevice
        Returns:
        port
      • username

        public java.lang.String username()
        Description copied from interface: RestSBDevice
        Returns the username of this device.
        Specified by:
        username in interface RestSBDevice
        Returns:
        username
      • password

        public java.lang.String password()
        Description copied from interface: RestSBDevice
        Returns the password of this device.
        Specified by:
        password in interface RestSBDevice
        Returns:
        password
      • deviceId

        public org.onosproject.net.DeviceId deviceId()
        Description copied from interface: RestSBDevice
        Returns the ONOS deviceID for this device.
        Specified by:
        deviceId in interface RestSBDevice
        Returns:
        DeviceId
      • setActive

        public void setActive​(boolean active)
        Description copied from interface: RestSBDevice
        Sets or unsets the state of the device.
        Specified by:
        setActive in interface RestSBDevice
        Parameters:
        active - boolean
      • isActive

        public boolean isActive()
        Description copied from interface: RestSBDevice
        Returns the state of this device.
        Specified by:
        isActive in interface RestSBDevice
        Returns:
        state
      • protocol

        public java.lang.String protocol()
        Description copied from interface: RestSBDevice
        Returns the protocol for the REST request, usually HTTP o HTTPS.
        Specified by:
        protocol in interface RestSBDevice
        Returns:
        protocol
      • url

        public java.lang.String url()
        Description copied from interface: RestSBDevice
        Returns the url for the REST requests, to be used instead of IP and PORT.
        Specified by:
        url in interface RestSBDevice
        Returns:
        url
      • isProxy

        public boolean isProxy()
        Description copied from interface: RestSBDevice
        Returns the proxy state of this device (if true, the device is proxying multiple ONOS devices).
        Specified by:
        isProxy in interface RestSBDevice
        Returns:
        proxy state
      • testUrl

        public java.util.Optional<java.lang.String> testUrl()
        Description copied from interface: RestSBDevice
        Returns the url for the REST TEST requests.
        Specified by:
        testUrl in interface RestSBDevice
        Returns:
        testUrl
      • manufacturer

        public java.util.Optional<java.lang.String> manufacturer()
        Description copied from interface: RestSBDevice
        The manufacturer of the rest device.
        Specified by:
        manufacturer in interface RestSBDevice
        Returns:
        the name of the manufacturer
      • hwVersion

        public java.util.Optional<java.lang.String> hwVersion()
        Description copied from interface: RestSBDevice
        The hardware version of the rest device.
        Specified by:
        hwVersion in interface RestSBDevice
        Returns:
        the hardware version
      • swVersion

        public java.util.Optional<java.lang.String> swVersion()
        Description copied from interface: RestSBDevice
        The software version of rest device.
        Specified by:
        swVersion in interface RestSBDevice
        Returns:
        the software version.
      • token

        public java.lang.String token()
        Description copied from interface: RestSBDevice
        The access token of rest device if authentication is OAuth2.
        Specified by:
        token in interface RestSBDevice
        Returns:
        token
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object