Package org.opennms.netmgt.collectd
Class NodeLabelJDBCImpl
- java.lang.Object
-
- org.opennms.netmgt.collectd.NodeLabelJDBCImpl
-
- All Implemented Interfaces:
NodeLabel
public class NodeLabelJDBCImpl extends java.lang.Object implements NodeLabel
Deprecated.This class is highly deprecated. You should useNodeDao
directly in most cases or useNodeLabelDaoImpl
.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
-
-
Field Summary
-
Fields inherited from interface org.opennms.netmgt.dao.api.NodeLabel
DEFAULT_SELECT_METHOD, MAX_NODE_LABEL_LENGTH, PROP_PRIMARY_INTERFACE_SELECT_METHOD, SELECT_METHOD_MAX, SELECT_METHOD_MIN
-
-
Constructor Summary
Constructors Constructor Description NodeLabelJDBCImpl()
Deprecated.Default constructorNodeLabelJDBCImpl(java.lang.String nodeLabel, OnmsNode.NodeLabelSource nodeLabelSource)
Deprecated.Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
assignLabel(int nodeID, NodeLabel nodeLabel)
Deprecated.Use aNodeDao#update(org.opennms.netmgt.model.OnmsNode)
method call insteadNodeLabel
computeLabel(int nodeID)
Deprecated.Update this to use modern DAO methods instead of raw SQLjava.lang.String
getLabel()
Deprecated.Returns the node label .OnmsNode.NodeLabelSource
getSource()
Deprecated.Returns the node label source flag .NodeLabel
retrieveLabel(int nodeID)
Deprecated.Use aNodeDao#load(Integer)
method call insteadjava.lang.String
toString()
Deprecated.This method is responsible for returning a String object which represents the content of this NodeLabel.
-
-
-
Constructor Detail
-
NodeLabelJDBCImpl
public NodeLabelJDBCImpl()
Deprecated.Default constructor
-
NodeLabelJDBCImpl
public NodeLabelJDBCImpl(java.lang.String nodeLabel, OnmsNode.NodeLabelSource nodeLabelSource)
Deprecated.Constructor- Parameters:
nodeLabel
- Node labelnodeLabelSource
- Flag indicating source of node label
-
-
Method Detail
-
getLabel
public java.lang.String getLabel()
Deprecated.Returns the node label .
-
getSource
public OnmsNode.NodeLabelSource getSource()
Deprecated.Returns the node label source flag .
-
retrieveLabel
public NodeLabel retrieveLabel(int nodeID) throws java.sql.SQLException
Deprecated.Use aNodeDao#load(Integer)
method call insteadThis 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. WARNING: A properly instantiated and initialized Vault class object is required prior to calling this method. This method will initially only be called from the WEB UI.- Specified by:
retrieveLabel
in interfaceNodeLabel
- Parameters:
nodeID
- Unique identifier of the node to be updated.- Returns:
- Object containing label and source values.
- Throws:
java.sql.SQLException
- if any.
-
assignLabel
public void assignLabel(int nodeID, NodeLabel nodeLabel) throws java.sql.SQLException
Deprecated.Use aNodeDao#update(org.opennms.netmgt.model.OnmsNode)
method call insteadThis method updates the 'nodelabel' and 'nodelabelsource' fields of the 'node' table for the specified nodeID. A database connection is retrieved from the Vault. WARNING: A properly instantiated and initialized Vault class object is required prior to calling this method. This method will initially only be called from the WEB UI.- Specified by:
assignLabel
in interfaceNodeLabel
- Parameters:
nodeID
- Unique identifier of the node to be updated.nodeLabel
- Object containing label and source values.- Throws:
java.sql.SQLException
- if any.
-
computeLabel
public NodeLabel computeLabel(int nodeID) throws java.sql.SQLException
Deprecated.Update this to use modern DAO methods instead of raw SQLThis method determines what label should be associated with a particular node. A database connection is retrieved from the Vault. WARNING: A properly instantiated and initialized Vault class object is required prior to calling this method. This method will initially only be called from the WEB UI.- Specified by:
computeLabel
in interfaceNodeLabel
- Parameters:
nodeID
- Unique identifier of the node to be updated.- Returns:
- NodeLabel Object containing label and source values
- Throws:
java.sql.SQLException
- if any.
-
toString
public java.lang.String toString()
Deprecated.This method is responsible for returning a String object which represents the content of this NodeLabel. Primarily used for debugging purposes.
-
-