org.opennms.netmgt.provision.service
Interface ProvisionService

All Known Implementing Classes:
DefaultProvisionService

public interface ProvisionService

ProvisionService interface.

Version:
$Id: $
Author:
ranger

Method Summary
 OnmsMonitoredService addMonitoredService(Integer ipInterfaceId, String svcName)
          addMonitoredService
 OnmsMonitoredService addMonitoredService(Integer nodeId, String ipAddress, String serviceName)
          addMonitoredService
 void clearCache()
          Clear the Hibernate object cache.
 OnmsCategory createCategoryIfNecessary(String name)
          Look up the OnmsCategory with the give name, creating one if none exists.
 OnmsDistPoller createDistPollerIfNecessary(String dpName, String dpAddr)
          Lookup a distPoller in the database, creating it if necessary.
 OnmsServiceType createServiceTypeIfNecessary(String serviceName)
          Look up the OnmsServiceType with the given name, creating one if it doesn't exist.
 OnmsNode createUndiscoveredNode(String ipAddress)
          createUndiscoveredNode
 void deleteInterface(Integer nodeId, String ipAddr)
          deleteInterface
 void deleteNode(Integer nodeId)
          Delete the indicated node form the database.
 void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
          deleteObsoleteInterfaces
 void deleteService(Integer nodeId, String ipAddr, String service)
          deleteService
 OnmsNode getDbNodeInitCat(Integer nodeId)
          getDbNodeInitCat
 List<ServiceDetector> getDetectorsForForeignSource(String foreignSource)
          getDetectorsForForeignSource
 Map<String,Integer> getForeignIdToNodeIdMap(String foreignSource)
          Creates a map of foreignIds to nodeIds for all nodes that have the indicated foreignSorce.
 List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)
          getIpInterfacePoliciesForForeignSource
 OnmsNode getNode(Integer nodeId)
          getNode
 List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)
          getNodePoliciesForForeignSource
 OnmsIpInterface getPrimaryInterfaceForNode(OnmsNode node)
          getPrimaryInterfaceForNode
 OnmsNode getRequisitionedNode(String foreignSource, String foreignId)
          getRequisitionedNode
 NodeScanSchedule getScheduleForNode(int nodeId, boolean force)
          getScheduleForNode
 List<NodeScanSchedule> getScheduleForNodes()
          Returns a list of scheduled nodes.
 List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)
          getSnmpInterfacePoliciesForForeignSource
 void insertNode(OnmsNode node)
          Insert the provided node into the database
 boolean isDiscoveryEnabled()
          isDiscoveryEnabled
 Requisition loadRequisition(org.springframework.core.io.Resource resource)
          loadRequisition
 void setForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)
          setForeignSourceRepository
 OnmsIpInterface setIsPrimaryFlag(Integer nodeId, String ipAddress)
          setIsPrimaryFlag
 void setNodeParentAndDependencies(String foreignSource, String foreignId, String parentForeignId, String parentNodeLabel)
          Sets the parent of the node and adds the relationship to the path element for the node.
 OnmsIpInterface updateIpInterfaceAttributes(Integer nodeId, OnmsIpInterface ipInterface)
          updateIpInterfaceAttributes
 OnmsMonitoredService updateMonitoredServiceState(Integer nodeId, String ipAddress, String serviceName)
          updateMonitoredServiceState
 void updateNode(OnmsNode node)
          Update the database entry for the given node.
 OnmsNode updateNodeAttributes(OnmsNode node)
          updateNodeAttributes
 void updateNodeScanStamp(Integer nodeId, Date scanStamp)
          updateNodeScanStamp
 OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId, OnmsSnmpInterface snmpInterface)
          updateSnmpInterfaceAttributes
 

Method Detail

isDiscoveryEnabled

boolean isDiscoveryEnabled()

isDiscoveryEnabled

Returns:
a boolean.

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.


createDistPollerIfNecessary

@Transactional
OnmsDistPoller createDistPollerIfNecessary(String dpName,
                                                         String dpAddr)
Lookup a distPoller in the database, creating it if necessary. This method looks up the OnmsDistPoller object with the name 'dpName' in the database and returns it. If there is not distPoller with that name that one is created using the name and the address provided, saved in the database, and returned.

Parameters:
dpName - The name of the distPoller that is needed
dpAddr - The address to give the new distPoller if it is necessary to create one
Returns:
a new distPoller that will be saved to the database when the transaction is committed.

updateNode

@Transactional
void updateNode(OnmsNode node)
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 database

updateNodeAttributes

@Transactional
OnmsNode updateNodeAttributes(OnmsNode node)

updateNodeAttributes

Parameters:
node - a OnmsNode object.
Returns:
a OnmsNode object.

getDbNodeInitCat

@Transactional
OnmsNode getDbNodeInitCat(Integer nodeId)

getDbNodeInitCat

Parameters:
nodeId - a Integer object.
Returns:
a OnmsNode object.

updateIpInterfaceAttributes

@Transactional
OnmsIpInterface updateIpInterfaceAttributes(Integer nodeId,
                                                          OnmsIpInterface ipInterface)

updateIpInterfaceAttributes

Parameters:
nodeId - a Integer object.
ipInterface - a OnmsIpInterface object.
Returns:
a OnmsIpInterface object.

updateSnmpInterfaceAttributes

