Package org.openmuc.eebus.spine.spi
Class FeatureFunction
- java.lang.Object
-
- org.openmuc.eebus.spine.spi.FeatureFunction
-
public abstract class FeatureFunction extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FeatureFunction(java.lang.String functionName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
bindingRequired()
abstract SpineAcknowledgment
call(org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
java.lang.String
getFunctionName()
org.eebus.docs.spine.xsd.v1.FunctionPropertyType
getFunctionProperty()
boolean
isCallable()
boolean
isReadable()
boolean
isWritable()
protected boolean
matchAddress(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureAddressType addressFilter)
abstract org.eebus.docs.spine.xsd.v1.CmdType
read(org.eebus.docs.spine.xsd.v1.FilterType filter, org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
void
requireBinding()
Call this if the function requires binding before write requests are acceptedvoid
setCallable(boolean callable)
Makes this function callable from other features.void
setFeature(Feature feature)
This method is automatically called byFeature.addFunction(FeatureFunction)
.void
setReadable(boolean readable, boolean partial)
Makes this function readable for other features.void
setWritable(boolean writable, boolean partial)
Makes this function writable for other features.abstract SpineAcknowledgment
write(org.eebus.docs.spine.xsd.v1.CmdType cmd, org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
-
-
-
Field Detail
-
feature
protected Feature feature
-
-
Method Detail
-
setFeature
public void setFeature(Feature feature)
This method is automatically called byFeature.addFunction(FeatureFunction)
.- Parameters:
feature
- the SPINE feature this function belongs to
-
isWritable
public boolean isWritable()
-
setWritable
public void setWritable(boolean writable, boolean partial)
Makes this function writable for other features. Without setting writable totrue
this function will deny all write requests.- Parameters:
writable
- true if this function provides write functionalitypartial
- true if the write function supports restricted function exchange
-
requireBinding
public void requireBinding()
Call this if the function requires binding before write requests are accepted
-
bindingRequired
public boolean bindingRequired()
-
isReadable
public boolean isReadable()
-
setReadable
public void setReadable(boolean readable, boolean partial)
Makes this function readable for other features. Without setting readable totrue
this function will deny all read requests.- Parameters:
readable
- true if this function provides read functionalitypartial
- true if the read function supports restricted function exchange
-
isCallable
public boolean isCallable()
-
setCallable
public void setCallable(boolean callable)
Makes this function callable from other features. Without setting callable totrue
this function will deny all call requests.- Parameters:
callable
- true if this function provides call functionality
-
getFunctionProperty
public org.eebus.docs.spine.xsd.v1.FunctionPropertyType getFunctionProperty()
-
getFunctionName
public java.lang.String getFunctionName()
-
read
public abstract org.eebus.docs.spine.xsd.v1.CmdType read(org.eebus.docs.spine.xsd.v1.FilterType filter, org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
- Parameters:
filter
- filter for partial read otherwise nullsourceAddress
- the feature address of the client feature- Returns:
- an
CmdType
instance filled with the requested information
-
write
public abstract SpineAcknowledgment write(org.eebus.docs.spine.xsd.v1.CmdType cmd, org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
- Parameters:
cmd
- to be written data including optional filters for restricted function exchangesourceAddress
- the feature address of the client feature- Returns:
- an acknowledgment stating the result of the operation
-
call
public abstract SpineAcknowledgment call(org.eebus.docs.spine.xsd.v1.FeatureAddressType sourceAddress)
-
matchAddress
protected boolean matchAddress(org.eebus.docs.spine.xsd.v1.FeatureAddressType address, org.eebus.docs.spine.xsd.v1.FeatureAddressType addressFilter)
-
-