Class FeatureFunction


  • public abstract class FeatureFunction
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected Feature feature  
    • 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 accepted
      void setCallable​(boolean callable)
      Makes this function callable from other features.
      void setFeature​(Feature feature)
      This method is automatically called by Feature.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)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • feature

        protected Feature feature
    • Constructor Detail

      • FeatureFunction

        protected FeatureFunction​(java.lang.String functionName)
    • Method Detail

      • isWritable

        public boolean isWritable()
      • setWritable

        public void setWritable​(boolean writable,
                                boolean partial)
        Makes this function writable for other features. Without setting writable to true this function will deny all write requests.
        Parameters:
        writable - true if this function provides write functionality
        partial - 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 to true this function will deny all read requests.
        Parameters:
        readable - true if this function provides read functionality
        partial - 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 to true 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 null
        sourceAddress - 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 exchange
        sourceAddress - 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)