@Transactional
OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId,
                                                              OnmsSnmpInterface snmpInterface)

updateSnmpInterfaceAttributes

Parameters:
nodeId - a Integer object.
snmpInterface - a OnmsSnmpInterface object.
Returns:
a OnmsSnmpInterface object.

addMonitoredService

@Transactional
OnmsMonitoredService addMonitoredService(Integer ipInterfaceId,
                                                       String svcName)

addMonitoredService

Parameters:
ipInterfaceId - a Integer object.
svcName - a String object.
Returns:
a OnmsMonitoredService object.

addMonitoredService

@Transactional
OnmsMonitoredService addMonitoredService(Integer nodeId,
                                                       String ipAddress,
                                                       String serviceName)

addMonitoredService

Parameters:
nodeId - a Integer object.
ipAddress - a String object.
serviceName - a String object.
Returns:
a OnmsMonitoredService object.

getRequisitionedNode

@Transactional
OnmsNode getRequisitionedNode(String foreignSource,
                                            String foreignId)

getRequisitionedNode

Parameters:
foreignSource - a String object.
foreignId - a String object.
Returns:
a OnmsNode object.

deleteNode

@Transactional
void deleteNode(Integer nodeId)
Delete the indicated node form the database.

Parameters:
nodeId - a Integer object.

deleteInterface

@Transactional
void deleteInterface(Integer nodeId,
                                   String ipAddr)

deleteInterface

Parameters:
nodeId - a Integer object.
ipAddr - a String object.

deleteService

@Transactional
void deleteService(Integer nodeId,
                                 String ipAddr,
                                 String service)

deleteService

Parameters:
nodeId - a Integer object.
ipAddr - a String object.
service - a String object.

insertNode

@Transactional
void insertNode(OnmsNode node)
Insert the provided node into the database

Parameters:
node - a OnmsNode object.

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.

updateMonitoredServiceState

@Transactional
OnmsMonitoredService updateMonitoredServiceState(Integer nodeId,
                                                               String ipAddress,
                                                               String serviceName)

updateMonitoredServiceState

Parameters:
nodeId - a Integer object.
ipAddress - a String object.
serviceName - a String object.
Returns:
a OnmsMonitoredService object.

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:
a OnmsCategor 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.

Parameters:
foreignSource - a String object.
Returns:
a Map object.

setNodeParentAndDependencies

@Transactional
void setNodeParentAndDependencies(String foreignSource,
                                                String foreignId,
                                                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 set
parentForeignId - the foreignId of the parent node
parentNodeLabel - 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()
Returns a list of scheduled nodes.

Returns:
a List object.

getScheduleForNode

NodeScanSchedule getScheduleForNode(int nodeId,
                                    boolean force)

getScheduleForNode

Parameters:
nodeId - a int.
force - a boolean.
Returns:
a NodeScanSchedule object.

setForeignSourceRepository

void setForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)

setForeignSourceRepository

Parameters:
foriengSourceRepository - a ForeignSourceRepository object.

loadRequisition

Requisition loadRequisition(org.springframework.core.io.Resource resource)

loadRequisition

Parameters:
resource - a Resource object.
Returns:
a Requisition object.

getDetectorsForForeignSource

List<ServiceDetector> getDetectorsForForeignSource(String foreignSource)

getDetectorsForForeignSource

Parameters:
foreignSource - a String object.
Returns:
a List object.

getNodePoliciesForForeignSource

List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)

getNodePoliciesForForeignSource

Parameters:
foreignSourceName - a String object.
Returns:
a List object.

getIpInterfacePoliciesForForeignSource

List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)

getIpInterfacePoliciesForForeignSource

Parameters:
foreignSourceName - a String object.
Returns:
a List object.

getSnmpInterfacePoliciesForForeignSource

List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)

getSnmpInterfacePoliciesForForeignSource

Parameters:
foreignSourceName - a String object.
Returns:
a List object.

updateNodeScanStamp

@Transactional
void updateNodeScanStamp(Integer nodeId,
                                       Date scanStamp)

updateNodeScanStamp

Parameters:
nodeId - a Integer object.
scanStamp - a Date object.

deleteObsoleteInterfaces

@Transactional
void deleteObsoleteInterfaces(Integer nodeId,
                                            Date scanStamp)

deleteObsoleteInterfaces

Parameters:
nodeId - a Integer object.
scanStamp - a Date object.

setIsPrimaryFlag

@Transactional
OnmsIpInterface setIsPrimaryFlag(Integer nodeId,
                                               String ipAddress)

setIsPrimaryFlag

Parameters:
nodeId - a Integer object.
ipAddress - a String object.
Returns:
a OnmsIpInterface object.

getPrimaryInterfaceForNode

@Transactional
OnmsIpInterface getPrimaryInterfaceForNode(OnmsNode node)

getPrimaryInterfaceForNode

Parameters:
node - a OnmsNode object.
Returns:
a OnmsIpInterface object.

createUndiscoveredNode

@Transactional
OnmsNode createUndiscoveredNode(String ipAddress)

createUndiscoveredNode

Parameters:
ipAddress - a String object.
Returns:
a OnmsNode object.

getNode

@Transactional
OnmsNode getNode(Integer nodeId)

getNode

Parameters:
nodeId - a Integer object.
Returns:
a OnmsNode object.


Copyright © 2011. All Rights Reserved.