Class NodeCache


  • public class NodeCache
    extends Object
    • Method Detail

      • triggerIfNeeded

        public 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
      • setTimeoutInMs

        public void setTimeoutInMs​(long timeoutInMs)