Class EventListDataFunction
- java.lang.Object
-
- org.openmuc.jeebus.spine.spi.function.FeatureFunction
-
- org.openmuc.jeebus.spine.spi.function.ReadListFeatureFunction<DATA,DATA_LIST,SELECTOR,ELEMENTS,TYPE>
-
- org.openmuc.jeebus.spine.spi.function.ReadAndWriteListFeatureFunction<DATA,DATA_LIST,SELECTOR,ELEMENTS,ListFeatureFunctionTypeInfo<DATA,DATA_LIST,SELECTOR,ELEMENTS>>
-
- org.openmuc.jeebus.spine.utils.features.loadcontrol.LoadControlFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>
-
- org.openmuc.jeebus.spine.utils.features.loadcontrol.EventListDataFunction
-
- All Implemented Interfaces:
java.lang.AutoCloseable,Shutdownable
public class EventListDataFunction extends LoadControlFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.slf4j.Loggerloggerstatic ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>TYPE_INFO-
Fields inherited from class org.openmuc.jeebus.spine.utils.features.loadcontrol.LoadControlFeatureFunction
feature
-
Fields inherited from class org.openmuc.jeebus.spine.spi.function.ReadAndWriteListFeatureFunction
useCaseWriteDataListListener
-
Fields inherited from class org.openmuc.jeebus.spine.spi.function.ReadListFeatureFunction
allowedReadListCmdOptions, dataListHolder, listFeatureFunctionNotifier
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpineAcknowledgmentcall(org.openmuc.jeebus.spine.xsd.v1.CmdType cmd, org.openmuc.jeebus.spine.xsd.v1.FeatureAddressType sourceAddress)TYPEgetTypeInfo()DataValidation<DATA>getUseCaseDataValidation()voidsetUseCaseDataValidation(DataValidation<DATA> useCaseDataValidation)protected voidvalidateData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType data)Validates the given data.protected voidvalidateReadCmd(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType> loadControlEventListDataSelectorsTypes, org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType loadControlEventDataElementsType, ReadListCmdOption readListCmdOption)Validates the read command.protected voidvalidateUpdateForMatchingData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType update, java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType> matchingData, WriteListCmdOption writeListCmdOption)Validates each update data for its matching data that is changed by the update data.protected voidvalidateWriteCmdFull(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType> updateList, java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType> loadControlEventListDataSelectorsTypes, org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType loadControlEventDataElementsType, WriteListCmdOption writeListCmdOption)Validates a write command by taking the full update data list, selector list, elementsType object and theWriteListCmdOptionthat is used.voidwriteData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType loadControlEventDataType, DataUpdateType dataUpdateType, java.lang.Integer idx)Called when changes were made to any data.-
Methods inherited from class org.openmuc.jeebus.spine.utils.features.loadcontrol.LoadControlFeatureFunction
validateIsRemoteControllable
-
Methods inherited from class org.openmuc.jeebus.spine.spi.function.ReadAndWriteListFeatureFunction
deleteDataEntriesBySelector, getAllowedWriteCmdOptions, setAllowedWriteCmdOptions, setUseCaseMatchingDataWriteValidation, setUseCaseWriteDataListener, setUseCaseWriteValidationFull, write
-
Methods inherited from class org.openmuc.jeebus.spine.spi.function.ReadListFeatureFunction
addData, addData, close, getAllowedReadCmdOptions, getDataCopies, getDataCopiesFor, getDataCopy, getDataCopyForFirst, read, removeData, removeData, setAllowedReadCmdOptions, setFeature, setUseCaseReadValidation, updateData, updateData
-
Methods inherited from class org.openmuc.jeebus.spine.spi.function.FeatureFunction
bindingRequired, getFunctionName, getFunctionProperty, isCallable, isReadable, isWritable, matchAddress, requireBinding, setCallable, setReadable, setWritable
-
-
-
-
Field Detail
-
TYPE_INFO
public static final ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType> TYPE_INFO
-
logger
protected static final org.slf4j.Logger logger
-
-
Method Detail
-
validateData
protected void validateData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType data) throws DataValidationExceptionValidates 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:
callin classFeatureFunction- 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
-
writeData
public void writeData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType loadControlEventDataType, DataUpdateType dataUpdateType, java.lang.Integer idx)Description copied from class:ReadAndWriteListFeatureFunctionCalled when changes were made to any data.- Specified by:
writeDatain classReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType,ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>>- Parameters:
loadControlEventDataType- the data that was updated (copy of the original data), fully deleted or newly addeddataUpdateType- if the data shall be updated, deleted or newly addedidx- index where at the data was added for this feature function
-
validateUpdateForMatchingData
protected void validateUpdateForMatchingData(org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType update, java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType> matchingData, WriteListCmdOption writeListCmdOption) throws SpineExceptionDescription copied from class:ReadAndWriteListFeatureFunctionValidates 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:
validateUpdateForMatchingDatain classReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType,ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>>- Parameters:
update- the given updatematchingData- the data that is to be changed by the updatewriteListCmdOption- theWriteListCmdOptionthat is used- Throws:
SpineException- if the validation fails
-
validateWriteCmdFull
protected void validateWriteCmdFull(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType> updateList, java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType> loadControlEventListDataSelectorsTypes, org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType loadControlEventDataElementsType, WriteListCmdOption writeListCmdOption) throws SpineExceptionDescription copied from class:ReadAndWriteListFeatureFunctionValidates a write command by taking the full update data list, selector list, elementsType object and theWriteListCmdOptionthat 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:
validateWriteCmdFullin classReadAndWriteListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType,ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>>- Parameters:
updateList- the full update data list (can be null on DELETE writeCmdOption)loadControlEventListDataSelectorsTypes- the full selector list of the command, may be emptyloadControlEventDataElementsType- the elementsType object, may be nullwriteListCmdOption- theWriteListCmdOptionthat is used- Throws:
SpineException- if the validation fails
-
validateReadCmd
protected void validateReadCmd(java.util.List<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType> loadControlEventListDataSelectorsTypes, org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType loadControlEventDataElementsType, ReadListCmdOption readListCmdOption) throws SpineExceptionDescription copied from class:ReadListFeatureFunctionValidates the read command. Must be implemented by the specific Feature Function. ThrowsSpineExceptionif the validation fails.- Specified by:
validateReadCmdin classReadListFeatureFunction<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType,ListFeatureFunctionTypeInfo<org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventListDataSelectorsType,org.openmuc.jeebus.spine.xsd.v1.LoadControlEventDataElementsType>>- Parameters:
loadControlEventListDataSelectorsTypes- the list of given selectors, may be emptyloadControlEventDataElementsType- the elementsType object, may be nullreadListCmdOption- 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()
-
-