Examples of SnmpVarBind


Examples of com.sun.jmx.snmp.SnmpVarBind

  if (isDebugOn())
      debug("getGetNextHandlers","Received MIB request : " + req);
  AcmChecker checker = new AcmChecker(req);
  int index=0;
        SnmpVarBind var = null;
        final int ver= req.getVersion();
  SnmpOid original = null;
  // For each varbind, finds the handling node.
  // This function has the side effect of transforming a GET-NEXT
  // request into a valid GET request, replacing the OIDs in the
  // original GET-NEXT request with the OID of the first leaf that
  // follows.
        for (Enumeration e= req.getElements(); e.hasMoreElements(); index++) {

            var = (SnmpVarBind) e.nextElement();
      SnmpOid result = null;
            try {
    // Find the node handling the OID that follows the varbind
    // OID. `result' contains this next leaf OID.
    //ACM loop.
    if (isDebugOn())
        debug("getGetNextHandlers"," Next Oid of :" + var.oid);
    result = new SnmpOid(root.findNextHandlingNode
             (var,var.oid.longValue(false),0,
              0,handlers, checker));
   
    if (isDebugOn())
        debug("getGetNextHandlers"," is :" + result);
    // We replace the varbind original OID with the OID of the
    // leaf object we have to return.
    var.oid = result;
            } catch(SnmpStatusException x) {

    // if (isDebugOn())
    //    debug("getGetNextHandlers",
    //    "Couldn't find a handling node for "
    //    + var.oid.toString());
   
                if (ver == SnmpDefinitions.snmpVersionOne) {
        if (isDebugOn())
      debug("getGetNextHandlers","\tThrowing exception" +
            x.toString());
        // The index in the exception must correspond to the
        // SNMP index ...
        //
                    throw new SnmpStatusException(x, index + 1);
    }
    if (isDebugOn())
        debug("getGetNextHandlers","Exception : " + x.getStatus());
   
                var.setSnmpValue(SnmpVarBind.endOfMibView);
            }  
        }
  return handlers;
    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

            return;
   
        int idx = 0;
       
        for(int i = 0; i < internalVarBind.length && idx < list.length; i++) {
            SnmpVarBind avar = internalVarBind[i];
            if (avar == null)
                continue;
               
            SnmpVarBind res = list[idx];
            avar.setSnmpValue(res.getSnmpValue());
            idx++;
        }
    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

        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);
        }
    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

    protected  void updateRequest(SnmpVarBind var, int pos) {
  if(isDebugOn())
      debug("updateRequest", "Copy :" + var);
        int size= varBind.size();
        translation[size]= pos;
  final SnmpVarBind newVarBind =
      new SnmpVarBind(var.oid, var.value);
  if(isDebugOn())
      debug("updateRequest", "Copied :" + newVarBind);
 
  varBind.addElement(newVarBind);
    }
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

        final int max=varBind.size();
        for(int i= 0; i< max ; i++) {
            // May be we should control the position ...
            //
            final int index= translation[i];
            final SnmpVarBind elmt=
    (SnmpVarBind)((NonSyncVector)varBind).elementAtNonSync(i);

            final SnmpVarBind vb= result[index];
            if (vb == null) {
                result[index]= elmt;
    /* NPCTE fix for bugid 4381195 esc 0. <J.C.> < 17-Oct-2000> */
          // if ((elmt != null) &&  (elmt.value == null) &&
    //    (version == snmpVersionTwo))
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

  public void addVarbind(SnmpVarBind varbind, SnmpOid entryoid,
             boolean isnew, SnmpVarBind statusvb)
      throws SnmpStatusException {
      Vector v = null;
      SnmpVarBind rs = statusvb;

       if (entryoids == null) {
//     entryoids = new ArrayList();
//     entrylists = new ArrayList();
//     isentrynew = new ArrayList();
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

  final SnmpVarBind[] varList  = new SnmpVarBind[size];
  final long[]        idList   = new long[size];
  int   i = 0;

  for (Enumeration e=req.getElements(); e.hasMoreElements();) {
            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
      try {
    final long id = var.oid.getOidArc(depth);
    nameList[i]   = meta.getAttributeName(id);
    varList[i]    = var;
    idList[i]     = id;
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

  final SnmpVarBind[] varList  = new SnmpVarBind[size];
  final long[]        idList   = new long[size];
  int   i = 0;

  for (Enumeration e=req.getElements(); e.hasMoreElements();) {
            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
      try {
    final long id = var.oid.getOidArc(depth);
    final String attname = meta.getAttributeName(id);
    final Object attvalue=
        meta.buildAttributeValue(id,var.value);
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

  throws SnmpStatusException {

  final Object data = req.getUserData();

  for (Enumeration e=req.getElements(); e.hasMoreElements();) {
            final SnmpVarBind var= (SnmpVarBind) e.nextElement();
      try {
    final long id = var.oid.getOidArc(depth);
    // call meta.check() here, and meta.check will call check()
    check(meta,name,var.value,id,data);
            } catch(SnmpStatusException x) {
View Full Code Here

Examples of com.sun.jmx.snmp.SnmpVarBind

        // Ok the loop looks a bit strange. But in order to improve the
  // perf, we try to avoid reference to the limit variable from
  // within the loop ...
        //
        for(Enumeration e= original.elements(); e.hasMoreElements(); --i) {
            SnmpVarBind var= (SnmpVarBind) e.nextElement();
            if (i >0)
                continue;
            result.addElement(new SnmpVarBind(var.oid, var.value));
        }
        return result;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.