|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.web.element.NetworkElementFactory
public class NetworkElementFactory
The source for all network element business objects (nodes, interfaces, services). Encapsulates all lookup functionality for the network element business objects in one place. To use this factory to lookup network elements, you must first initialize the Vault with the database connection manager * and JDBC URL it will use. Call the init method to initialize the factory. After that, you can call any lookup methods.
| Nested Class Summary | |
|---|---|
static class |
NetworkElementFactory.InterfaceComparator
|
| Field Summary | |
|---|---|
protected static Map<Integer,String> |
serviceId2NameMap
A mapping of service identifiers (integers) to service names (strings). |
protected static Map<String,Integer> |
serviceName2IdMap
A mapping of service names (strings) to service identifiers (integers). |
| Method Summary | |
|---|---|
protected static void |
augmentInterfacesWithSnmpData(Interface[] intfs,
Connection conn)
|
static Node[] |
convertOnmsNodeCollectionToNodeArray(Collection<OnmsNode> ourNodes)
|
protected static void |
createServiceIdNameMaps()
|
static Interface[] |
getActiveInterfacesOnNode(int nodeId)
|
static DataLinkInterface[] |
getAllDataLinks()
|
static Interface[] |
getAllInterfaces()
|
static Interface[] |
getAllInterfaces(boolean includeSNMP)
|
static Interface[] |
getAllInterfacesOnNode(int nodeId)
|
static Node[] |
getAllNodes()
Returns all non-deleted nodes. |
static Node[] |
getAllNodes(int serviceId)
|
static Service[] |
getAllServices()
|
static AtInterface |
getAtInterface(int nodeID,
String ipaddr)
|
static AtInterface[] |
getAtInterfacesFromPhysaddr(String AtPhysAddr)
|
protected static DataLinkInterface[] |
getDataLinks(int nodeID)
|
static DataLinkInterface[] |
getDataLinks(int nodeID,
int ifindex)
|
protected static DataLinkInterface[] |
getDataLinksFromNodeParent(int nodeID)
|
protected static DataLinkInterface[] |
getDataLinksFromNodeParent(int nodeID,
int ifindex)
|
static DataLinkInterface[] |
getDataLinksOnInterface(int nodeID,
int ifindex)
|
static DataLinkInterface[] |
getDataLinksOnNode(int nodeID)
|
static String |
getHostname(String ipAddress)
Resolve an IP address to a DNS hostname via the database. |
static Interface |
getInterface(int ipInterfaceId)
|
static Interface |
getInterface(int nodeId,
String ipAddress)
|
static Interface |
getInterface(int nodeId,
String ipAddress,
int ifindex)
|
static Interface[] |
getInterfacesWithIfAlias(int nodeId,
String ifAlias)
Returns all non-deleted Interfaces on the specified node that contain the given string in an ifAlias |
static Interface[] |
getInterfacesWithIpAddress(String ipAddress)
|
protected static String |
getIpAddress(int nodeid)
|
protected static String |
getIpAddress(int nodeid,
int ifindex)
|
static IpRouteInterface[] |
getIpRoute(int nodeID)
|
static IpRouteInterface[] |
getIpRoute(int nodeID,
int ifindex)
|
static Set<Integer> |
getLinkedNodeIdOnNode(int nodeID)
|
static Set<Integer> |
getLinkedNodeIdOnNode(int nodeID,
Connection conn)
|
static Set<Integer> |
getLinkedNodeIdOnNodes(Set<Integer> nodeIds,
Connection conn)
|
static Node |
getNode(int nodeId)
|
static List<Integer> |
getNodeIdsWithIpLike(String iplike)
Returns all non-deleted nodes with an IP address like the rule given. |
static String |
getNodeLabel(int nodeId)
Translate a node id into a human-readable node label. |
static Node[] |
getNodesFromPhysaddr(String AtPhysAddr)
|
static Node[] |
getNodesLike(String nodeLabel)
Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel. |
static Node[] |
getNodesLike(String nodeLabel,
int serviceId)
|
static Node[] |
getNodesLikeAndIpLike(String nodeLabel,
String iplike,
int serviceId)
|
static Node[] |
getNodesWithCategories(NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithIfAlias(String ifAlias)
Returns all non-deleted nodes that contain the given string in an ifAlias |
static Node[] |
getNodesWithIpLike(String iplike)
Returns all non-deleted nodes with an IP address like the rule given. |
static Node[] |
getNodesWithIpLike(String iplike,
int serviceId)
|
static Node[] |
getNodesWithPhysAddr(String macAddr)
Returns all non-deleted nodes that have the given mac. |
static Node[] |
getNodesWithPhysAddrAtInterface(String macAddr)
Returns all non-deleted nodes with a MAC address like the rule given from AtInterface. |
static Node[] |
getNodesWithPhysAddrFromSnmpInterface(String macAddr)
Returns all non-deleted nodes with a MAC address like the rule given from SnmpInterface. |
static Node[] |
getNodesWithService(int serviceId)
Returns all non-deleted nodes that have the given service. |
static Service |
getService(int ifServiceId)
Return the service specified by the node identifier, IP address, and service identifier. |
static Service |
getService(int nodeId,
String ipAddress,
int serviceId)
Return the service specified by the node identifier, IP address, and service identifier. |
static int |
getServiceIdFromName(String serviceName)
|
static Map<Integer,String> |
getServiceIdToNameMap()
|
static String |
getServiceNameFromId(int serviceId)
|
static Map<String,Integer> |
getServiceNameToIdMap()
|
static Service[] |
getServicesOnInterface(int nodeId,
String ipAddress)
|
static Service[] |
getServicesOnInterface(int nodeId,
String ipAddress,
boolean includeDeletions)
|
static Service[] |
getServicesOnNode(int nodeId)
Get the list of all services on a given node. |
static Service[] |
getServicesOnNode(int nodeId,
int serviceId)
Get the list of all instances of a specific service on a given node. |
static StpInterface[] |
getStpInterface(int nodeID)
|
static StpInterface[] |
getStpInterface(int nodeID,
int ifindex)
|
static StpNode[] |
getStpNode(int nodeID)
|
static Vlan[] |
getVlansOnNode(int nodeID)
|
protected static DataLinkInterface[] |
invertDataLinkInterface(DataLinkInterface[] nodes)
|
static boolean |
isBridgeNode(int nodeID)
|
static boolean |
isParentNode(int nodeID)
|
static boolean |
isRouteInfoNode(int nodeID)
|
static boolean |
nodeHasIfAliases(int nodeId)
Returns true if node has any snmpIfAliases |
protected static AtInterface[] |
rs2AtInterface(ResultSet rs)
This method returns the data from the result set as an array of AtInterface objects. |
protected static DataLinkInterface[] |
rs2DataLink(ResultSet rs)
This method returns the data from the result set as an array of DataLinkInterface objects. |
protected static Interface[] |
rs2Interfaces(ResultSet rs)
This method returns the data from the result set as an vector of ipinterface objects. |
protected static IpRouteInterface[] |
rs2IpRouteInterface(ResultSet rs)
This method returns the data from the result set as an array of IpRouteInterface objects. |
protected static Node[] |
rs2Nodes(ResultSet rs)
This method returns the data from the result set as an array of Node objects. |
protected static Service[] |
rs2Services(ResultSet rs)
|
protected static StpInterface[] |
rs2StpInterface(ResultSet rs)
This method returns the data from the result set as an array of StpInterface objects. |
protected static StpNode[] |
rs2StpNode(ResultSet rs)
This method returns the data from the result set as an array of StpNode objects. |
protected static Vlan[] |
rs2Vlan(ResultSet rs)
This method returns the data from the result set as an array of StpNode objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static Map<String,Integer> serviceName2IdMap
protected static Map<Integer,String> serviceId2NameMap
| Method Detail |
|---|
public static String getNodeLabel(int nodeId)
throws SQLException
SQLException
public static Node getNode(int nodeId)
throws SQLException
SQLException
public static Node[] getAllNodes()
throws SQLException
SQLException
public static Node[] getNodesLike(String nodeLabel)
throws SQLException
SQLException
public static Node[] getNodesWithIpLike(String iplike)
throws SQLException
SQLException
public static Node[] getNodesWithService(int serviceId)
throws SQLException
SQLException
public static Node[] getNodesWithPhysAddr(String macAddr)
throws SQLException
SQLException
public static Node[] getNodesWithPhysAddrAtInterface(String macAddr)
throws SQLException
SQLException
public static Node[] getNodesWithPhysAddrFromSnmpInterface(String macAddr)
throws SQLException
SQLException
public static Node[] getNodesWithIfAlias(String ifAlias)
throws SQLException
SQLException
public static String getHostname(String ipAddress)
throws SQLException
SQLException
public static Interface getInterface(int ipInterfaceId)
throws SQLException
SQLException
public static Interface getInterface(int nodeId,
String ipAddress)
throws SQLException
SQLException
public static Interface getInterface(int nodeId,
String ipAddress,
int ifindex)
throws SQLException
SQLException
public static Interface[] getInterfacesWithIpAddress(String ipAddress)
throws SQLException
SQLException
public static Interface[] getInterfacesWithIfAlias(int nodeId,
String ifAlias)
throws SQLException
SQLException
public static boolean nodeHasIfAliases(int nodeId)
throws SQLException
SQLException
public static Interface[] getAllInterfacesOnNode(int nodeId)
throws SQLException
SQLException
public static Interface[] getActiveInterfacesOnNode(int nodeId)
throws SQLException
SQLException
public static Interface[] getAllInterfaces()
throws SQLException
SQLException
public static Interface[] getAllInterfaces(boolean includeSNMP)
throws SQLException
SQLException
public static Service getService(int nodeId,
String ipAddress,
int serviceId)
throws SQLException
Note that if there are both an active service and historically deleted services with this (nodeid, ipAddress, serviceId) key, then the active service will be returned. If there are only deleted services, then the first deleted service will be returned.
SQLException
public static Service getService(int ifServiceId)
throws SQLException
Note that if there are both an active service and historically deleted services with this (nodeid, ipAddress, serviceId) key, then the active service will be returned. If there are only deleted services, then the first deleted service will be returned.
SQLException
public static Service[] getAllServices()
throws SQLException
SQLException
public static Service[] getServicesOnInterface(int nodeId,
String ipAddress)
throws SQLException
SQLException
public static Service[] getServicesOnInterface(int nodeId,
String ipAddress,
boolean includeDeletions)
throws SQLException
SQLException
public static Service[] getServicesOnNode(int nodeId)
throws SQLException
SQLException
public static Service[] getServicesOnNode(int nodeId,
int serviceId)
throws SQLException
SQLException
protected static Node[] rs2Nodes(ResultSet rs)
throws SQLException
SQLException
protected static Interface[] rs2Interfaces(ResultSet rs)
throws SQLException
SQLException
protected static void augmentInterfacesWithSnmpData(Interface[] intfs,
Connection conn)
throws SQLException
SQLException
protected static Service[] rs2Services(ResultSet rs)
throws SQLException
SQLException
public static String getServiceNameFromId(int serviceId)
throws SQLException
SQLException
public static int getServiceIdFromName(String serviceName)
throws SQLException
SQLException
public static Map<Integer,String> getServiceIdToNameMap()
throws SQLException
SQLException
public static Map<String,Integer> getServiceNameToIdMap()
throws SQLException
SQLException
protected static void createServiceIdNameMaps()
throws SQLException
SQLException
public static Node[] getNodesLikeAndIpLike(String nodeLabel,
String iplike,
int serviceId)
throws SQLException
SQLException
public static Node[] getNodesLike(String nodeLabel,
int serviceId)
throws SQLException
SQLException
public static Node[] getNodesWithIpLike(String iplike,
int serviceId)
throws SQLException
SQLException
public static Node[] getAllNodes(int serviceId)
throws SQLException
SQLException
public static AtInterface[] getAtInterfacesFromPhysaddr(String AtPhysAddr)
throws SQLException
SQLException
public static Node[] getNodesFromPhysaddr(String AtPhysAddr)
throws SQLException
SQLException
public static AtInterface getAtInterface(int nodeID,
String ipaddr)
throws SQLException
SQLException
public static IpRouteInterface[] getIpRoute(int nodeID)
throws SQLException
SQLException
public static IpRouteInterface[] getIpRoute(int nodeID,
int ifindex)
throws SQLException
SQLException
public static boolean isParentNode(int nodeID)
throws SQLException
SQLException
public static boolean isBridgeNode(int nodeID)
throws SQLException
SQLException
public static boolean isRouteInfoNode(int nodeID)
throws SQLException
SQLException
public static DataLinkInterface[] getDataLinksOnNode(int nodeID)
throws SQLException
SQLException
public static Set<Integer> getLinkedNodeIdOnNode(int nodeID)
throws SQLException
SQLException
public static Set<Integer> getLinkedNodeIdOnNode(int nodeID,
Connection conn)
throws SQLException
SQLException
public static Set<Integer> getLinkedNodeIdOnNodes(Set<Integer> nodeIds,
Connection conn)
throws SQLException
SQLException
protected static DataLinkInterface[] getDataLinks(int nodeID)
throws SQLException
SQLException
protected static DataLinkInterface[] getDataLinksFromNodeParent(int nodeID)
throws SQLException
SQLException
public static DataLinkInterface[] getDataLinksOnInterface(int nodeID,
int ifindex)
throws SQLException
SQLException
public static DataLinkInterface[] getDataLinks(int nodeID,
int ifindex)
throws SQLException
SQLException
protected static DataLinkInterface[] getDataLinksFromNodeParent(int nodeID,
int ifindex)
throws SQLException
SQLException
public static DataLinkInterface[] getAllDataLinks()
throws SQLException
SQLException
public static Vlan[] getVlansOnNode(int nodeID)
throws SQLException
SQLException
public static StpInterface[] getStpInterface(int nodeID)
throws SQLException
SQLException
public static StpInterface[] getStpInterface(int nodeID,
int ifindex)
throws SQLException
SQLException
public static StpNode[] getStpNode(int nodeID)
throws SQLException
SQLException
protected static AtInterface[] rs2AtInterface(ResultSet rs)
throws SQLException
SQLException
protected static IpRouteInterface[] rs2IpRouteInterface(ResultSet rs)
throws SQLException
SQLException
protected static StpInterface[] rs2StpInterface(ResultSet rs)
throws SQLException
SQLException
protected static StpNode[] rs2StpNode(ResultSet rs)
throws SQLException
SQLException
protected static Vlan[] rs2Vlan(ResultSet rs)
throws SQLException
SQLException
protected static DataLinkInterface[] rs2DataLink(ResultSet rs)
throws SQLException
SQLExceptionprotected static DataLinkInterface[] invertDataLinkInterface(DataLinkInterface[] nodes)
protected static String getIpAddress(int nodeid)
throws SQLException
SQLException
protected static String getIpAddress(int nodeid,
int ifindex)
throws SQLException
SQLException
public static List<Integer> getNodeIdsWithIpLike(String iplike)
throws SQLException
SQLException
public static Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(NodeDao nodeDao,
CategoryDao categoryDao,
String[] categories1,
String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] convertOnmsNodeCollectionToNodeArray(Collection<OnmsNode> ourNodes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||