@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.InitializingBeanExceptionpublic 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 ProvisionServicenode - 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 ProvisionServicenodeId - 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 ProvisionServicepublic OnmsMonitoringLocation createLocationIfNecessary(String locationName)
ProvisionServiceOnmsMonitoringLocation 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 ProvisionServicelocationName - 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 ProvisionServiceForeignSourceRepositoryException@Transactional public OnmsServiceType createServiceTypeIfNecessary(String serviceName)
createServiceTypeIfNecessary in interface ProvisionServiceserviceName - the name of the OnmsServiceType to look up@Transactional public OnmsCategory createCategoryIfNecessary(String name)
createCategoryIfNecessary in interface ProvisionServicename - 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 ProvisionServiceforeignSource - 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 ProvisionServiceList object.public void setForeignSourceRepository(ForeignSourceRepository foreignSourceRepository)
setForeignSourceRepository in interface ProvisionServicepublic 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 ProvisionServicepublic List<PluginConfig> getDetectorsForForeignSource(String foreignSourceName)
getDetectorsForForeignSource in interface ProvisionServicepublic List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)
getNodePoliciesForForeignSource in interface ProvisionServicepublic List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)
getIpInterfacePoliciesForForeignSource in interface ProvisionServicepublic List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)
getSnmpInterfacePoliciesForForeignSource in interface ProvisionServicepublic <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 ProvisionServicepublic void setHostnameResolver(HostnameResolver resolver)
setHostnameResolver in interface ProvisionServicepublic HostnameResolver getHostnameResolver()
getHostnameResolver in interface ProvisionServicepublic LocationAwareDetectorClient getLocationAwareDetectorClient()
getLocationAwareDetectorClient in interface ProvisionServicepublic LocationAwareSnmpClient getLocationAwareSnmpClient()
getLocationAwareSnmpClient in interface ProvisionServicepublic SnmpProfileMapper getSnmpProfileMapper()
getSnmpProfileMapper in interface ProvisionServicepublic void setSnmpProfileMapper(SnmpProfileMapper snmpProfileMapper)
setSnmpProfileMapper in interface ProvisionServicepublic void setTracer(io.opentracing.Tracer tracer)
setTracer in interface ProvisionServicepublic LocationAwareDnsLookupClient getLocationAwareDnsLookupClient()
getLocationAwareDnsLookupClient in interface ProvisionServicepublic 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 ProvisionServiceCopyright © 2022. All rights reserved.