|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opennms.netmgt.utils.NodeLabel
public class 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
| Field Summary | |
|---|---|
static int |
MAX_NODE_LABEL_LENGTH
Maximum length for node label |
static char |
SOURCE_ADDRESS
|
static char |
SOURCE_HOSTNAME
|
static char |
SOURCE_NETBIOS
|
static char |
SOURCE_SYSNAME
|
static char |
SOURCE_UNKNOWN
Initalization value for node label source flag |
static char |
SOURCE_USERDEFINED
Valid values for node label source flag |
| Constructor Summary | |
|---|---|
NodeLabel()
Default constructor |
|
NodeLabel(String nodeLabel,
char nodeLabelSource)
Constructor |
|
| Method Summary | |
|---|---|
static void |
assignLabel(int nodeID,
NodeLabel nodeLabel)
This method updates the 'nodelabel' and 'nodelabelsource' fields of the 'node' table for the specified nodeID. |
static void |
assignLabel(int nodeID,
NodeLabel nodeLabel,
Connection dbConnection)
This method updates the 'nodelabel' and 'nodelabelsource' fields of the 'node' table for the specified nodeID. |
static NodeLabel |
computeLabel(int nodeID)
This method determines what label should be associated with a particular node. |
static NodeLabel |
computeLabel(int nodeID,
Connection dbConnection)
This method determines what label should be associated with a particular node. |
String |
getLabel()
Returns the node label . |
char |
getSource()
Returns the node label source flag . |
static NodeLabel |
retrieveLabel(int nodeID)
This method queries the 'node' table for the value of the 'nodelabel' and 'nodelabelsource' fields for the node with the provided nodeID. |
static NodeLabel |
retrieveLabel(int nodeID,
Connection dbConnection)
This method queries the 'node' table for the value of the 'nodelabel' and 'nodelabelsource' fields for the node with the provided nodeID. |
void |
setLabel(String nodeLabel)
Sets the node label. |
void |
setSource(char nodeLabelSource)
Sets the node label source flag |
String |
toString()
This method is responsible for returning a String object which represents the content of this NodeLabel. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char SOURCE_USERDEFINED
public static final char SOURCE_NETBIOS
public static final char SOURCE_HOSTNAME
public static final char SOURCE_SYSNAME
public static final char SOURCE_ADDRESS
public static final char SOURCE_UNKNOWN
public static final int MAX_NODE_LABEL_LENGTH
| Constructor Detail |
|---|
public NodeLabel()
public NodeLabel(String nodeLabel,
char nodeLabelSource)
nodeLabel - Node labelnodeLabelSource - Flag indicating source of node label| Method Detail |
|---|
public String getLabel()
public char getSource()
public void setLabel(String nodeLabel)
nodeLabel - Node labelpublic void setSource(char nodeLabelSource)
nodeLabelSource - Flag indicating source of node label
public static NodeLabel retrieveLabel(int nodeID)
throws SQLException
nodeID - Unique identifier of the node to be updated.
SQLException
public static NodeLabel retrieveLabel(int nodeID,
Connection dbConnection)
throws SQLException
nodeID - Unique ID of node whose label info is to be retrieveddbConnection - SQL database connection
SQLException
public static void assignLabel(int nodeID,
NodeLabel nodeLabel)
throws SQLException
nodeID - Unique identifier of the node to be updated.nodeLabel - Object containing label and source values.
SQLException
public static void assignLabel(int nodeID,
NodeLabel nodeLabel,
Connection dbConnection)
throws SQLException
nodeID - Unique identifier of the node to be updated.nodeLabel - Object containing label and source values.dbConnection - SQL database connection
SQLException
public static NodeLabel computeLabel(int nodeID)
throws SQLException
nodeID - Unique identifier of the node to be updated.
SQLException
public static NodeLabel computeLabel(int nodeID,
Connection dbConnection)
throws SQLException
nodeID - Unique identifier of the node to be updated.dbConnection - SQL database connection
SQLExceptionpublic String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||