Class DeviceBuilder


  • public class DeviceBuilder
    extends java.lang.Object
    • Constructor Detail

      • DeviceBuilder

        public DeviceBuilder()
    • Method Detail

      • setId

        public DeviceBuilder setId​(java.lang.String id)
        Sets the device address of the new SPINE device. This must be a unique address with the following pattern: d:_(i:[1-9][0-9]*|n:[a-zA-Z0-9-]+)_[^\p{Cc}\p{Cf}\p{Z}]+ see Chapter 7.1.1.1 in the Protocol Specification for more details.
        This method must be called before calling build()!
        Parameters:
        id - the device address identifying this unique SPINE device
        Returns:
        the updated DeviceBuilder
      • setDeviceType

        public DeviceBuilder setDeviceType​(org.eebus.docs.spine.xsd.v1.DeviceTypeEnumType deviceType)
        This method must be called before calling build()!
        Parameters:
        deviceType - the type of the SPINE device
        Returns:
        the updated DeviceBuilder
      • setCommunication

        public DeviceBuilder setCommunication​(Communication communication)
        This method must be called before calling build()!
        Parameters:
        communication - the communication protocol to use
        Returns:
        the updated DeviceBuilder
      • setDiscoverDevices

        public DeviceBuilder setDiscoverDevices​(boolean discoverDevices)
        Enables the automatic DetailedDiscovery of newly discovered SPINE devices. If disabled (default) the DetailedDiscovery must be executed manually via NodeManagement
        Parameters:
        discoverDevices - true if DetailedDiscovery should be started automatically, false otherwise
        Returns:
        the updated DeviceBuilder
      • addEntity

        public EntityBuilder addEntity()
        Creates a new EntityBuilder instance. The entity can then be fluently added to this device with EntityBuilder.applyToDevice().
        Returns:
        a new EntityBuilder instance
      • setDescription

        public DeviceBuilder setDescription​(java.lang.String description)
        Parameters:
        description - a string describing the new SPINE device
        Returns:
        the updated DeviceBuilder
      • setLabel

        public DeviceBuilder setLabel​(java.lang.String label)
        Parameters:
        label - a human-readable alias of the new SPINE device
        Returns:
        the updated DeviceBuilder
      • setAcknowledgmentEnabled

        public DeviceBuilder setAcknowledgmentEnabled​(boolean acknowledgmentEnabled)
        Parameters:
        acknowledgmentEnabled - true if acknowledgment messages shall be requested, false otherwise
        Returns:
        the updated DeviceBuilder
      • setCommunicationMode

        public DeviceBuilder setCommunicationMode​(org.eebus.docs.spine.xsd.v1.NetworkManagementFeatureSetType mode)
        Controls if the device should support the enhanced communication mode, i.e. can forward messages.NetworkManagementFeatureSetType.SIMPLE means no forwarding is possible and is the default. With every other value this device maintains a list with known SPINE devices and is able to forward messages to them.
        Parameters:
        mode - the NetworkFeatureSet as which the device acts
        Returns:
        the updated DeviceBuilder
      • setAutomaticDestinationListDetection

        public DeviceBuilder setAutomaticDestinationListDetection​(boolean enabled)
      • addUseCase

        public DeviceBuilder addUseCase​(UseCase useCase)
        Adds the passed SPINE use case to this device. The use case is executed when this device is built.
        Parameters:
        useCase - the SPINE use case this device supports
        Returns:
        the updated DeviceBuilder
      • getLastAddedEntityAddress

        public org.eebus.docs.spine.xsd.v1.EntityAddressType getLastAddedEntityAddress()
        Returns:
        the entity address of the last added entity