Package org.openmuc.eebus.spine.api
Interface Feature
-
- All Known Subinterfaces:
NodeManagement
public interface Feature
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addFunction(FeatureFunction function)
Adds the passed SPINE function to the feature.org.eebus.docs.spine.xsd.v1.FeatureAddressType
getAddress()
Returns the address of this feature relative to the parent device.static FeatureBuilder
getBuilder()
The returned builder builds a SPINE feature which can be added to an existing SPINE entity at runtime withEntity.addFeature(Feature)
.java.lang.String
getDescription()
Device
getDevice()
java.lang.String
getLabel()
org.eebus.docs.spine.xsd.v1.RoleType
getRole()
org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType
getType()
boolean
hasDescription()
boolean
hasLabel()
void
notifySubscribers(org.eebus.docs.spine.xsd.v1.CmdType cmd)
Notifies subscribers of this SPINE feature that data contained in the given command has changed.void
notifySubscribers(org.eebus.docs.spine.xsd.v1.FunctionEnumType function, org.eebus.docs.spine.xsd.v1.FilterType filter)
Notifies subscribers of this SPINE feature that data contained in the given SPINE function has changed.void
releaseBoundClient(org.eebus.docs.spine.xsd.v1.FeatureAddressType clientAddress)
Releases the binding of the client feature located at the given address to this feature.void
releaseBoundServer(org.eebus.docs.spine.xsd.v1.FeatureAddressType serverAddress)
Releases the binding of this feature to the server feature located at the given address.void
releaseSubscriber(org.eebus.docs.spine.xsd.v1.FeatureAddressType clientAddress)
Releases the subscription of the client feature located at the given address to this feature.void
releaseSubscription(org.eebus.docs.spine.xsd.v1.FeatureAddressType serverAddress)
Releases the subscription of this feature to the server feature located at the given address.java.util.concurrent.CompletableFuture<RequestResult>
requestBind(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType featureType)
Sends a binding request to the remote feature located at the given address.java.util.concurrent.CompletableFuture<RequestResult>
requestRead(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.CmdType cmd)
Sends a read request to the remote feature located at the given address.java.util.concurrent.CompletableFuture<RequestResult>
requestSubscription(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType featureType, SpineSubscription subscription)
Sends a subscription request to the remote feature located at the given address.java.util.concurrent.CompletableFuture<RequestResult>
requestWrite(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.CmdType cmd)
Sends a write request to the remote feature located at the given address.
-
-
-
Method Detail
-
getBuilder
static FeatureBuilder getBuilder()
The returned builder builds a SPINE feature which can be added to an existing SPINE entity at runtime withEntity.addFeature(Feature)
.
This method shall not be used to set up an entity which was not added to a device yet. For this purposeEntityBuilder.addFeature()
shall be used.- Returns:
- a new
FeatureBuilder
object to create a new SPINE feature
-
getRole
org.eebus.docs.spine.xsd.v1.RoleType getRole()
- Returns:
- the role of this feature
-
getLabel
java.lang.String getLabel()
- Returns:
- the label set or the empty string if no label was set
-
hasLabel
boolean hasLabel()
- Returns:
- true if this feature has a label set and false otherwise
-
getDescription
java.lang.String getDescription()
- Returns:
- the description set or the empty string if no description was set
-
hasDescription
boolean hasDescription()
- Returns:
- true if this feature has a description set and false otherwise
-
addFunction
void addFunction(FeatureFunction function)
Adds the passed SPINE function to the feature. After the function was added theNodeManagement
instance notifies subscribers about the change.- Parameters:
function
- the SPINE function to add
-
getDevice
Device getDevice()
- Returns:
- the device this feature belongs to
-
requestRead
java.util.concurrent.CompletableFuture<RequestResult> requestRead(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.CmdType cmd)
Sends a read request to the remote feature located at the given address. The returnedCompletableFuture
is completed with the replied datagram on success and completed with aSpineException
on failure.- Parameters:
address
- the address of the remote feature which shall be readcmd
- the command containing the to be read function and optional filter- Returns:
- a
CompletableFuture
which is completed with the answer
-
requestWrite
java.util.concurrent.CompletableFuture<RequestResult> requestWrite(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.CmdType cmd)
Sends a write request to the remote feature located at the given address. The returnedCompletableFuture
is completed with the replied acknowledgment datagram on success and completed with aSpineException
on failure.- Parameters:
address
- the address of the remote feature which shall be written tocmd
- the command containing the to be written information and optional filter- Returns:
- a
CompletableFuture
which is completed with the answer
-
requestSubscription
java.util.concurrent.CompletableFuture<RequestResult> requestSubscription(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType featureType, SpineSubscription subscription)
Sends a subscription request to the remote feature located at the given address. The returnedCompletableFuture
is completed with the replied acknowledgment datagram on success and completed with aSpineException
on failure.- Parameters:
address
- the address of the remote feature which shall be subscribed tofeatureType
- the type of the remote featuresubscription
- the subscription which will be called with notifications- Returns:
- a
CompletableFuture
which is completed with the acknowledgment
-
requestBind
java.util.concurrent.CompletableFuture<RequestResult> requestBind(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType featureType)
Sends a binding request to the remote feature located at the given address. The returnedCompletableFuture
is completed with the replied acknowledgment datagram on success and completed with aSpineException
on failure.- Parameters:
address
- the address of the remote feature which shall be boundfeatureType
- the type of the remote feature- Returns:
- a
CompletableFuture
which is completed with the acknowledgment
-
releaseSubscription
void releaseSubscription(org.eebus.docs.spine.xsd.v1.FeatureAddressType serverAddress)
Releases the subscription of this feature to the server feature located at the given address.- Parameters:
serverAddress
- the address of the server feature which this client is subscribed to
-
releaseSubscriber
void releaseSubscriber(org.eebus.docs.spine.xsd.v1.FeatureAddressType clientAddress)
Releases the subscription of the client feature located at the given address to this feature.- Parameters:
clientAddress
- the address of the client feature which is subscribed to this feature
-
releaseBoundClient
void releaseBoundClient(org.eebus.docs.spine.xsd.v1.FeatureAddressType clientAddress)
Releases the binding of the client feature located at the given address to this feature.- Parameters:
clientAddress
- the address of the client feature which is bound to this feature
-
releaseBoundServer
void releaseBoundServer(org.eebus.docs.spine.xsd.v1.FeatureAddressType serverAddress)
Releases the binding of this feature to the server feature located at the given address.- Parameters:
serverAddress
- the address of the server feature which this client is bound to
-
notifySubscribers
void notifySubscribers(org.eebus.docs.spine.xsd.v1.FunctionEnumType function, org.eebus.docs.spine.xsd.v1.FilterType filter)
Notifies subscribers of this SPINE feature that data contained in the given SPINE function has changed.
The passed filter should be equivalent to a filter of a partial read on the function, which would return only the changed data. If the filter isnull
the notification sends all function data.- Parameters:
function
- the SPINE function on which a change occurredfilter
- the filter with which a partial read on the feature returns the changed data
-
notifySubscribers
void notifySubscribers(org.eebus.docs.spine.xsd.v1.CmdType cmd)
Notifies subscribers of this SPINE feature that data contained in the given command has changed. This method should be used, if partial notifications should be possible but partial read is not implemented at the related FeatureFunction or if data was deleted.- Parameters:
cmd
- the complete notification command including the filter on restricted function exchange
-
getAddress
org.eebus.docs.spine.xsd.v1.FeatureAddressType getAddress()
Returns the address of this feature relative to the parent device.
The list returned byEntityAddressType.getEntity()
contains the address parts of all entity parents in order- Returns:
- the feature address
-
getType
org.eebus.docs.spine.xsd.v1.FeatureTypeEnumType getType()
- Returns:
- the type of this feature
-
-