use of com.sun.jmx.snmp.SnmpVarBind in project jdk8u_jdk by JetBrains.
the class SnmpMibTable method setRowStatusFail.
// ---------------------------------------------------------------------
//
// Register an exception when checking the RowStatus variable
//
// ---------------------------------------------------------------------
static void setRowStatusFail(SnmpMibSubRequest req, int errorStatus) throws SnmpStatusException {
final SnmpVarBind statusvb = req.getRowStatusVarBind();
final SnmpStatusException x = new SnmpStatusException(errorStatus);
req.registerSetException(statusvb, x);
}
use of com.sun.jmx.snmp.SnmpVarBind in project jdk8u_jdk by JetBrains.
the class SnmpSubNextRequestHandler method init.
private void init(SnmpPdu req, SnmpAdaptorServer server) {
this.server = server;
// The translation table is easy in this case ...
//
final int max = translation.length;
final SnmpVarBind[] list = req.varBindList;
final NonSyncVector<SnmpVarBind> nonSyncVarBind = ((NonSyncVector<SnmpVarBind>) varBind);
for (int i = 0; i < max; i++) {
translation[i] = i;
// we need to allocate a new SnmpVarBind. Otherwise the first
// sub request will modify the list...
//
final SnmpVarBind newVarBind = new SnmpVarBind(list[i].oid, list[i].value);
nonSyncVarBind.addNonSyncElement(newVarBind);
}
}
use of com.sun.jmx.snmp.SnmpVarBind in project jdk8u_jdk by JetBrains.
the class SnmpRequestHandler method mergeBulkResponses.
private SnmpVarBind[] mergeBulkResponses(int size) {
// Let's allocate the array for storing the result
//
SnmpVarBind[] result = new SnmpVarBind[size];
for (int i = size - 1; i >= 0; --i) {
result[i] = new SnmpVarBind();
result[i].value = SnmpVarBind.endOfMibView;
}
//
for (Enumeration<SnmpSubRequestHandler> e = subs.elements(); e.hasMoreElements(); ) {
SnmpSubRequestHandler sub = e.nextElement();
sub.updateResult(result);
}
return result;
}
use of com.sun.jmx.snmp.SnmpVarBind in project jdk8u_jdk by JetBrains.
the class SnmpRequestHandler method mergeNextResponses.
private SnmpPduPacket mergeNextResponses(SnmpPduRequest req) {
int max = req.varBindList.length;
SnmpVarBind[] result = new SnmpVarBind[max];
//
for (Enumeration<SnmpSubRequestHandler> e = subs.elements(); e.hasMoreElements(); ) {
SnmpSubRequestHandler sub = e.nextElement();
sub.updateResult(result);
}
if (req.version == snmpVersionTwo) {
return newValidResponsePdu(req, result);
}
//
for (int i = 0; i < max; i++) {
SnmpValue val = result[i].value;
if (val == SnmpVarBind.endOfMibView)
return newErrorResponsePdu(req, SnmpDefinitions.snmpRspNoSuchName, i + 1);
}
//
return newValidResponsePdu(req, result);
}
use of com.sun.jmx.snmp.SnmpVarBind in project jdk8u_jdk by JetBrains.
the class SnmpSubBulkRequestHandler method init.
private void init(SnmpAdaptorServer server, SnmpPdu req, int nonRepeat, int maxRepeat, int R) {
this.server = server;
this.nonRepeat = nonRepeat;
this.maxRepeat = maxRepeat;
this.globalR = R;
final int max = translation.length;
final SnmpVarBind[] list = req.varBindList;
final NonSyncVector<SnmpVarBind> nonSyncVarBind = ((NonSyncVector<SnmpVarBind>) varBind);
for (int i = 0; i < max; i++) {
translation[i] = i;
// we need to allocate a new SnmpVarBind. Otherwise the first
// sub request will modify the list...
//
final SnmpVarBind newVarBind = new SnmpVarBind(list[i].oid, list[i].value);
nonSyncVarBind.addNonSyncElement(newVarBind);
}
}
Aggregations