Interface NodeManagement

  • All Superinterfaces:
    Feature

    public interface NodeManagement
    extends Feature
    • Method Detail

      • addDeviceListener

        void addDeviceListener​(DeviceListener deviceListener)
        Adds a listener which will get notified when the communication protocol detects a new device. The received address can then be used to get information with getFullDeviceInformationRequest(String).
        When automatic detailed discovery is enabled (DeviceBuilder.withDiscoverDevices(boolean)) the listener will be called also with the device information.
        Parameters:
        deviceListener - the listener which will be notified about detected devices
      • addUseCaseListener

        void addUseCaseListener​(UseCaseListener listener,
                                java.lang.String useCase,
                                java.lang.String actor,
                                java.util.Map<java.lang.Long,​PresenceIndication> scenarioRequirements,
                                java.util.Set<FeatureFunctionRequirement> featureFunctionRequirements)
        Register a new UseCaseListener that is called when a remote device supports the given use case as the given actor.

        If a remote device does not support use case discovery, mandatory functions are calculated using the given requirements to find an entity which supports all mandatory FeatureFunctions for the execution of the use case.

        TODO: Consider use case scenarios

        Parameters:
        listener - the listener to be called when a valid use case partner is found
        useCase - the use case to listen for
        actor - the use case actor to listen for
        scenarioRequirements - The scenarios with presence indicators to filter possible use case partners. In the Use Case Specifications, you can find this information in the "Scenario implementation requirements for Actors" tables.
        featureFunctionRequirements - A set containing all features and functions linked to the scenarios that require their presence. In the Use Case Specifications, you can find this information in the "Feature Types and Functions used within this Use Case" tables.
      • startDiscovery

        void startDiscovery​(java.lang.String communicationAddress)
        Starts the automatic discovery process on the given communication address. This includes full DetailedDiscovery, UseCaseDiscovery and a Subscription to the remote devices NodeManagement.
        Parameters:
        communicationAddress - the communication address of a remote device.
      • getFullDeviceInformationRequest

        java.util.concurrent.CompletableFuture<RequestResult> getFullDeviceInformationRequest​(java.lang.String communicationAddress)
        Executes a detailed discovery on the remote device. A successful discovery automatically maps the discovered SPINE device address to its corresponding communication address.
        Parameters:
        communicationAddress - the communication address of the remote device, i.e. not the SPINE device address
        Returns:
        a CompletableFuture which is completed with the answer
      • getFullUseCaseInformationRequest

        java.util.concurrent.CompletableFuture<RequestResult> getFullUseCaseInformationRequest​(java.lang.String communicationAddress,
                                                                                               java.lang.String deviceAddress)
        Reads supported UseCases of a remote device
        Parameters:
        deviceAddress - the SPINE device address part of the remote device
        communicationAddress - the communication address of the remote device, i.e. not the SPINE device address
        Returns:
        a CompletableFuture which is completed with the answer
      • getNodeManagementSubscriptionRequest

        java.util.concurrent.CompletableFuture<RequestResult> getNodeManagementSubscriptionRequest​(java.lang.String communicationAddress,
                                                                                                   java.lang.String deviceAddress,
                                                                                                   SpineSubscription listener)
      • requestSubscriptionData

        java.util.concurrent.CompletableFuture<RequestResult> requestSubscriptionData​(java.lang.String deviceId)
        Reads the subscription data the remote device registered with this device. The returned CompletableFuture is completed with a SpineException on failure.
        Parameters:
        deviceId - the SPINE device address part of the remote device
        Returns:
        a CompletableFuture which is completed with the answer
      • requestBindingData

        java.util.concurrent.CompletableFuture<RequestResult> requestBindingData​(java.lang.String deviceId)
        Reads the binding data the remote device registered with this device. The returned CompletableFuture is completed with a SpineException on failure.
        Parameters:
        deviceId - the SPINE device address part of the remote device
        Returns:
        a CompletableFuture which is completed with the answer
      • requestDestinationListData

        java.util.concurrent.CompletableFuture<RequestResult> requestDestinationListData​(java.lang.String deviceId)
        Returns the destination list data of the remote device. The returned CompletableFuture is completed with a SpineException on failure.
        Parameters:
        deviceId - the SPINE device address part of the remote device
        Returns:
        a CompletableFuture which is completed with the answer
      • subscribeDestinationListData

        java.util.concurrent.CompletableFuture<RequestResult> subscribeDestinationListData​(java.lang.String deviceId,
                                                                                           SpineSubscription subscription,
                                                                                           boolean notifyFullRead)
        Subscribes to the destination list data function of the remote device. The returned CompletableFuture is completed with a SpineException on failure. If notifyFullRead is true after a successful subscription a full read is executed on the destination list data function. The reply is then passed to the subscription as a notification. This means notification until the read reply is received can be ignored.
        Parameters:
        deviceId - the SPINE device address part of the remote device
        subscription - the subscription which will be called with notifications
        notifyFullRead - true if a full read should be executed after successfully subscribing
        Returns:
        a CompletableFuture which is completed with the answer
      • mapAddressToCommunication

        void mapAddressToCommunication​(java.lang.String communicationAddress,
                                       java.lang.Integer communicationInterface)
        Assigns the given address to the given communication interface. The communicationInterface parameter can be retrieved with createInterfaceGroup(). This method has no effect when enhanced communication mode is disabled.
        Parameters:
        communicationAddress - the communication address which will be mapped to the communication interface
        communicationInterface - the communication interface received with createInterfaceGroup()
      • createInterfaceGroup

        java.lang.Integer createInterfaceGroup()
        Creates a new interface group which communication addresses can be assigned to. The destination list data function can then filter the destination list to only contain destinations on different interfaces than the sender. This method has no effect when enhanced communication mode is disabled.
        Returns:
        the unique id of the newly created group
      • removeAddressMapping

        void removeAddressMapping​(java.lang.String communicationAddress)
        Unmap the current communication interface from the given communication address.
        Parameters:
        communicationAddress - the communication address which should be unmapped from the current communication interface
      • notifyDisconnect

        void notifyDisconnect​(org.openmuc.jeebus.ship.api.DisconnectReason disconnectReason,
                              org.openmuc.jeebus.ship.api.ShipConnectionInterface shipConnectionInterface)