2013-03-20 92 views
0

大家好! 我有一個示例代碼來訪問SNMP協議中使用snmp4j的設備的一些信息...在示例代碼中,他們已經將檢索到的信息轉儲到某個目標地址,並且我沒有得到目標地址是什麼...snmp4j lib中SNMP的目標是什麼

下面是我的代碼...

/** 
* This method returns a Target, which contains information about where the 
* data should be fetched and how. 
* 
* @return 
*/ 
private Target getTarget() { 
    Address targetAddress = GenericAddress.parse(address); 
    CommunityTarget target = new CommunityTarget(); 
    target.setCommunity(new OctetString("public")); 
    target.setAddress(targetAddress); 
    target.setRetries(2); 
    target.setTimeout(1500); 
    target.setVersion(SnmpConstants.version2c); 
    return target; 
} 

}

而且這種方法已被稱爲獲取方法ResponseEvent返回類型的...

回答