public class NodeCache extends NodeMap
AddressSpace.getCache()| Modifier and Type | Class and Description |
|---|---|
class |
NodeCache.NodeCacheWrapper
A wrapper which keeps track of time when a node was added to the cache.
|
defaultLocale, nodeFactory| Constructor and Description |
|---|
NodeCache(UaNodeFactory nodeFactory,
int maxQueueLength,
long nodeMaxAgeInMillis)
Creates new NodeCache.
|
| Modifier and Type | Method and Description |
|---|---|
UaNode |
addNode(UaNode node) |
protected UaNode |
addNode(UaNode node,
DateTime timestamp) |
UaNode |
addPermanently(UaNode node)
Add a node permanently to the cache.
|
void |
clear()
Clear the node map of all entries.
|
protected UaNode |
createNode(NodeClass nodeClass,
NodeId nodeId,
QualifiedName browseName,
LocalizedText displayName,
ExpandedNodeId typeDefinition)
Create a new node and add it to the cache.
|
int |
getMaxQueueLength()
The maximum number of nodes to keep in the cache queue.
|
UaNode |
getNode(NodeId nodeId) |
long |
getNodeMaxAgeInMillis()
Maximum age of a node in the cache.
|
boolean |
hasNode(NodeId nodeId)
Check if the map contains a node with the specified NodeId.
|
protected boolean |
isPermanentTimestamp(DateTime timestamp)
Checks if a timestamp is considered as permanent for the purpose of storing the node.
|
UaNode |
remove(NodeId nodeId)
Remove a node from the node map.
|
UaNode |
remove(UaNode node)
Remove a node from the node map.
|
void |
setMaxQueueLength(int maxQueueLength)
Set the maximum queue length.
|
void |
setNodeMaxAgeInMillis(long nodeMaxAgeInMillis)
Set the maximum time to keep nodes in the cache.
|
int |
size()
Returns the current size of the cache.
|
getNodeFactorypublic NodeCache(UaNodeFactory nodeFactory, int maxQueueLength, long nodeMaxAgeInMillis)
nodeFactory - factory used to create UaNode instancesmaxQueueLength - max amount nodes to cachenodeMaxAgeInMillis - maximum time a node is cachedpublic UaNode addPermanently(UaNode node)
node - the node to addpublic void clear()
NodeMappublic int getMaxQueueLength()
public long getNodeMaxAgeInMillis()
public boolean hasNode(NodeId nodeId)
NodeMappublic UaNode remove(NodeId nodeId)
NodeMappublic UaNode remove(UaNode node)
NodeMappublic void setMaxQueueLength(int maxQueueLength)
maxQueueLength - the max lengthgetMaxQueueLength()public void setNodeMaxAgeInMillis(long nodeMaxAgeInMillis)
nodeMaxAgeInMillis - max time in millisecondsgetNodeMaxAgeInMillis()public int size()
protected UaNode createNode(NodeClass nodeClass, NodeId nodeId, QualifiedName browseName, LocalizedText displayName, ExpandedNodeId typeDefinition) throws UaNodeFactoryException
UaNodeFactory given in the constructor.UaNodeFactoryExceptionprotected boolean isPermanentTimestamp(DateTime timestamp)
DateTime.MAX_VALUE are considered as permanent, i.e. the node is stored forever in the
cache.Copyright © 2026. All rights reserved.