Class DefaultDevice

    • Constructor Detail

      • DefaultDevice

        public DefaultDevice​(ProviderId providerId,
                             DeviceId id,
                             Device.Type type,
                             String manufacturer,
                             String hwVersion,
                             String swVersion,
                             String serialNumber,
                             ChassisId chassisId,
                             Annotations... annotations)
        Creates a network element attributed to the specified provider.
        Parameters:
        providerId - identity of the provider
        id - device identifier
        type - device type
        manufacturer - device manufacturer
        hwVersion - device HW version
        swVersion - device SW version
        serialNumber - device serial number
        chassisId - chassis id
        annotations - optional key/value annotations
    • Method Detail

      • id

        public DeviceId id()
        Description copied from interface: Device
        Returns the device identifier.
        Specified by:
        id in interface Device
        Specified by:
        id in interface Element
        Returns:
        device id
      • type

        public Device.Type type()
        Description copied from interface: Device
        Returns the type of the infrastructure device.
        Specified by:
        type in interface Device
        Returns:
        type of the device
      • manufacturer

        public String manufacturer()
        Description copied from interface: Device
        Returns the device manufacturer name.
        Specified by:
        manufacturer in interface Device
        Returns:
        manufacturer name
      • hwVersion

        public String hwVersion()
        Description copied from interface: Device
        Returns the device hardware version.
        Specified by:
        hwVersion in interface Device
        Returns:
        hardware version
      • swVersion

        public String swVersion()
        Description copied from interface: Device
        Returns the device software version.
        Specified by:
        swVersion in interface Device
        Returns:
        software version
      • serialNumber

        public String serialNumber()
        Description copied from interface: Device
        Returns the device serial number.
        Specified by:
        serialNumber in interface Device
        Returns:
        serial number
      • chassisId

        public ChassisId chassisId()
        Description copied from interface: Device
        Returns the device chassis id.
        Specified by:
        chassisId in interface Device
        Returns:
        chassis id
      • as

        public <B extends Behaviour> B as​(Class<B> projectionClass)
        Description copied from interface: Projectable
        Returns the specified projection of this entity if such projection is supported.
        Specified by:
        as in interface Projectable
        Overrides:
        as in class AbstractProjectableModel
        Type Parameters:
        B - type of behaviour
        Parameters:
        projectionClass - requested projection class
        Returns:
        projection instance
      • locateDriver

        protected Driver locateDriver()
        Description copied from class: AbstractProjectableModel
        Locates the driver to be used by this entity.

        The default implementation derives the driver based on the driver annotation value.

        Overrides:
        locateDriver in class AbstractProjectableModel
        Returns:
        driver for alternate projections of this model entity or null if no driver is expected or driver is not found
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object