Class ReadSingleFeatureFunction<DATA,​ELEMENTS,​TYPE extends DataFeatureFunctionTypeInfo<DATA,​ELEMENTS>>

    • Field Detail

      • data

        protected DATA data
      • dataLock

        protected final java.lang.Object dataLock
      • logger

        protected static final org.slf4j.Logger logger
    • Constructor Detail

      • ReadSingleFeatureFunction

        public ReadSingleFeatureFunction​(java.lang.String functionName,
                                         TYPE typeInfo)
    • Method Detail

      • getAllowedReadCmdOptions

        public java.util.Set<ReadSingleCmdOption> getAllowedReadCmdOptions()
      • setAllowedReadCmdOptions

        public void setAllowedReadCmdOptions​(ReadSingleCmdOption... allowedReadCmdOptions)
      • read

        public 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
        Specified by:
        read in class FeatureFunction
        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
        Throws:
        SpineException - on invalid filter
      • write

        public SpineAcknowledgment write​(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd,
                                         org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)
                                  throws SpineException
        Specified by:
        write in class FeatureFunction
        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
        Throws:
        SpineException - if the write command encounters an exception
      • updateData

        public void updateData​(DATA update)
                        throws DataValidationException
        Updates the data for the given update. Validates the update before and throws DataValidationException if invalid. Notifies subscribers on successful update. Any elements that are set to null in the update will be notified as deleted.
        Parameters:
        update - the update
        Throws:
        DataValidationException - if data validation fails
      • getDataCopy

        public DATA getDataCopy()
        Returns a data copy of the current data.
        Returns:
        data copy
      • getUseCaseDataValidation

        public DataValidation<DATA> getUseCaseDataValidation()
      • setUseCaseDataValidation

        public void setUseCaseDataValidation​(DataValidation<DATA> useCaseDataValidation)
      • validateData

        protected abstract void validateData​(DATA data)
                                      throws DataValidationException
        Validates the given data. Must be implemented by the specific Feature Function.
        Parameters:
        data - the data to validate
        Throws:
        DataValidationException - if the validation fails
      • getTypeInfo

        public TYPE getTypeInfo()
      • close

        public void close()
        Description copied from interface: Shutdownable
        Cleanly and promptly shut down this object, as well as all child objects and objects depending on this one.