Search in sources :

Example 1 with NodeLabelSource

use of org.opennms.netmgt.model.OnmsNode.NodeLabelSource in project opennms by OpenNMS.

the class NodeLabelDaoImpl method retrieveLabel.

/**
 * This method queries the 'node' table for the value of the 'nodelabel' and
 * 'nodelabelsource' fields for the node with the provided nodeID. A
 * NodeLabel object is returned initialized with the retrieved values.
 *
 * @param nodeID
 *            Unique ID of node whose label info is to be retrieved
 * @param dbConnection
 *            SQL database connection
 * @return object initialized with node label & source flag
 * @throws java.sql.SQLException if any.
 *
 * @deprecated Use a {@link NodeDao#load(Integer)} method call instead
 */
@Override
public NodeLabel retrieveLabel(final int nodeID) throws SQLException {
    OnmsNode node = nodeDao.get(nodeID);
    String nodeLabel = node.getLabel();
    NodeLabelSource nodeLabelSource = node.getLabelSource();
    return new NodeLabelDaoImpl(nodeLabel, nodeLabelSource);
}
Also used : OnmsNode(org.opennms.netmgt.model.OnmsNode) NodeLabelSource(org.opennms.netmgt.model.OnmsNode.NodeLabelSource)

Aggregations

OnmsNode (org.opennms.netmgt.model.OnmsNode)1 NodeLabelSource (org.opennms.netmgt.model.OnmsNode.NodeLabelSource)1