|
|||||||||
| 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.
| Field Summary | |
|---|---|
protected static java.util.Map<java.lang.Integer,java.lang.String> |
serviceId2NameMap
A mapping of service identifiers (integers) to service names (strings). |
protected static java.util.Map<java.lang.String,java.lang.Integer> |
serviceName2IdMap
A mapping of service names (strings) to service identifiers (integers). |
| Method Summary | |
|---|---|
protected static void |
augmentInterfacesWithSnmpData(Interface[] intfs,
java.sql.Connection conn)
|
static Node[] |
convertOnmsNodeCollectionToNodeArray(java.util.Collection<org.opennms.netmgt.model.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,
java.lang.String ipaddr)
|
static AtInterface[] |
getAtInterfacesFromPhysaddr(java.lang.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 java.lang.String |
getHostname(java.lang.String ipAddress)
Resolve an IP address to a DNS hostname via the database. |
static Interface |
getInterface(int ipInterfaceId)
|
static Interface |
getInterface(int nodeId,
java.lang.String ipAddress)
|
static Interface |
getInterface(int nodeId,
java.lang.String ipAddress,
int ifindex)
|
static Interface[] |
getInterfacesWithIfAlias(int nodeId,
java.lang.String ifAlias)
Returns all non-deleted Interfaces on the specified node that contain the given string in an ifAlias |
static Interface[] |
getInterfacesWithIpAddress(java.lang.String ipAddress)
|
protected static java.lang.String |
getIpAddress(int nodeid)
|
protected static java.lang.String |
getIpAddress(int nodeid,
int ifindex)
|
static IpRouteInterface[] |
getIpRoute(int nodeID)
|
static IpRouteInterface[] |
getIpRoute(int nodeID,
int ifindex)
|
static java.util.Set<java.lang.Integer> |
getLinkedNodeIdOnNode(int nodeID)
|
static java.util.Set<java.lang.Integer> |
getLinkedNodeIdOnNode(int nodeID,
java.sql.Connection conn)
|
static java.util.Set<java.lang.Integer> |
getLinkedNodeIdOnNodes(java.util.Set nodeIds,
java.sql.Connection conn)
|
static Node |
getNode(int nodeId)
|
static java.util.List<java.lang.Integer> |
getNodeIdsWithIpLike(java.lang.String iplike)
Returns all non-deleted nodes with an IP address like the rule given. |
static java.lang.String |
getNodeLabel(int nodeId)
Translate a node id into a human-readable node label. |
static Node[] |
getNodesFromPhysaddr(java.lang.String AtPhysAddr)
|
static Node[] |
getNodesLike(java.lang.String nodeLabel)
Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel. |
static Node[] |
getNodesLike(java.lang.String nodeLabel,
int serviceId)
|
static Node[] |
getNodesLikeAndIpLike(java.lang.String nodeLabel,
java.lang.String iplike,
int serviceId)
|
static Node[] |
getNodesWithCategories(org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
java.lang.String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
java.lang.String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
|
static Node[] |
getNodesWithIfAlias(java.lang.String ifAlias)
Returns all non-deleted nodes that contain the given string in an ifAlias |
static Node[] |
getNodesWithIpLike(java.lang.String iplike)
Returns all non-deleted nodes with an IP address like the rule given. |
static Node[] |
getNodesWithIpLike(java.lang.String iplike,
int serviceId)
|
static Node[] |
getNodesWithPhysAddr(java.lang.String macAddr)
Returns all non-deleted nodes that have the given mac. |
static Node[] |
getNodesWithPhysAddrAtInterface(java.lang.String macAddr)
Returns all non-deleted nodes with a MAC address like the rule given from AtInterface. |
static Node[] |
getNodesWithPhysAddrFromSnmpInterface(java.lang.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,
java.lang.String ipAddress,
int serviceId)
Return the service specified by the node identifier, IP address, and service identifier. |
static int |
getServiceIdFromName(java.lang.String serviceName)
|
static java.util.Map<java.lang.Integer,java.lang.String> |
getServiceIdToNameMap()
|
static java.lang.String |
getServiceNameFromId(int serviceId)
|
static java.util.Map<java.lang.String,java.lang.Integer> |
getServiceNameToIdMap()
|
static Service[] |
getServicesOnInterface(int nodeId,
java.lang.String ipAddress)
|
static Service[] |
getServicesOnInterface(int nodeId,
java.lang.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)
|
protected static AtInterface[] |
rs2AtInterface(java.sql.ResultSet rs)
This method returns the data from the result set as an array of AtInterface objects. |
protected static DataLinkInterface[] |
rs2DataLink(java.sql.ResultSet rs)
This method returns the data from the result set as an array of DataLinkInterface objects. |
protected static Interface[] |
rs2Interfaces(java.sql.ResultSet rs)
This method returns the data from the result set as an vector of ipinterface objects. |
protected static IpRouteInterface[] |
rs2IpRouteInterface(java.sql.ResultSet rs)
This method returns the data from the result set as an array of IpRouteInterface objects. |
protected static Node[] |
rs2Nodes(java.sql.ResultSet rs)
This method returns the data from the result set as an array of Node objects. |
protected static Service[] |
rs2Services(java.sql.ResultSet rs)
|
protected static StpInterface[] |
rs2StpInterface(java.sql.ResultSet rs)
This method returns the data from the result set as an array of StpInterface objects. |
protected static StpNode[] |
rs2StpNode(java.sql.ResultSet rs)
This method returns the data from the result set as an array of StpNode objects. |
protected static Vlan[] |
rs2Vlan(java.sql.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 java.util.Map<java.lang.String,java.lang.Integer> serviceName2IdMap
protected static java.util.Map<java.lang.Integer,java.lang.String> serviceId2NameMap
| Method Detail |
|---|
public static java.lang.String getNodeLabel(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Node getNode(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getAllNodes()
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesLike(java.lang.String nodeLabel)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithIpLike(java.lang.String iplike)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithService(int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithPhysAddr(java.lang.String macAddr)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithPhysAddrAtInterface(java.lang.String macAddr)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithPhysAddrFromSnmpInterface(java.lang.String macAddr)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithIfAlias(java.lang.String ifAlias)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getHostname(java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Interface getInterface(int ipInterfaceId)
throws java.sql.SQLException
java.sql.SQLException
public static Interface getInterface(int nodeId,
java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Interface getInterface(int nodeId,
java.lang.String ipAddress,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getInterfacesWithIpAddress(java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getInterfacesWithIfAlias(int nodeId,
java.lang.String ifAlias)
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getAllInterfacesOnNode(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getActiveInterfacesOnNode(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getAllInterfaces()
throws java.sql.SQLException
java.sql.SQLException
public static Interface[] getAllInterfaces(boolean includeSNMP)
throws java.sql.SQLException
java.sql.SQLException
public static Service getService(int nodeId,
java.lang.String ipAddress,
int serviceId)
throws java.sql.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.
java.sql.SQLException
public static Service getService(int ifServiceId)
throws java.sql.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.
java.sql.SQLException
public static Service[] getAllServices()
throws java.sql.SQLException
java.sql.SQLException
public static Service[] getServicesOnInterface(int nodeId,
java.lang.String ipAddress)
throws java.sql.SQLException
java.sql.SQLException
public static Service[] getServicesOnInterface(int nodeId,
java.lang.String ipAddress,
boolean includeDeletions)
throws java.sql.SQLException
java.sql.SQLException
public static Service[] getServicesOnNode(int nodeId)
throws java.sql.SQLException
java.sql.SQLException
public static Service[] getServicesOnNode(int nodeId,
int serviceId)
throws java.sql.SQLException
java.sql.SQLException
protected static Node[] rs2Nodes(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static Interface[] rs2Interfaces(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static void augmentInterfacesWithSnmpData(Interface[] intfs,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
protected static Service[] rs2Services(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
public static java.lang.String getServiceNameFromId(int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static int getServiceIdFromName(java.lang.String serviceName)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Map<java.lang.Integer,java.lang.String> getServiceIdToNameMap()
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Map<java.lang.String,java.lang.Integer> getServiceNameToIdMap()
throws java.sql.SQLException
java.sql.SQLException
protected static void createServiceIdNameMaps()
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesLikeAndIpLike(java.lang.String nodeLabel,
java.lang.String iplike,
int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesLike(java.lang.String nodeLabel,
int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithIpLike(java.lang.String iplike,
int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getAllNodes(int serviceId)
throws java.sql.SQLException
java.sql.SQLException
public static AtInterface[] getAtInterfacesFromPhysaddr(java.lang.String AtPhysAddr)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesFromPhysaddr(java.lang.String AtPhysAddr)
throws java.sql.SQLException
java.sql.SQLException
public static AtInterface getAtInterface(int nodeID,
java.lang.String ipaddr)
throws java.sql.SQLException
java.sql.SQLException
public static IpRouteInterface[] getIpRoute(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static IpRouteInterface[] getIpRoute(int nodeID,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static boolean isParentNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static boolean isBridgeNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static boolean isRouteInfoNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static DataLinkInterface[] getDataLinksOnNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Set<java.lang.Integer> getLinkedNodeIdOnNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Set<java.lang.Integer> getLinkedNodeIdOnNode(int nodeID,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.Set<java.lang.Integer> getLinkedNodeIdOnNodes(java.util.Set nodeIds,
java.sql.Connection conn)
throws java.sql.SQLException
java.sql.SQLException
protected static DataLinkInterface[] getDataLinks(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
protected static DataLinkInterface[] getDataLinksFromNodeParent(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static DataLinkInterface[] getDataLinksOnInterface(int nodeID,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static DataLinkInterface[] getDataLinks(int nodeID,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
protected static DataLinkInterface[] getDataLinksFromNodeParent(int nodeID,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static DataLinkInterface[] getAllDataLinks()
throws java.sql.SQLException
java.sql.SQLException
public static Vlan[] getVlansOnNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static StpInterface[] getStpInterface(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
public static StpInterface[] getStpInterface(int nodeID,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static StpNode[] getStpNode(int nodeID)
throws java.sql.SQLException
java.sql.SQLException
protected static AtInterface[] rs2AtInterface(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static IpRouteInterface[] rs2IpRouteInterface(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static StpInterface[] rs2StpInterface(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static StpNode[] rs2StpNode(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static Vlan[] rs2Vlan(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLException
protected static DataLinkInterface[] rs2DataLink(java.sql.ResultSet rs)
throws java.sql.SQLException
java.sql.SQLExceptionprotected static DataLinkInterface[] invertDataLinkInterface(DataLinkInterface[] nodes)
protected static java.lang.String getIpAddress(int nodeid)
throws java.sql.SQLException
java.sql.SQLException
protected static java.lang.String getIpAddress(int nodeid,
int ifindex)
throws java.sql.SQLException
java.sql.SQLException
public static java.util.List<java.lang.Integer> getNodeIdsWithIpLike(java.lang.String iplike)
throws java.sql.SQLException
java.sql.SQLException
public static Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(org.springframework.transaction.support.TransactionTemplate transTemplate,
org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
java.lang.String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] getNodesWithCategories(org.opennms.netmgt.dao.NodeDao nodeDao,
org.opennms.netmgt.dao.CategoryDao categoryDao,
java.lang.String[] categories1,
java.lang.String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
public static Node[] convertOnmsNodeCollectionToNodeArray(java.util.Collection<org.opennms.netmgt.model.OnmsNode> ourNodes)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||