Class LimitListDataFunction

  • All Implemented Interfaces:
    java.lang.AutoCloseable, Shutdownable

    public class LimitListDataFunction
    extends LoadControlFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType>
    • Field Detail

      • TYPE_INFO

        public static final ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType> TYPE_INFO
      • logger

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

      • updateAndScheduleStartAndExpiration

        public void updateAndScheduleStartAndExpiration​(int idx,
                                                        org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType update)
                                                 throws DataValidationException
        updates given data at given index and schedules start if timePeriod startTime is not null and expiration if endTime is not null.
        Parameters:
        idx - index of data to update
        update - the update
        Throws:
        DataValidationException - if update is invalid
      • validateData

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

        public void writeData​(org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType update,
                              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.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType>>
        Parameters:
        update - 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.LoadControlLimitDataType update,
                                                     java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType> matchingData,
                                                     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.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType>>
        Parameters:
        update - the given update
        matchingData - the data that is to be changed by the update
        writeListCmdOption - the WriteListCmdOption that is used
        Throws:
        SpineException - if the validation fails
      • validateWriteCmdFull

        protected void validateWriteCmdFull​(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType> updateList,
                                            java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType> loadControlLimitListDataSelectorsTypes,
                                            org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType loadControlLimitDataElementsType,
                                            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.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType>>
        Parameters:
        updateList - the full update data list (can be null on DELETE writeCmdOption)
        loadControlLimitListDataSelectorsTypes - the full selector list of the command, may be empty
        loadControlLimitDataElementsType - the elementsType object, may be null
        writeListCmdOption - the WriteListCmdOption that is used
        Throws:
        SpineException - if the validation fails
      • validateReadCmd

        protected void validateReadCmd​(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType> loadControlLimitListDataSelectorsTypes,
                                       org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType loadControlLimitDataElementsType,
                                       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.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType,​ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitListDataSelectorsType,​org.openmuc.jeebus.spine.xsd.v1.LoadControlLimitDataElementsType>>
        Parameters:
        loadControlLimitListDataSelectorsTypes - the list of given selectors, may be empty
        loadControlLimitDataElementsType - the elementsType object, may be null
        readListCmdOption - the CmdOption that was used by the request
        Throws:
        SpineException - if the validation fails
      • getUseCaseDataValidation

        public DataValidation<DATA> getUseCaseDataValidation()
      • setUseCaseDataValidation

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

        public TYPE getTypeInfo()