org.opennms.netmgt.provision.service
Interface ProvisionService

All Known Implementing Classes:
DefaultProvisionService

public interface ProvisionService


Method Summary
 OnmsMonitoredService addMonitoredService(Integer ipInterfaceId, String svcName)
           
 OnmsMonitoredService addMonitoredService(Integer nodeId, String ipAddress, String serviceName)
           
 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.
 void deleteNode(Integer nodeId)
          Delete the indicated node form the database.
 void deleteObsoleteInterfaces(Integer nodeId, Date scanStamp)
           
 List<ServiceDetector> getDetectorsForForeignSource(String foreignSource)
           
 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)
           
 List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)
           
 OnmsNode getRequisitionedNode(String foreignSource, String foreignId)
           
 NodeScanSchedule getScheduleForNode(int nodeId, boolean force)
           
 List<NodeScanSchedule> getScheduleForNodes()
          Returns a list of scheduled nodes.
 List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)
           
 void insertNode(OnmsNode node)
          Insert the provided node into the database
 Requisition loadRequisition(org.springframework.core.io.Resource resource)
           
 void setForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)
           
 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)
           
 void updateNode(OnmsNode node)
          Update the database entry for the given node.
 OnmsNode updateNodeAttributes(OnmsNode node)
           
 void updateNodeScanStamp(Integer nodeId, Date scanStamp)
           
 OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId, OnmsSnmpInterface snmpInterface)
           
 

Method Detail

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)

updateIpInterfaceAttributes

@Transactional
OnmsIpInterface updateIpInterfaceAttributes(Integer nodeId,
                                                          OnmsIpInterface ipInterface)

updateSnmpInterfaceAttributes

@Transactional
OnmsSnmpInterface updateSnmpInterfaceAttributes(Integer nodeId,
                                                              OnmsSnmpInterface snmpInterface)

addMonitoredService

@Transactional
OnmsMonitoredService addMonitoredService(Integer ipInterfaceId,
                                                       String svcName)

addMonitoredService

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

getRequisitionedNode

@Transactional
OnmsNode getRequisitionedNode(String foreignSource,
                                            String foreignId)

deleteNode

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


insertNode

@Transactional
void insertNode(OnmsNode node)
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:
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.


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:

getScheduleForNode

NodeScanSchedule getScheduleForNode(int nodeId,
                                    boolean force)

setForeignSourceRepository

void setForeignSourceRepository(ForeignSourceRepository foriengSourceRepository)

loadRequisition

Requisition loadRequisition(org.springframework.core.io.Resource resource)
Parameters:
foreignSource -
resource -
Returns:

getDetectorsForForeignSource

List<ServiceDetector> getDetectorsForForeignSource(String foreignSource)

getNodePoliciesForForeignSource

List<NodePolicy> getNodePoliciesForForeignSource(String foreignSourceName)

getIpInterfacePoliciesForForeignSource

List<IpInterfacePolicy> getIpInterfacePoliciesForForeignSource(String foreignSourceName)

getSnmpInterfacePoliciesForForeignSource

List<SnmpInterfacePolicy> getSnmpInterfacePoliciesForForeignSource(String foreignSourceName)

updateNodeScanStamp

void updateNodeScanStamp(Integer nodeId,
                         Date scanStamp)

deleteObsoleteInterfaces

void deleteObsoleteInterfaces(Integer nodeId,
                              Date scanStamp)


Copyright © 2009. All Rights Reserved.