Package org.openremote.model.protocol
Interface ProtocolAssetService
public interface ProtocolAssetService
Interface for protocols to perform limited asset related operations within their own realm
-
Method Summary
Modifier and TypeMethodDescriptionboolean
deleteAssets
(String... assetIds) Protocols may remove assets from the context store.<T extends Asset<?>>
TGet asset from the store by ID.findAssets
(AssetQuery assetQuery) <T extends Asset<?>>
TmergeAsset
(T asset) Protocols may store assets in the context or update existing assets.void
sendAttributeEvent
(AttributeEvent attributeEvent) Send anAttributeEvent
through the systemvoid
subscribeChildAssetChange
(Consumer<PersistenceEvent<Asset<?>>> assetChangeConsumer) Subscribe to changes ofAsset
s that are descendants of the agent.void
unsubscribeChildAssetChange
(Consumer<PersistenceEvent<Asset<?>>> assetChangeConsumer) Unsubscribe to changes ofAsset
s that are descendants of the agent.
-
Method Details
-
mergeAsset
Protocols may store assets in the context or update existing assets. A unique identifier must be set by the protocol implementor, and the parent must be theAgent
associated with the requesting protocol instance. This operation stores transient or detached state and returns the current state. It will override any existing stored asset data, ignoring versions. -
deleteAssets
Protocols may remove assets from the context store.- Returns:
false
if the delete could not be performed (asset may have children?)
-
findAsset
Get asset from the store by ID. -
findAssets
-
sendAttributeEvent
Send anAttributeEvent
through the system -
subscribeChildAssetChange
Subscribe to changes ofAsset
s that are descendants of the agent.When an agent is unlinked from a protocol then all subscriptions will be automatically removed also; it is safe to call this method multiple times for the same agentId and assetChangeConsumer and only a single subscription would actually be created.
-
unsubscribeChildAssetChange
Unsubscribe to changes ofAsset
s that are descendants of the agent.When an agent is unlinked from a protocol then all subscriptions will be automatically removed also.
-