Package org.openmuc.jeebus.spine.api
Interface NodeManagement
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddDeviceListener(DeviceListener deviceListener)Adds a listener which will get notified when the communication protocol detects a new device.voidaddUseCaseListener(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.java.lang.IntegercreateInterfaceGroup()Creates a new interface group which communication addresses can be assigned to.java.util.concurrent.CompletableFuture<RequestResult>getFullDeviceInformationRequest(java.lang.String communicationAddress)Executes a detailed discovery on the remote device.java.util.concurrent.CompletableFuture<RequestResult>getFullUseCaseInformationRequest(java.lang.String communicationAddress, java.lang.String deviceAddress)Reads supported UseCases of a remote devicejava.util.concurrent.CompletableFuture<RequestResult>getNodeManagementSubscriptionRequest(java.lang.String communicationAddress, java.lang.String deviceAddress, SpineSubscription listener)voidmapAddressToCommunication(java.lang.String communicationAddress, java.lang.Integer communicationInterface)Assigns the given address to the given communication interface.voidnotifyDisconnect(org.openmuc.jeebus.ship.api.DisconnectReason disconnectReason, org.openmuc.jeebus.ship.api.ShipConnectionInterface shipConnectionInterface)voidremoveAddressMapping(java.lang.String communicationAddress)Unmap the current communication interface from the given communication address.java.util.concurrent.CompletableFuture<RequestResult>requestBindingData(java.lang.String deviceId)Reads the binding data the remote device registered with this device.java.util.concurrent.CompletableFuture<RequestResult>requestDestinationListData(java.lang.String deviceId)Returns the destination list data of the remote device.java.util.concurrent.CompletableFuture<RequestResult>requestSubscriptionData(java.lang.String deviceId)Reads the subscription data the remote device registered with this device.voidstartDiscovery(java.lang.String communicationAddress)Starts the automatic discovery process on the given communication address.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.-
Methods inherited from interface org.openmuc.jeebus.spine.api.Feature
addBindingListener, addFunction, getAddress, getDescription, getDevice, getLabel, getRole, getType, hasDescription, hasLabel, notifySubscribers, notifySubscribers, releaseBoundClient, releaseBoundServer, releaseSubscriber, releaseSubscription, requestBind, requestRead, requestSubscription, requestWrite, shutdown
-
-
-
-
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 withgetFullDeviceInformationRequest(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 founduseCase- the use case to listen foractor- the use case actor to listen forscenarioRequirements- 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 devicecommunicationAddress- 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 returnedCompletableFutureis completed with aSpineExceptionon failure.- Parameters:
deviceId- the SPINE device address part of the remote device- Returns:
- a
CompletableFuturewhich 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 returnedCompletableFutureis completed with aSpineExceptionon failure.- Parameters:
deviceId- the SPINE device address part of the remote device- Returns:
- a
CompletableFuturewhich 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 returnedCompletableFutureis completed with aSpineExceptionon failure.- Parameters:
deviceId- the SPINE device address part of the remote device- Returns:
- a
CompletableFuturewhich 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 returnedCompletableFutureis completed with aSpineExceptionon failure. If notifyFullRead istrueafter 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 devicesubscription- the subscription which will be called with notificationsnotifyFullRead- true if a full read should be executed after successfully subscribing- Returns:
- a
CompletableFuturewhich 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 withcreateInterfaceGroup(). This method has no effect when enhanced communication mode is disabled.- Parameters:
communicationAddress- the communication address which will be mapped to the communication interfacecommunicationInterface- the communication interface received withcreateInterfaceGroup()
-
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)
-
-