Class KeyValueListDataFunction


  • public class KeyValueListDataFunction
    extends ReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType>>
    • Field Detail

      • TYPE_INFO

        public static final ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType> TYPE_INFO
      • logger

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

      • writeData

        public void writeData​(org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType data,
                              DataUpdateType dataUpdateType,
                              java.lang.Integer idx)
        Description copied from class: ReadAndWriteListFeatureFunction
        Called when changes were made to any data.
        Specified by:
        writeData in class ReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType>>
        Parameters:
        data - the data that was updated (copy of the original data), fully deleted or newly added
        dataUpdateType - if the data shall be updated, deleted or newly added
        idx - index where at the data was added for this feature function
      • validateUpdateForMatchingData

        protected void validateUpdateForMatchingData​(org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType update,
                                                     java.util.List<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType> matchingDataList,
                                                     WriteListCmdOption writeListCmdOption)
                                              throws SpineException
        Description copied from class: ReadAndWriteListFeatureFunction
        Validates each update data for its matching data that is changed by the update data. This is called for each update data on partial or full write. Must be implemented by the specific Feature Function.
        Specified by:
        validateUpdateForMatchingData in class ReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType>>
        Parameters:
        update - the given update
        matchingDataList - the data that is to be changed by the update
        writeListCmdOption - the WriteListCmdOption that is used
        Throws:
        SpineException - if the validation fails
      • validateData

        protected void validateData​(org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType 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
      • validateWriteCmdFull

        protected void validateWriteCmdFull​(java.util.List<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType> updateList,
                                            java.util.List<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType> selectorsList,
                                            org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType elements,
                                            WriteListCmdOption writeListCmdOption)
                                     throws SpineException
        Description copied from class: ReadAndWriteListFeatureFunction
        Validates a write command by taking the full update data list, selector list, elementsType object and the WriteListCmdOption that is used. This may be called twice for one command if both Delete and Write are used. Must be implemented by the specific Feature Function.
        Specified by:
        validateWriteCmdFull in class ReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType>>
        Parameters:
        updateList - the full update data list (can be null on DELETE writeCmdOption)
        selectorsList - the full selector list of the command, may be empty
        elements - the elementsType object, may be null
        writeListCmdOption - the WriteListCmdOption that is used
        Throws:
        SpineException - if the validation fails
      • call

        public SpineAcknowledgment call​(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd,
                                        org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)
        Specified by:
        call in class FeatureFunction
        Parameters:
        cmd - the command data belonging to this function call
        sourceAddress - the feature address of the client feature
        Returns:
        an acknowledgment stating the result of the operation
      • validateReadCmd

        protected void validateReadCmd​(java.util.List<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType> deviceConfigurationKeyValueListDataSelectorsTypes,
                                       org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType elements,
                                       ReadListCmdOption readListCmdOption)
                                throws SpineException
        Description copied from class: ReadListFeatureFunction
        Validates the read command. Must be implemented by the specific Feature Function. Throws SpineException if the validation fails.
        Specified by:
        validateReadCmd in class ReadListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.DeviceConfigurationKeyValueDataElementsType>>
        Parameters:
        deviceConfigurationKeyValueListDataSelectorsTypes - the list of given selectors, may be empty
        elements - the elementsType object, may be null
        readListCmdOption - the CmdOption that was used by the request
        Throws:
        SpineException - if the validation fails
      • setKeyValueList

        public void setKeyValueList​(java.util.List<KeyValue> keyValueList)
      • getUseCaseDataValidation

        public DataValidation<DATA> getUseCaseDataValidation()
      • setUseCaseDataValidation

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

        public TYPE getTypeInfo()