@Service public class DefaultProvisionService extends Object implements ProvisionService, org.springframework.beans.factory.InitializingBean
Modifier and Type | Field and Description |
---|---|
static String |
PROVISIOND |
ABORT, DETECTOR_NAME, ERROR, FOREIGN_ID, FOREIGN_SOURCE, IP_ADDRESS, LOCATION, NODE_ID
Constructor and Description |
---|
DefaultProvisionService() |
public static final String PROVISIOND
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public boolean isDiscoveryEnabled()
isDiscoveryEnabled
isDiscoveryEnabled
in interface ProvisionService
@Transactional public void insertNode(OnmsNode node)
insertNode
in interface ProvisionService
@Transactional public void updateNode(OnmsNode node, String rescanExisting)
updateNode
in interface ProvisionService
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)@Transactional public void deleteNode(Integer nodeId)
deleteNode
in interface ProvisionService
@Transactional public void deleteInterface(Integer nodeId, String ipAddr)
deleteInterface
in interface ProvisionService
@Transactional public void deleteService(Integer nodeId, InetAddress addr, String svcName, boolean ignoreUnmanaged)
deleteService
in interface ProvisionService
nodeId
- the node containing the serviceaddr
- the IP address containing the servicesvcName
- the service to deleteignoreUnmanaged
- if true, cascade delete the containing interface if only unmanaged services remain@Transactional public OnmsIpInterface updateIpInterfaceAttributes(Integer nodeId, OnmsIpInterface scannedIface)
updateIpInterfaceAttributes
in interface ProvisionService
@Transactional public OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId, OnmsSnmpInterface snmpInterface)
updateSnmpInterfaceAttributes
in interface ProvisionService
@Transactional public OnmsMonitoredService addMonitoredService(Integer ipInterfaceId, String svcName)
addMonitoredService
in interface ProvisionService
@Transactional public OnmsMonitoredService addMonitoredService(Integer nodeId, String ipAddress, String svcName)
addMonitoredService
in interface ProvisionService
@Transactional public OnmsMonitoredService updateMonitoredServiceState(Integer nodeId, String ipAddress, String svcName)
updateMonitoredServiceState
in interface ProvisionService
@Transactional public void clearCache()
clearCache
clearCache
in interface ProvisionService
public OnmsMonitoringLocation createLocationIfNecessary(String locationName)
ProvisionService
OnmsMonitoringLocation
object with the ID 'locationId' in the
database and returns it. If there is no OnmsMonitoringLocation
with that name then
one is created using the name provided, saved in the database, and returned.createLocationIfNecessary
in interface ProvisionService
locationName
- The ID of the OnmsMonitoringLocation
that is neededOnmsMonitoringLocation
that will be saved to the database when the
transaction is committed.protected OnmsMonitoringLocation createLocationDefIfNecessary(OnmsMonitoringLocation location)
@Transactional public OnmsNode getRequisitionedNode(String foreignSource, String foreignId) throws ForeignSourceRepositoryException
getRequisitionedNode
in interface ProvisionService
ForeignSourceRepositoryException
@Transactional public OnmsServiceType createServiceTypeIfNecessary(String serviceName)
createServiceTypeIfNecessary
in interface ProvisionService
serviceName
- the name of the OnmsServiceType to look up@Transactional public OnmsCategory createCategoryIfNecessary(String name)
createCategoryIfNecessary
in interface ProvisionService
name
- the name of the OnmsCategory to look up@Transactional(readOnly=true) public Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
getForeignIdToNodeIdMap
in interface ProvisionService
@Transactional public void setNodeParentAndDependencies(String foreignSource, String foreignId, String parentForeignSource, String parentForeignId, String parentNodeLabel)
setNodeParentAndDependencies
in interface ProvisionService
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@Transactional(readOnly=true) public NodeScanSchedule getScheduleForNode(int nodeId, boolean force)
getScheduleForNode
in interface ProvisionService
@Transactional(readOnly=true) public List<NodeScanSchedule> getScheduleForNodes()
getScheduleForNodes
getScheduleForNodes
in interface ProvisionService
List
object.public void setForeignSourceRepository(ForeignSourceRepository foreignSourceRepository)
setForeignSourceRepository
in interface ProvisionService
public ForeignSourceRepository getForeignSourceRepository()
getForeignSourceRepository
ForeignSourceRepository
object.public Requisition loadRequisition(org.springframework.core.io.Resource resource)
loadRequisition
in interface ProvisionService
@Transactional public OnmsNode updateNodeAttributes(OnmsNode node)
updateNodeAttributes
in interface ProvisionService
public List<PluginConfig> getDetectorsForForeignSource(String foreignSourceName)
getDetectorsForForeignSource
in interface ProvisionService
public List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)
getNodePoliciesForForeignSource
in interface ProvisionService
public List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)
getIpInterfacePoliciesForForeignSource
in interface ProvisionService
public List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)
getSnmpInterfacePoliciesForForeignSource
in interface ProvisionService
public <T> List<T> getPluginsForForeignSource(Class<T> pluginClass, String foreignSourceName)
getPluginsForForeignSource
@Transactional public void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
deleteObsoleteInterfaces
in interface ProvisionService
@Transactional public void updateNodeScanStamp(Integer nodeId, Date scanStamp)
updateNodeScanStamp
in interface ProvisionService
@Transactional public OnmsIpInterface setIsPrimaryFlag(Integer nodeId, String ipAddress)
setIsPrimaryFlag
in interface ProvisionService
@Transactional public OnmsIpInterface getPrimaryInterfaceForNode(OnmsNode node)
getPrimaryInterfaceForNode
in interface ProvisionService
@Transactional public OnmsNode createUndiscoveredNode(String ipAddress, String foreignSource, String locationString)
createUndiscoveredNode
in interface ProvisionService
@Transactional public OnmsNode getNode(Integer nodeId)
getNode
in interface ProvisionService
@Transactional public OnmsNode getDbNodeInitCat(Integer nodeId)
getDbNodeInitCat
in interface ProvisionService
public void setHostnameResolver(HostnameResolver resolver)
setHostnameResolver
in interface ProvisionService
public HostnameResolver getHostnameResolver()
getHostnameResolver
in interface ProvisionService
public LocationAwareDetectorClient getLocationAwareDetectorClient()
getLocationAwareDetectorClient
in interface ProvisionService
public LocationAwareSnmpClient getLocationAwareSnmpClient()
getLocationAwareSnmpClient
in interface ProvisionService
public SnmpProfileMapper getSnmpProfileMapper()
getSnmpProfileMapper
in interface ProvisionService
public void setSnmpProfileMapper(SnmpProfileMapper snmpProfileMapper)
setSnmpProfileMapper
in interface ProvisionService
public void setTracer(io.opentracing.Tracer tracer)
setTracer
in interface ProvisionService
public LocationAwareDnsLookupClient getLocationAwareDnsLookupClient()
getLocationAwareDnsLookupClient
in interface ProvisionService
public void setMonitoringLocationDao(MonitoringLocationDao dao)
public void setNodeDao(NodeDao dao)
public void setIpInterfaceDao(IpInterfaceDao dao)
public void setSnmpInterfaceDao(SnmpInterfaceDao dao)
public void setMonitoredServiceDao(MonitoredServiceDao dao)
public void setServiceTypeDao(ServiceTypeDao dao)
public void setEventForwarder(EventForwarder eventForwarder)
public io.opentracing.Span buildAndStartSpan(String name, io.opentracing.SpanContext spanContext)
buildAndStartSpan
in interface ProvisionService
Copyright © 2021. All rights reserved.