Class NodeCache
- java.lang.Object
- 
- org.opennms.features.kafka.producer.NodeCache
 
- 
 public class NodeCache extends Object 
- 
- 
Constructor SummaryConstructors Constructor Description NodeCache(NodeDao nodeDao, SessionUtils sessionUtils)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidsetTimeoutInMs(long timeoutInMs)voidtriggerIfNeeded(long nodeId, java.util.function.Consumer<OnmsNode> consumer)Calls the given consumer with a OnmsNode object corresponding to the given nodeId if no call has been made for this node within the configured timeout.
 
- 
- 
- 
Constructor Detail- 
NodeCachepublic NodeCache(NodeDao nodeDao, SessionUtils sessionUtils) 
 
- 
 - 
Method Detail- 
triggerIfNeededpublic void triggerIfNeeded(long nodeId, java.util.function.Consumer<OnmsNode> consumer)Calls the given consumer with a OnmsNode object corresponding to the given nodeId if no call has been made for this node within the configured timeout. The given node object may be null if no node exists with the given node id. The callback will be done within the context of a read-only transaction. If multiple threads use this function with the same node id, it is possible that multiple callbacks occur before the timeout.- Parameters:
- nodeId- db id of the node to query
- consumer- callback to issue with the node, if the timeout has not expired since the last callback
 
 - 
setTimeoutInMspublic void setTimeoutInMs(long timeoutInMs) 
 
- 
 
-