public class InterfaceToNodeCacheDaoImpl extends AbstractInterfaceToNodeCache implements InterfaceToNodeCache
Constructor and Description |
---|
InterfaceToNodeCacheDaoImpl() |
InterfaceToNodeCacheDaoImpl(long refreshRate) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Should only be used for testing.
|
void |
dataSourceSync()
Clears and synchronizes the internal known IP address cache with the
current information contained in the database.
|
IpInterfaceDao |
getIpInterfaceDao() |
NodeDao |
getNodeDao() |
Iterable<Integer> |
getNodeId(String location,
InetAddress address)
Returns the nodeid for the IP Address
|
void |
init() |
boolean |
removeNodeId(String location,
InetAddress address,
int nodeId)
Removes an address from the node ID map.
|
void |
setIpInterfaceDao(IpInterfaceDao ipInterfaceDao) |
void |
setNodeDao(NodeDao nodeDao) |
boolean |
setNodeId(String location,
InetAddress addr,
int nodeid)
Sets the IP Address and Node ID in the Map.
|
int |
size() |
getFirstNodeId, getInstance, setInstance
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFirstNodeId
public InterfaceToNodeCacheDaoImpl()
public InterfaceToNodeCacheDaoImpl(long refreshRate)
@PostConstruct public void init()
public NodeDao getNodeDao()
public void setNodeDao(NodeDao nodeDao)
public IpInterfaceDao getIpInterfaceDao()
public void setIpInterfaceDao(IpInterfaceDao ipInterfaceDao)
@Transactional public void dataSourceSync()
dataSourceSync
in interface InterfaceToNodeCache
SQLException
- Thrown if the connection cannot be created or a database
error occurs.public Iterable<Integer> getNodeId(String location, InetAddress address)
If multiple nodes hav assigned interfaces with the same IP, this returns all known nodes sorted by the interface management priority.
getNodeId
in interface InterfaceToNodeCache
address
- The IP Address to query.@Transactional public boolean setNodeId(String location, InetAddress addr, int nodeid)
setNodeId
in interface InterfaceToNodeCache
addr
- The IP Address to add.nodeid
- The Node ID to add.public boolean removeNodeId(String location, InetAddress address, int nodeId)
removeNodeId
in interface InterfaceToNodeCache
address
- The address to remove from the node ID map.public int size()
size
in interface InterfaceToNodeCache
public void clear()
InterfaceToNodeCache
clear
in interface InterfaceToNodeCache
Copyright © 2019. All rights reserved.