2013-03-20 59 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返回类型的...

回答