本文整理了Java中org.snmp4j.Snmp.set()
方法的一些代码示例,展示了Snmp.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Snmp.set()
方法的具体详情如下:
包路径:org.snmp4j.Snmp
类名称:Snmp
方法名:set
[英]Sends a SET request to a target. This method sets the PDU's type to PDU#SET and then sends a synchronous request to the supplied target.
[中]向目标发送SET请求。此方法将PDU的类型设置为PDU#SET,然后向提供的目标发送同步请求。
代码示例来源:origin: apache/nifi
/**
* Executes the SNMP set request and returns the response
* @param pdu PDU to send
* @return Response event
* @throws IOException IO Exception
*/
public ResponseEvent set(PDU pdu) throws IOException {
return this.snmp.set(pdu, this.target);
}
代码示例来源:origin: org.apache.nifi/nifi-snmp-processors
/**
* Executes the SNMP set request and returns the response
* @param pdu PDU to send
* @return Response event
* @throws IOException IO Exception
*/
public ResponseEvent set(PDU pdu) throws IOException {
return this.snmp.set(pdu, this.target);
}
代码示例来源:origin: com.rogueai/snmp2bean
public ResponseEvent set(PDU pdu, Target target) {
try {
return snmp.set(pdu, target);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
}
代码示例来源:origin: usdot-jpo-ode/jpo-ode
/**
* Sends a SET-type PDU to the target specified by the constructor.
*
* @param pdu
* The message content to be sent to the target
* @return ResponseEvent
* @throws IOException
*/
public ResponseEvent set(PDU pdu, Snmp snmpob, UserTarget targetob, Boolean keepOpen) throws IOException {
// Ensure the object has been instantiated
if (!ready) {
throw new IOException("Tried to send PDU before SNMP sending service is ready.");
}
if (!listening) {
startListen();
}
// Try to send the SNMP request (synchronously)
ResponseEvent responseEvent = null;
try {
responseEvent = snmpob.set(pdu, targetob);
if (!keepOpen) {
snmpob.close();
}
} catch (IOException e) {
throw new IOException("Failed to send SNMP request: " + e);
}
return responseEvent;
}
代码示例来源:origin: org.jboss.jbossas/jboss-snmp
System.out.println("SENDING: "+t1);
System.out.println("PDU: " + pdu);
ResponseEvent responseEvent = snmp.set(pdu, target);
long t2=System.currentTimeMillis();
System.out.println("SENT: "+t2);
代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core
System.out.println("SENDING: "+t1);
System.out.println("PDU: " + pdu);
ResponseEvent responseEvent = snmp.set(pdu, target);
long t2=System.currentTimeMillis();
System.out.println("SENT: "+t2);
代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core
System.out.println("READY: "+System.currentTimeMillis());
Snmp snmp = new Snmp(transport);
ResponseEvent responseEvent = snmp.set(pdu, target);
System.out.println("response " + responseEvent.toString());
代码示例来源:origin: org.jboss.jbossas/jboss-snmp
System.out.println("READY: "+System.currentTimeMillis());
Snmp snmp = new Snmp(transport);
ResponseEvent responseEvent = snmp.set(pdu, target);
System.out.println("response " + responseEvent.toString());
代码示例来源:origin: net.itransformers.snmp2xml4j/snmptoolkit
ResponseEvent responseEvent = snmp.set(request, target);
代码示例来源:origin: org.opendaylight.cardinal/cardinal-impl
ResponseEvent response = snmp.set(pdu, comtarget);
代码示例来源:origin: org.opendaylight.cardinal/cardinal-impl
ResponseEvent response = snmp.set(pdu, comtarget);
代码示例来源:origin: net.itransformers.snmp2xml4j/snmptoolkit
ResponseEvent responseEvent = snmp.set(request, target);
代码示例来源:origin: org.snmp4j/snmp4j
pdu.add(new VariableBinding(levelOID, new Integer32(level)));
ResponseEvent response = snmp.set(pdu, target);
if (response.getResponse() != null) {
switch (response.getResponse().getErrorStatus()) {
pdu.add(new VariableBinding(rowStatusOID, new Integer32(4)));
response = snmp.set(pdu, target);
代码示例来源:origin: org.kaazing/snmp4j
pdu.add(new VariableBinding(levelOID, new Integer32(level)));
ResponseEvent response = snmp.set(pdu, target);
if (response.getResponse() != null) {
switch (response.getResponse().getErrorStatus()) {
pdu.add(new VariableBinding(rowStatusOID, new Integer32(4)));
response = snmp.set(pdu, target);
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
pdu.add(new VariableBinding(levelOID, new Integer32(level)));
ResponseEvent response = snmp.set(pdu, target);
if (response.getResponse() != null) {
switch (response.getResponse().getErrorStatus()) {
pdu.add(new VariableBinding(rowStatusOID, new Integer32(4)));
response = snmp.set(pdu, target);
内容来源于网络,如有侵权,请联系作者删除!