Interface ProvisionService
-
- All Known Implementing Classes:
DefaultProvisionService
public interface ProvisionService
-
-
Field Summary
Fields Modifier and Type Field Description static StringABORTstatic StringDETECTOR_NAMEstatic StringERRORstatic StringFOREIGN_IDstatic StringFOREIGN_SOURCEstatic StringIP_ADDRESSstatic StringLOCATIONstatic StringNODE_ID
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description OnmsMonitoredServiceaddMonitoredService(Integer ipInterfaceId, String svcName, String monitorKey)OnmsMonitoredServiceaddMonitoredService(Integer nodeId, String ipAddress, String serviceName, String monitorKey)io.opentracing.SpanbuildAndStartSpan(String name, io.opentracing.SpanContext spanContext)voidclearCache()Clear the Hibernate object cache.OnmsCategorycreateCategoryIfNecessary(String name)Look up the OnmsCategory with the give name, creating one if none exists.OnmsMonitoringLocationcreateLocationIfNecessary(String locationId)Lookup a monitoring location in the database, creating it if necessary.OnmsServiceTypecreateServiceTypeIfNecessary(String serviceName)Look up the OnmsServiceType with the given name, creating one if it doesn't exist.OnmsNodecreateUndiscoveredNode(String ipAddress, String foreignSource, String location, String monitorKey)voiddeleteInterface(Integer nodeId, String ipAddr)voiddeleteNode(Integer nodeId)Delete the indicated node from the database.voiddeleteObsoleteInterfaces(Integer nodeId, Date scanStamp)voiddeleteService(Integer nodeId, InetAddress addr, String service, boolean ignoreUnmanaged)Delete the indicated service from the database.OnmsNodegetDbNodeInitCat(Integer nodeId)List<PluginConfig>getDetectorsForForeignSource(String foreignSource)Map<String,Integer>getForeignIdToNodeIdMap(String foreignSource)Creates a map of foreignIds to nodeIds for all nodes that have the indicated foreignSorce.HostnameResolvergetHostnameResolver()List<IpInterfacePolicy>getIpInterfacePoliciesForForeignSource(String foreignSourceName)LocationAwareDetectorClientgetLocationAwareDetectorClient()LocationAwareDnsLookupClientgetLocationAwareDnsLookupClient()LocationAwareSnmpClientgetLocationAwareSnmpClient()OnmsNodegetNode(Integer nodeId)List<NodePolicy>getNodePoliciesForForeignSource(String foreignSourceName)OnmsIpInterfacegetPrimaryInterfaceForNode(OnmsNode node)OnmsNodegetRequisitionedNode(String foreignSource, String foreignId)NodeScanSchedulegetScheduleForNode(int nodeId, boolean force, String monitorKey)List<NodeScanSchedule>getScheduleForNodes(String monitorKey)Returns a list of scheduled nodes.List<SnmpInterfacePolicy>getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)SnmpProfileMappergetSnmpProfileMapper()voidinsertNode(OnmsNode node, String monitorKey)Insert the provided node into the databasebooleanisDiscoveryEnabled()RequisitionloadRequisition(org.springframework.core.io.Resource resource)voidsetForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)voidsetHostnameResolver(HostnameResolver resolver)OnmsIpInterfacesetIsPrimaryFlag(Integer nodeId, String ipAddress)voidsetNodeParentAndDependencies(String foreignSource, String foreignId, String parentForeignSource, String parentForeignId, String parentNodeLabel)Sets the parent of the node and adds the relationship to the path element for the node.voidsetSnmpProfileMapper(SnmpProfileMapper snmpProfileMapper)voidsetTracer(io.opentracing.Tracer tracer)OnmsIpInterfaceupdateIpInterfaceAttributes(Integer nodeId, OnmsIpInterface ipInterface, String monitorKey)OnmsMonitoredServiceupdateMonitoredServiceState(Integer nodeId, String ipAddress, String serviceName)voidupdateNode(OnmsNode node, String rescanExisting, String monitorKey)Update the database entry for the given node.OnmsNodeupdateNodeAttributes(OnmsNode node)voidupdateNodeScanStamp(Integer nodeId, Date scanStamp)OnmsSnmpInterfaceupdateSnmpInterfaceAttributes(Integer nodeId, OnmsSnmpInterface snmpInterface)
-
-
-
Field Detail
-
NODE_ID
static final String NODE_ID
- See Also:
- Constant Field Values
-
LOCATION
static final String LOCATION
- See Also:
- Constant Field Values
-
IP_ADDRESS
static final String IP_ADDRESS
- See Also:
- Constant Field Values
-
FOREIGN_ID
static final String FOREIGN_ID
- See Also:
- Constant Field Values
-
FOREIGN_SOURCE
static final String FOREIGN_SOURCE
- See Also:
- Constant Field Values
-
DETECTOR_NAME
static final String DETECTOR_NAME
- See Also:
- Constant Field Values
-
ABORT
static final String ABORT
- See Also:
- Constant Field Values
-
ERROR
static final String ERROR
- See Also:
- Constant Field Values
-
-
Method Detail
-
isDiscoveryEnabled
boolean isDiscoveryEnabled()
-
clearCache
void clearCache()
Clear the Hibernate object cache. This is used to clear the object cache created by Hibernate. This is needed so large imports don't end up caching the entire database when it has no intention of using a node's data again. This is needed only to help memory performance.
-
createLocationIfNecessary
@Transactional OnmsMonitoringLocation createLocationIfNecessary(String locationId)
Lookup a monitoring location in the database, creating it if necessary. This method looks up theOnmsMonitoringLocationobject with the ID 'locationId' in the database and returns it. If there is noOnmsMonitoringLocationwith that name then one is created using the name provided, saved in the database, and returned.- Parameters:
locationId- The ID of theOnmsMonitoringLocationthat is needed- Returns:
- a new
OnmsMonitoringLocationthat will be saved to the database when the transaction is committed.
-
updateNode
@Transactional void updateNode(OnmsNode node, String rescanExisting, String monitorKey)
Update the database entry for the given node. The node supplied is used to update the database. Entries that have been change in the node are copied into the database. It is assumed that the node passed in has been previously loaded from the database and modified.- Parameters:
node- The node that has been updated and should be written to the databaserescanExisting- true, if the node must be rescanned. false, if the node should not be rescanned (perform only add/delete operations on the DB) dbonly, if the node should not be rescanned (perform all DB operations)
-
updateIpInterfaceAttributes
@Transactional OnmsIpInterface updateIpInterfaceAttributes(Integer nodeId, OnmsIpInterface ipInterface, String monitorKey)
-
updateSnmpInterfaceAttributes
@Transactional OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId, OnmsSnmpInterface snmpInterface)
-
addMonitoredService
@Transactional OnmsMonitoredService addMonitoredService(Integer ipInterfaceId, String svcName, String monitorKey)
-
addMonitoredService
@Transactional OnmsMonitoredService addMonitoredService(Integer nodeId, String ipAddress, String serviceName, String monitorKey)
-
updateMonitoredServiceState
@Transactional OnmsMonitoredService updateMonitoredServiceState(Integer nodeId, String ipAddress, String serviceName)
-
getRequisitionedNode
@Transactional OnmsNode getRequisitionedNode(String foreignSource, String foreignId)
-
deleteNode
@Transactional void deleteNode(Integer nodeId)
Delete the indicated node from the database.
-
deleteService
@Transactional void deleteService(Integer nodeId, InetAddress addr, String service, boolean ignoreUnmanaged)
Delete the indicated service from the database. If the service is the last service on the interface, delete the interface as well. If the interface is the last interface on the node, delete the node as well.- Parameters:
nodeId- the node containing the serviceaddr- the IP address containing the serviceservice- the service to deleteignoreUnmanaged- if true, cascade delete the containing interface if only unmanaged services remain
-
insertNode
@Transactional void insertNode(OnmsNode node, String monitorKey)
Insert the provided node into the database
-
createServiceTypeIfNecessary
@Transactional OnmsServiceType createServiceTypeIfNecessary(String serviceName)
Look up the OnmsServiceType with the given name, creating one if it doesn't exist.- Parameters:
serviceName- the name of the OnmsServiceType to look up- Returns:
- a OnmsServiceType object with the given name, if none existed in the database then a new one will been created and saved in the database.
-
createCategoryIfNecessary
@Transactional OnmsCategory createCategoryIfNecessary(String name)
Look up the OnmsCategory with the give name, creating one if none exists.- Parameters:
name- the name of the OnmsCategory to look up- Returns:
- an OnmsCategory that represents the given name, if none existed in the database a new one will have been created.
-
getForeignIdToNodeIdMap
@Transactional(readOnly=true) Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
Creates a map of foreignIds to nodeIds for all nodes that have the indicated foreignSorce.
-
setNodeParentAndDependencies
@Transactional void setNodeParentAndDependencies(String foreignSource, String foreignId, String parentForeignSource, String parentForeignId, String parentNodeLabel)
Sets the parent of the node and adds the relationship to the path element for the node. The foreignId is used to reference the node and the parentForeignId and the parentNodeLabel are used to locate the parentNodeId- Parameters:
foreignSource- the foreignSource to use when looking for the nodeId and parentNodeId by foreignId.foreignId- the foreignId for the node being setparentForeignId- the foreignId of the parent nodeparentNodeLabel- if the parent node cannot be found using its foreignId then an attempt to locate it using the its nodeLabel is made
-
getScheduleForNodes
List<NodeScanSchedule> getScheduleForNodes(String monitorKey)
Returns a list of scheduled nodes.
-
getScheduleForNode
NodeScanSchedule getScheduleForNode(int nodeId, boolean force, String monitorKey)
-
setForeignSourceRepository
void setForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)
-
loadRequisition
Requisition loadRequisition(org.springframework.core.io.Resource resource)
-
getDetectorsForForeignSource
List<PluginConfig> getDetectorsForForeignSource(String foreignSource)
-
getNodePoliciesForForeignSource
List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)
-
getIpInterfacePoliciesForForeignSource
List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)
-
getSnmpInterfacePoliciesForForeignSource
List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)
-
deleteObsoleteInterfaces
@Transactional void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
-
setIsPrimaryFlag
@Transactional OnmsIpInterface setIsPrimaryFlag(Integer nodeId, String ipAddress)
-
getPrimaryInterfaceForNode
@Transactional OnmsIpInterface getPrimaryInterfaceForNode(OnmsNode node)
-
createUndiscoveredNode
@Transactional OnmsNode createUndiscoveredNode(String ipAddress, String foreignSource, String location, String monitorKey)
-
getHostnameResolver
HostnameResolver getHostnameResolver()
-
setHostnameResolver
void setHostnameResolver(HostnameResolver resolver)
-
getLocationAwareDetectorClient
LocationAwareDetectorClient getLocationAwareDetectorClient()
-
getLocationAwareSnmpClient
LocationAwareSnmpClient getLocationAwareSnmpClient()
-
getLocationAwareDnsLookupClient
LocationAwareDnsLookupClient getLocationAwareDnsLookupClient()
-
getSnmpProfileMapper
SnmpProfileMapper getSnmpProfileMapper()
-
setSnmpProfileMapper
void setSnmpProfileMapper(SnmpProfileMapper snmpProfileMapper)
-
setTracer
void setTracer(io.opentracing.Tracer tracer)
-
buildAndStartSpan
io.opentracing.Span buildAndStartSpan(String name, io.opentracing.SpanContext spanContext)
-
-