Class FeatureFunction
- java.lang.Object
-
- org.openmuc.jeebus.spine.spi.function.FeatureFunction
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Shutdownable
- Direct Known Subclasses:
HeartbeatDataFunction,ReadListFeatureFunction,ReadSingleFeatureFunction
public abstract class FeatureFunction extends java.lang.Object implements Shutdownable
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFeatureFunction(java.lang.String functionName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleanbindingRequired()abstract SpineAcknowledgmentcall(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)java.lang.StringgetFunctionName()org.openmuc.jeebus.spine.xsd.v1.FunctionPropertyTypegetFunctionProperty()booleanisCallable()booleanisReadable()booleanisWritable()protected booleanmatchAddress(org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType address, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType addressFilter)abstract org.openmuc.jeebus.spine.xsd.v1.CmdTyperead(org.openmuc.jeebus.spine.xsd.v1.FilterType filter, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)voidrequireBinding()Call this if the function requires binding before write requests are acceptedvoidsetCallable(boolean callable)Makes this function callable from other features.voidsetFeature(Feature feature)This method is automatically called byFeature.addFunction(FeatureFunction).voidsetReadable(boolean readable, boolean partial)Makes this function readable for other features.voidsetWritable(boolean writable, boolean partial)Makes this function writable for other features.abstract SpineAcknowledgmentwrite(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openmuc.jeebus.spine.api.Shutdownable
close
-
-
-
-
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 totruethis 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 totruethis 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 totruethis function will deny all call requests.- Parameters:
callable- true if this function provides call functionality
-
getFunctionProperty
public org.openmuc.jeebus.spine.xsd.v1.FunctionPropertyType getFunctionProperty()
-
getFunctionName
public java.lang.String getFunctionName()
-
read
public abstract org.openmuc.jeebus.spine.xsd.v1.CmdType read(org.openmuc.jeebus.spine.xsd.v1.FilterType filter, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress) throws SpineException- Parameters:
filter- filter for partial read otherwise nullsourceAddress- the feature address of the client feature- Returns:
- an
CmdTypeinstance filled with the requested information - Throws:
SpineException- on invalid filter
-
write
public abstract SpineAcknowledgment write(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress) throws SpineException
- 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
- Throws:
SpineException- if the write command encounters an exception
-
call
public abstract SpineAcknowledgment call(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)
- Parameters:
cmd- the command data belonging to this function callsourceAddress- the feature address of the client feature- Returns:
- an acknowledgment stating the result of the operation
-
matchAddress
protected boolean matchAddress(org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType address, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType addressFilter)
-
-