@Transactional(readOnly=true) public class NetworkElementFactory extends Object implements org.springframework.beans.factory.InitializingBean, NetworkElementFactoryInterface
Modifier and Type | Class and Description |
---|---|
static class |
NetworkElementFactory.InterfaceComparator |
Constructor and Description |
---|
NetworkElementFactory() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
Collection<OnmsOutage> |
currentOutagesForServiceFromPerspectivePoller(OnmsMonitoredService service)
Return all current open outages for the given service be it detected from local or from perspective.
|
Interface[] |
getActiveInterfacesOnNode(int nodeId)
getActiveInterfacesOnNode
|
List<OnmsApplication> |
getAllApplications() |
Interface[] |
getAllInterfaces()
getAllInterfaces
|
Interface[] |
getAllInterfaces(boolean includeSnmp) |
Interface[] |
getAllInterfacesOnNode(int nodeId)
getAllInterfacesOnNode
|
Interface[] |
getAllManagedIpInterfaces(boolean includeSNMP)
getAllManagedIpInterfaces
|
Interface[] |
getAllManagedIpInterfacesLike(String ipHost)
Returns all managed interfaces that matches the ipHost String to either
the ipHost or ipAddress field.
|
List<OnmsNode> |
getAllNodes()
Returns all non-deleted nodes.
|
List<OnmsNode> |
getAllNodes(int serviceId)
getAllNodes
|
Service[] |
getAllServices()
getAllServices
|
Interface[] |
getAllSnmpInterfacesOnNode(int nodeId)
Returns all SNMP interfaces on a node
|
Map<OnmsMonitoredService,Map<String,Double>> |
getApplicationServiceStatus(OnmsApplication onmsApplication,
long start,
long end) |
ApplicationStatus |
getApplicationStatus(OnmsApplication onmsApplication,
long start,
long end) |
List<String> |
getCategories() |
String |
getHostname(String ipAddress)
Resolve an IP address to a DNS hostname via the database.
|
Integer |
getIfIndex(int ipinterfaceid) |
Integer |
getIfIndex(int nodeID,
String ipaddr) |
static NetworkElementFactoryInterface |
getInstance(org.springframework.context.ApplicationContext appContext) |
static NetworkElementFactoryInterface |
getInstance(javax.servlet.ServletContext servletContext) |
Interface |
getInterface(int ipInterfaceId)
getInterface
|
Interface |
getInterface(int nodeId,
String ipAddress)
getInterface
|
Interface |
getInterface(int nodeId,
String ipAddress,
int ifIndex)
getInterface
|
Interface[] |
getInterfacesWithIfAlias(int nodeId,
String ifAlias) |
Interface[] |
getInterfacesWithIpAddress(String ipAddress)
getInterfacesWithIpAddress
|
String |
getIpPrimaryAddress(int nodeId)
Find the IP address of the primary SNMP interface.
|
List<OnmsMonitoringLocation> |
getMonitoringLocations() |
List<OnmsMonitoringSystem> |
getMonitoringSystems() |
OnmsNode |
getNode(int nodeId)
Get a node based on it's node ID
|
OnmsNode |
getNode(String lookupCriteria)
Get a node based on it's node ID or foreignSource:foreignId
|
List<Integer> |
getNodeIdsWithIpLike(String iplike)
Returns all non-deleted nodes with an IP address like the rule given.
|
String |
getNodeLabel(int nodeId) |
String |
getNodeLocation(int nodeId)
Get the location name associated with the node.
|
List<OnmsNode> |
getNodesFromPhysaddr(String physAddr)
getNodesFromPhysaddr
|
List<OnmsNode> |
getNodesLike(String nodeLabel)
Returns all non-deleted nodes that have the given nodeLabel substring
somewhere in their nodeLabel.
|
List<OnmsNode> |
getNodesLike(String nodeLabel,
int serviceId)
getNodesLike
|
List<OnmsNode> |
getNodesLikeAndIpLike(String nodeLabel,
String iplike,
int serviceId)
getNodesLikeAndIpLike
|
List<OnmsNode> |
getNodesWithCategories(String[] categories,
boolean onlyNodesWithDownAggregateStatus)
getNodesWithCategories
|
List<OnmsNode> |
getNodesWithCategories(String[] categories1,
String[] categories2,
boolean onlyNodesWithDownAggregateStatus)
getNodesWithCategories
|
List<OnmsNode> |
getNodesWithIfAlias(String ifAlias)
Returns all non-deleted nodes that contain the given string in an ifAlias
|
List<OnmsNode> |
getNodesWithIpLike(String iplike) |
List<OnmsNode> |
getNodesWithIpLike(String iplike,
int serviceId)
getNodesWithIpLike
|
List<OnmsNode> |
getNodesWithPhysAddr(String macAddr)
Returns all non-deleted nodes that have the given mac.
|
List<OnmsNode> |
getNodesWithPhysAddrAtInterface(String macAddr)
Deprecated.
OnmsNode.arpInterface went away, so we only search snmpInterfaces
|
List<OnmsNode> |
getNodesWithPhysAddrFromSnmpInterface(String macAddr)
Deprecated.
OnmsNode.arpInterface went away, so we only search snmpInterfaces
|
List<OnmsNode> |
getNodesWithService(int serviceId)
Returns all non-deleted nodes that have the given service.
|
Service |
getService(int ifServiceId)
Return the service specified by the node identifier, IP address, and
service identifier.
|
Service |
getService(int nodeId,
String ipAddress,
int serviceId)
Return the service specified by the node identifier, IP address, and
service identifier.
|
int |
getServiceIdFromName(String serviceName)
getServiceIdFromName
|
Map<Integer,String> |
getServiceIdToNameMap()
getServiceIdToNameMap
|
String |
getServiceNameFromId(int serviceId)
getServiceNameFromId
|
Map<String,Integer> |
getServiceNameToIdMap()
getServiceNameToIdMap
|
Service[] |
getServicesOnInterface(int nodeId,
String ipAddress)
getServicesOnInterface
|
Service[] |
getServicesOnInterface(int nodeId,
String ipAddress,
boolean includeDeletions)
getServicesOnInterface
|
Service[] |
getServicesOnNode(int nodeId)
Get the list of all services on a given node.
|
Service[] |
getServicesOnNode(int nodeId,
int serviceId)
Get the list of all instances of a specific service on a given node.
|
Interface |
getSnmpInterface(int nodeId,
int ifIndex)
Get interface from snmpinterface table.
|
boolean |
nodeExistsInRequisition(String foreignSource,
String foreignId) |
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public static NetworkElementFactoryInterface getInstance(javax.servlet.ServletContext servletContext)
public static NetworkElementFactoryInterface getInstance(org.springframework.context.ApplicationContext appContext)
public String getNodeLabel(int nodeId)
getNodeLabel
in interface NetworkElementFactoryInterface
public String getNodeLocation(int nodeId)
NetworkElementFactoryInterface
getNodeLocation
in interface NetworkElementFactoryInterface
nodeId
- the node's IDpublic String getIpPrimaryAddress(int nodeId)
NetworkElementFactoryInterface
getIpPrimaryAddress
in interface NetworkElementFactoryInterface
nodeId
- an int.public OnmsNode getNode(int nodeId)
NetworkElementFactoryInterface
getNode
in interface NetworkElementFactoryInterface
nodeId
- an intOnmsNode
objectpublic OnmsNode getNode(String lookupCriteria)
NetworkElementFactoryInterface
getNode
in interface NetworkElementFactoryInterface
lookupCriteria
- the criteria, either the node ID, or a colon-separated string of foreignSource:foreignIdOnmsNode
objectpublic List<OnmsNode> getAllNodes()
NetworkElementFactoryInterface
getAllNodes
in interface NetworkElementFactoryInterface
OnmsNode
objects.public List<OnmsNode> getNodesLike(String nodeLabel)
NetworkElementFactoryInterface
getNodesLike
in interface NetworkElementFactoryInterface
nodeLabel
- a String
object.OnmsNode
objects.public List<OnmsNode> getNodesWithIpLike(String iplike)
getNodesWithIpLike
in interface NetworkElementFactoryInterface
public List<OnmsNode> getNodesWithService(int serviceId)
NetworkElementFactoryInterface
getNodesWithService
in interface NetworkElementFactoryInterface
serviceId
- a int.OnmsNode
objects.public List<OnmsNode> getNodesWithPhysAddr(String macAddr)
NetworkElementFactoryInterface
getNodesWithPhysAddr
in interface NetworkElementFactoryInterface
macAddr
- a String
object.OnmsNode
objects.public List<OnmsNode> getNodesWithPhysAddrAtInterface(String macAddr)
NetworkElementFactoryInterface
getNodesWithPhysAddrAtInterface
in interface NetworkElementFactoryInterface
macAddr
- public List<OnmsNode> getNodesWithPhysAddrFromSnmpInterface(String macAddr)
NetworkElementFactoryInterface
getNodesWithPhysAddrFromSnmpInterface
in interface NetworkElementFactoryInterface
macAddr
- public List<OnmsNode> getNodesWithIfAlias(String ifAlias)
NetworkElementFactoryInterface
getNodesWithIfAlias
in interface NetworkElementFactoryInterface
ifAlias
- a String
object.public String getHostname(String ipAddress)
NetworkElementFactoryInterface
getHostname
in interface NetworkElementFactoryInterface
ipAddress
- a String
object.String
object.public Integer getIfIndex(int ipinterfaceid)
getIfIndex
in interface NetworkElementFactoryInterface
public Integer getIfIndex(int nodeID, String ipaddr)
getIfIndex
in interface NetworkElementFactoryInterface
public Interface getInterface(int ipInterfaceId)
NetworkElementFactoryInterface
getInterface
getInterface
in interface NetworkElementFactoryInterface
ipInterfaceId
- a int.Interface
object.public Interface getInterface(int nodeId, String ipAddress)
NetworkElementFactoryInterface
getInterface
getInterface
in interface NetworkElementFactoryInterface
nodeId
- a int.ipAddress
- a String
object.Interface
object.public Interface getInterface(int nodeId, String ipAddress, int ifIndex)
NetworkElementFactoryInterface
getInterface
getInterface
in interface NetworkElementFactoryInterface
nodeId
- a int.ipAddress
- a String
object.Interface
object.public Interface getSnmpInterface(int nodeId, int ifIndex)
NetworkElementFactoryInterface
getSnmpInterface
in interface NetworkElementFactoryInterface
nodeId
- a int.ifIndex
- a int.public Interface[] getInterfacesWithIpAddress(String ipAddress)
NetworkElementFactoryInterface
getInterfacesWithIpAddress
getInterfacesWithIpAddress
in interface NetworkElementFactoryInterface
ipAddress
- a String
object.Interface
objects.public Interface[] getInterfacesWithIfAlias(int nodeId, String ifAlias)
getInterfacesWithIfAlias
in interface NetworkElementFactoryInterface
public Interface[] getAllInterfacesOnNode(int nodeId)
NetworkElementFactoryInterface
getAllInterfacesOnNode
getAllInterfacesOnNode
in interface NetworkElementFactoryInterface
nodeId
- a int.Interface
objects.public Interface[] getAllSnmpInterfacesOnNode(int nodeId)
NetworkElementFactoryInterface
getAllSnmpInterfacesOnNode
in interface NetworkElementFactoryInterface
nodeId
- a int.public Interface[] getActiveInterfacesOnNode(int nodeId)
NetworkElementFactoryInterface
getActiveInterfacesOnNode
getActiveInterfacesOnNode
in interface NetworkElementFactoryInterface
nodeId
- a int.Interface
objects.public Interface[] getAllInterfaces()
NetworkElementFactoryInterface
getAllInterfaces
getAllInterfaces
in interface NetworkElementFactoryInterface
Interface
objects.public Interface[] getAllInterfaces(boolean includeSnmp)
getAllInterfaces
in interface NetworkElementFactoryInterface
public Interface[] getAllManagedIpInterfaces(boolean includeSNMP)
NetworkElementFactoryInterface
getAllManagedIpInterfaces
getAllManagedIpInterfaces
in interface NetworkElementFactoryInterface
includeSNMP
- a boolean.Interface
objects.public Interface[] getAllManagedIpInterfacesLike(String ipHost)
NetworkElementFactoryInterface
getAllManagedIpInterfacesLike
in interface NetworkElementFactoryInterface
Interface
objectspublic Service getService(int nodeId, String ipAddress, int serviceId)
NetworkElementFactoryInterface
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.
getService
in interface NetworkElementFactoryInterface
nodeId
- a int.ipAddress
- a String
object.serviceId
- a int.Service
object.public Service getService(int ifServiceId)
NetworkElementFactoryInterface
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.
getService
in interface NetworkElementFactoryInterface
ifServiceId
- a int.Service
object.public Service[] getAllServices()
NetworkElementFactoryInterface
getAllServices
getAllServices
in interface NetworkElementFactoryInterface
Service
objects.public Service[] getServicesOnInterface(int nodeId, String ipAddress)
NetworkElementFactoryInterface
getServicesOnInterface
getServicesOnInterface
in interface NetworkElementFactoryInterface
nodeId
- a int.ipAddress
- a String
object.Service
objects.public Service[] getServicesOnInterface(int nodeId, String ipAddress, boolean includeDeletions)
NetworkElementFactoryInterface
getServicesOnInterface
getServicesOnInterface
in interface NetworkElementFactoryInterface
nodeId
- a int.ipAddress
- a String
object.includeDeletions
- a boolean.Service
objects.public Service[] getServicesOnNode(int nodeId)
NetworkElementFactoryInterface
getServicesOnNode
in interface NetworkElementFactoryInterface
nodeId
- a int.Service
objects.public Service[] getServicesOnNode(int nodeId, int serviceId)
NetworkElementFactoryInterface
getServicesOnNode
in interface NetworkElementFactoryInterface
nodeId
- a int.serviceId
- a int.Service
objects.public String getServiceNameFromId(int serviceId)
NetworkElementFactoryInterface
getServiceNameFromId
getServiceNameFromId
in interface NetworkElementFactoryInterface
serviceId
- a int.String
object.public int getServiceIdFromName(String serviceName)
NetworkElementFactoryInterface
getServiceIdFromName
getServiceIdFromName
in interface NetworkElementFactoryInterface
serviceName
- a String
object.public Map<Integer,String> getServiceIdToNameMap()
NetworkElementFactoryInterface
getServiceIdToNameMap
getServiceIdToNameMap
in interface NetworkElementFactoryInterface
public Map<String,Integer> getServiceNameToIdMap()
NetworkElementFactoryInterface
getServiceNameToIdMap
getServiceNameToIdMap
in interface NetworkElementFactoryInterface
public List<OnmsNode> getNodesLikeAndIpLike(String nodeLabel, String iplike, int serviceId)
NetworkElementFactoryInterface
getNodesLikeAndIpLike
getNodesLikeAndIpLike
in interface NetworkElementFactoryInterface
nodeLabel
- a String
object.iplike
- a String
object.serviceId
- a int.OnmsNode
objects.public List<OnmsNode> getNodesLike(String nodeLabel, int serviceId)
NetworkElementFactoryInterface
getNodesLike
getNodesLike
in interface NetworkElementFactoryInterface
nodeLabel
- a String
object.serviceId
- a int.OnmsNode
objects.public List<OnmsNode> getNodesWithIpLike(String iplike, int serviceId)
NetworkElementFactoryInterface
getNodesWithIpLike
getNodesWithIpLike
in interface NetworkElementFactoryInterface
iplike
- a String
object.serviceId
- a int.OnmsNode
objects.public List<OnmsNode> getAllNodes(int serviceId)
NetworkElementFactoryInterface
getAllNodes
getAllNodes
in interface NetworkElementFactoryInterface
serviceId
- a int.OnmsNode
objects.public List<OnmsNode> getNodesFromPhysaddr(String physAddr)
NetworkElementFactoryInterface
getNodesFromPhysaddr
getNodesFromPhysaddr
in interface NetworkElementFactoryInterface
physAddr
- a String
object.OnmsNode
objects.public List<Integer> getNodeIdsWithIpLike(String iplike)
NetworkElementFactoryInterface
getNodeIdsWithIpLike
in interface NetworkElementFactoryInterface
iplike
- a String
object.List
object.public List<OnmsNode> getNodesWithCategories(String[] categories, boolean onlyNodesWithDownAggregateStatus)
NetworkElementFactoryInterface
getNodesWithCategories
getNodesWithCategories
in interface NetworkElementFactoryInterface
onlyNodesWithDownAggregateStatus
- a boolean.OnmsNode
objects.public List<OnmsNode> getNodesWithCategories(String[] categories1, String[] categories2, boolean onlyNodesWithDownAggregateStatus)
NetworkElementFactoryInterface
getNodesWithCategories
getNodesWithCategories
in interface NetworkElementFactoryInterface
categories1
- an array of String
objects.categories2
- an array of String
objects.onlyNodesWithDownAggregateStatus
- a boolean.OnmsNode
objects.public List<OnmsMonitoringLocation> getMonitoringLocations()
getMonitoringLocations
in interface NetworkElementFactoryInterface
public List<OnmsMonitoringSystem> getMonitoringSystems()
getMonitoringSystems
in interface NetworkElementFactoryInterface
public boolean nodeExistsInRequisition(String foreignSource, String foreignId)
nodeExistsInRequisition
in interface NetworkElementFactoryInterface
public List<String> getCategories()
getCategories
in interface NetworkElementFactoryInterface
public Collection<OnmsOutage> currentOutagesForServiceFromPerspectivePoller(OnmsMonitoredService service)
NetworkElementFactoryInterface
currentOutagesForServiceFromPerspectivePoller
in interface NetworkElementFactoryInterface
public List<OnmsApplication> getAllApplications()
getAllApplications
in interface NetworkElementFactoryInterface
public ApplicationStatus getApplicationStatus(OnmsApplication onmsApplication, long start, long end)
getApplicationStatus
in interface NetworkElementFactoryInterface
public Map<OnmsMonitoredService,Map<String,Double>> getApplicationServiceStatus(OnmsApplication onmsApplication, long start, long end)
getApplicationServiceStatus
in interface NetworkElementFactoryInterface
Copyright © 2021. All rights reserved.