|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.web.element.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 |
serviceId2NameMap
A mapping of service identifiers (integers) to service names (strings). |
protected static java.util.Map |
serviceName2IdMap
A mapping of service names (strings) to service identifiers (integers). |
Constructor Summary | |
private |
NetworkElementFactory()
Private, empty constructor so that this class cannot be instantiated. |
Method Summary | |
protected static void |
augmentInterfacesWithSnmpData(Interface[] intfs,
java.sql.Connection conn)
|
protected static void |
createServiceIdNameMaps()
|
static Interface[] |
getActiveInterfacesOnNode(int nodeId)
|
static Interface[] |
getAllInterfaces()
|
static Interface[] |
getAllInterfacesOnNode(int nodeId)
|
static Node[] |
getAllNodes()
Returns all non-deleted nodes. |
static Service[] |
getAllServices()
|
static java.lang.String |
getHostname(java.lang.String ipAddress)
Resolve an IP address to a DNS hostname via the database. |
static Interface |
getInterface(int nodeId,
java.lang.String ipAddress)
|
static Interface |
getInterface(int nodeId,
java.lang.String ipAddress,
int ifindex)
|
static Interface[] |
getInterfacesWithIpAddress(java.lang.String ipAddress)
|
static Node |
getNode(int nodeId)
|
static java.lang.String |
getNodeLabel(int nodeId)
Translate a node id into a human-readable node label. |
static Node[] |
getNodesLike(java.lang.String nodeLabel)
Returns all non-deleted nodes that have the given nodeLabel substring somewhere in their nodeLabel. |
static Node[] |
getNodesWithIpLike(java.lang.String iplike)
Returns all non-deleted nodes with an IP address like the rule given. |
static Node[] |
getNodesWithService(int serviceId)
Returns all non-deleted nodes that have the given service. |
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 |
getServiceIdToNameMap()
|
static java.lang.String |
getServiceNameFromId(int serviceId)
|
static java.util.Map |
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. |
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 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)
|
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 serviceName2IdMap
protected static java.util.Map serviceId2NameMap
Constructor Detail |
private NetworkElementFactory()
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 java.lang.String getHostname(java.lang.String ipAddress) 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[] 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 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[] 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 getServiceIdToNameMap() throws java.sql.SQLException
java.sql.SQLException
public static java.util.Map getServiceNameToIdMap() throws java.sql.SQLException
java.sql.SQLException
protected static void createServiceIdNameMaps() throws java.sql.SQLException
java.sql.SQLException
|
OpenNMS API 1.2.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |