📄 snmpvo.java.svn-base
字号:
/*
* Copyright(C) 2008, NTT AT Co., Ltd.
* Project: AWGView
*
* Notes:
* N/A
*
* Record of change:
* Date Version Name Content
* 2008/12/15 1.0 TriNT First create
*/
package jp.co.ntt.awgview.server.vo;
import java.awt.Color;
import java.io.Serializable;
import java.net.InetAddress;
import java.net.UnknownHostException;
import jp.co.ntt.awgview.server.constant.Constants;
/**
* Class name : SnmpVO <BR>
*
* Package : jp.co.ntt_at.awgview.server.common <BR>
*
* Description : Store information about an SNMP Command ad SNMP result data.<BR>
*
* @author : AI&T
* @version : 1.0
*/
public class SnmpVO implements Serializable {
private static final long serialVersionUID = 7926471155622776148L;
/** Node name */
private String nodeName = "Unknow"; // = NODE Name (WDM_Tokyo _Center)
/** AWG-NE Type */
private String awgneType = "WDM_Caster"; // = WDM_Caster
/** PDU Type: SNMP SET / SNMP GET */
private int pduType = Constants.SNMP_GET; // 0 (GET) 3 (SET)
/** SNMP version */
private String version = ""; // 1/2c/3
/** SNMP community; Default value is public */
private String community = "public";
/** OID SNMP GET */
private String oidGet = null;
/** SNMP value */
private String valueGet = null;
/** OID of setting SNMP-SET slot */
private String oidSetSlot = null;
/** Value of SNMP-SET slot */
private String valueSetSlot = null;
/** OID of setting SNMP-SET */
private String oidSetSet = null;
/** Value of SNMP-SET */
private String valueSetSet = null;
/** AWG-NE IP is Function block IP Address */
private String awgneIP = "Unknow";
/** Client IP Address */
private String clientIP = "Unknow";
/** Value type: String / Integer */
private int valueType = -1;
/** Flag to check error when send SNMP command */
private boolean isError = false;
/** Error message */
private String errorMessage = null;
/** User name */
private String userName = "Unknow";
/** Color of Led */
private Color color = null;
/** JMS Message ID */
private String jmsMessageID = "Null";
/** JMS Correlation ID */
private String JmsCorrelID = "Null";
/**
* Empty constructor
*/
public SnmpVO() {
try {
InetAddress addr = InetAddress.getLocalHost();
this.clientIP = addr.getHostAddress();
if (clientIP == null) {
this.clientIP = "Unknown";
} else if (clientIP.trim().length() <= 0) {
this.clientIP = "Unknown";
}
} catch (UnknownHostException e) {
this.clientIP = "UnknownHost";
}
}
/**
* Sets the OID string
*
* @param strOidSetSlot
* The OID string
*/
public void setOidSetSlot(String strOidSetSlot) {
this.oidSetSlot = strOidSetSlot;
}
/**
* Returns the OID string
*/
public String getOidSetSlot() {
return this.oidSetSlot;
}
/**
* Sets the OID string
*
* @param strOidSetSet
* The OID string
*/
public void setOidSetSet(String strOidSetSet) {
this.oidSetSet = strOidSetSet;
}
/**
* Returns the OID string
*/
public String getOidSetSet() {
return this.oidSetSet;
}
/**
* Sets the OID string
*
* @param strOidGet
* The OID string
*/
public void setOidGet(String strOidGet) {
this.oidGet = strOidGet;
}
/**
* Returns the OID string
*/
public String getOidGet() {
return this.oidGet;
}
/**
* Sets the value string
*
* @param strValueGet
* The value string
*
*/
public void setValueGet(String strValueGet) {
this.valueGet = strValueGet;
}
/**
* Sets the value string
*
* @param strValueSetSlot
* The value string
*
*/
public void setValueSetSlot(String strValueSetSlot) {
this.valueSetSlot = strValueSetSlot;
}
/**
* Returns the OID string
*/
public String getValueSetSlot() {
return this.valueSetSlot;
}
public void setValueSetSet(String strValueSetSet) {
this.valueSetSet = strValueSetSet;
}
/**
* Returns the value of SNMP SET command
*/
public String getValueSetSet() {
return this.valueSetSet;
}
/**
* Returns the value of SNMP GET command
*/
public String getValueGet() {
return this.valueGet;
}
/**
* Sets the AWG-NE IP Address
*
* @param awgneIP
* The awgneIP string
*/
public void setAwgNeIP(String awgneIP) {
this.awgneIP = awgneIP;
}
/**
* Returns the IP Address of AWG-NE
*/
public String getAwgNeIP() {
return this.awgneIP;
}
/**
* Sets the Client IP Address
*
* @param clientIP
* The clientIP string
*/
public void setmClientIP(String clientIP) {
this.clientIP = clientIP;
}
/**
* Returns the Client IP Address
*/
public String getClientIP() {
return this.clientIP;
}
/**
* Sets the type (GET/SET) of SNMP command
*
* @param pduType
* The String
*/
public void setPduType(int pduType) {
this.pduType = pduType;
}
/**
* Returns the SNMP command type(GET/SET) integer
*/
public int getPduType() {
return pduType; // 0: GET; 3:SET
}
/***
* Sets Node name
*
* @param nodeName
* The String
*/
public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}
/***
* Returns the node name
*
* @return nodeName
*/
public String getNodeName() {
return this.nodeName;
}
/**
* Sets the SNMP community
*
* @param community
*/
public void setCommunity(String community) {
this.community = community;
}
/***
* Returns the SNMP community
*
* @return community
*/
public String getCommunity() {
return this.community;
}
/***
* Sets the SNMP type
*
* @param valueType
*/
public void setValueType(int valueType) {
this.valueType = valueType;
}
/***
* Returns the SNMP type
*
* @return valueType
*/
public int getValueType() {
return this.valueType;
}
/***
* Sets the AWG-NE type
*
* @param awgneType
*/
public void setAwgNeType(String awgneType) {
this.awgneType = awgneType;
}
/***
* Returns the AWG-NE type
*
* @return awgneType
*/
public String getAwgNeType() {
return awgneType;
}
/***
* Sets the SNMP Version
*
* @param version
*/
public void setVersion(String version) {
this.version = version;
}
/***
* Returns the SNMP Version
*
* @return version
*/
public String getVersion() {
return version;
}
/***
* Sets the SNMP Error
*
* @param isError
*/
public void setError(boolean isError) {
this.isError = isError;
}
/***
* Returns the error is true or false
*
* @return isError
*/
public boolean isError() {
return isError;
}
/***
* Sets the color of Led
*
* @param color
*/
public void setColor(Color color) {
this.color = color;
}
/***
* Return the color of Led
*
* @return color
*/
public Color getColor() {
return color;
}
/***
* Set the JMS Message ID
*
* @param strMessageID
*/
public void setJmsMessageID(String strMessageID) {
this.jmsMessageID = strMessageID;
}
/***
* Return the JMS Message ID
*
* @return jmsMessageID
*/
public String getJmsMessageID() {
return jmsMessageID;
}
/***
* Sets the JMS Correlation ID
*
* @param strCorrelID
*/
public void setJmsCorrelID(String strCorrelID) {
this.JmsCorrelID = strCorrelID;
}
/***
* Returns the JMS Correlation ID
*
* @return JmsCorrelID
*/
public String getJmsCorrelID() {
return JmsCorrelID;
}
/***
* Sets the User name
*
* @param strUserName
*/
public void setUserName(String strUserName) {
this.userName = strUserName;
}
/***
* Returns the User name
*
* @return userName
*/
public String getUserName() {
return userName;
}
/***
* Sets the Error Message
*
* @param errorMessage
*/
public void setErrorMessage(String errorMessage) {
this.errorMessage = errorMessage;
}
/***
* Returns the Error Message
*
* @return errorMessage
*/
public String getErrorMessage() {
return errorMessage;
}
/***
* Return the SnmpVO to String
*
*/
public String toString() {
StringBuffer buff = new StringBuffer();
buff.append("\n\t----------------------------------------------");
buff.append("\n\t---->userName: \t" + userName);
buff.append("\n\t---->clientIP: \t" + clientIP);
buff.append("\n\t---->pteIP: \t" + awgneIP);
buff.append("\n\t---->community: \t" + community);
buff.append("\n\t---->pduType: \t" + pduType);
buff.append("\n\t---->nodeName: \t" + nodeName);
buff.append("\n\t-------------------------------");
buff.append("\n\t---->oid Set Slot:\t" + oidSetSlot);
buff.append("\n\t---->String Slot value:\t" + valueSetSlot);
buff.append("\n\t---->oid Get: \t" + oidGet);
buff.append("\n\t---->String value Get:\t" + valueGet);
buff.append("\n\t---->oid Set: \t" + oidSetSet);
buff.append("\n\t---->String value Set:\t" + valueSetSet);
buff.append("\n\t-------------------------------");
buff.append("\n\t---->valueType: \t" + valueType);
buff.append("\n\t---->pteType: \t" + awgneType);
buff.append("\n\t---->version: \t" + version);
buff.append("\n\t---->Is Error: \t" + isError);
buff.append("\n\t---->errorMessage:\t" + errorMessage);
buff.append("\n\t---->messageID: \t" + jmsMessageID);
buff.append("\n\t---->correlID: \t" + JmsCorrelID);
buff.append("\n\t----------------------------------------------");
return buff.toString();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -