public class NodeLabelDaoImpl extends Object implements NodeLabel
This class contains convenience functions for retrieving and modifying the label associated with a managed node. The 'node' table contains a 'nodelabel' and 'nodelabelsource' field. The 'nodelabel' is a user-friendly name associated with the node. This name can be user-defined (via the WEB UI) or can be auto-generated based on what OpenNMS knows about the node and its interfaces. The 'nodelabelsource' field is a single character flag which indicates what the source for the node label was.
Valid values for node label source are: 'U' User defined 'H' Primary interface's IP host name 'S' Node's MIB-II sysName 'A' Primary interface's IP address
DEFAULT_SELECT_METHOD, MAX_NODE_LABEL_LENGTH, PROP_PRIMARY_INTERFACE_SELECT_METHOD, SELECT_METHOD_MAX, SELECT_METHOD_MIN| Constructor and Description | 
|---|
NodeLabelDaoImpl()
Default constructor 
 | 
NodeLabelDaoImpl(String nodeLabel,
                OnmsNode.NodeLabelSource nodeLabelSource)
Constructor 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
assignLabel(int nodeID,
           NodeLabel nodeLabel)
Deprecated. 
 
Use a  
NodeDao#update(org.opennms.netmgt.model.OnmsNode) method call instead | 
NodeLabel | 
computeLabel(int nodeID)
This method determines what label should be associated with a particular
 node. 
 | 
String | 
getLabel()
Returns the node label . 
 | 
OnmsNode.NodeLabelSource | 
getSource()
Returns the node label source flag . 
 | 
NodeLabel | 
retrieveLabel(int nodeID)
Deprecated. 
 
Use a  
NodeDao#load(Integer) method call instead | 
String | 
toString()
This method is responsible for returning a String object which represents
 the content of this NodeLabel. 
 | 
public NodeLabelDaoImpl()
public NodeLabelDaoImpl(String nodeLabel, OnmsNode.NodeLabelSource nodeLabelSource)
nodeLabel - Node labelnodeLabelSource - Flag indicating source of node labelpublic String getLabel()
public OnmsNode.NodeLabelSource getSource()
public NodeLabel retrieveLabel(int nodeID) throws SQLException
NodeDao#load(Integer) method call insteadretrieveLabel in interface NodeLabelnodeID - Unique ID of node whose label info is to be retrieveddbConnection - SQL database connectionSQLException - if any.@Transactional
public void assignLabel(int nodeID,
                                       NodeLabel nodeLabel)
                                throws SQLException
NodeDao#update(org.opennms.netmgt.model.OnmsNode) method call insteadassignLabel in interface NodeLabelnodeID - Unique identifier of the node to be updated.nodeLabel - Object containing label and source values.dbConnection - SQL database connectionSQLException - if any.public NodeLabel computeLabel(int nodeID) throws SQLException
computeLabel in interface NodeLabelnodeID - Unique identifier of the node to be updated.dbConnection - SQL database connectionSQLException - if any.public String toString()
Copyright © 2020. All rights reserved.