Examples of OID


Examples of org.snmp4j.smi.OID

      return new JMXTableRowIterator(table.rowIdTailIterator(tableOID, rowId));
    }
    else {
      for (Iterator it = table.rowIdIterator(tableOID); it.hasNext(); i++) {
        Object key = it.next();
        OID index = table.mapToIndex(tableOID, key, i+1);
        if ((lowerBound == null) || (index.compareTo(lowerBound) >= 0)) {
          return new JMXTableRowIterator(it, key, i+1);
        }
      }
    }
    return null;
View Full Code Here

Examples of org.snmp4j.smi.OID

        nextKey = null;
      }
      if (key instanceof JMXArrayIndexKey) {
        nativeIndex = ((JMXArrayIndexKey)key).getIndex();
      }
      OID index = table.mapToIndex(tableOID, key, nativeIndex++);
      MOTableRow row = rowFactory.createRow(index, getInitialRowValues());
      int status = table.getRow(tableOID, row);
      if (status == SnmpConstants.SNMP_ERROR_SUCCESS) {
        return row;
      }
View Full Code Here

Examples of org.snmp4j.smi.OID

          return nativeRowId;
        }

        public OID mapToIndex(Object rowIdentifier) {
          Object[] key = (Object[])rowIdentifier;
          OID index = new OID(jvmMemManagerIndexSupport.mapToIndex(key[0]));
          index.append(jvmMemPoolIndexSupport.mapToIndex(key[1]));
          return index;
        }

        public Object mapToRowIdentifier(OID rowIndex) {
          if (rowIndex == null) {
           return null;
         }
         Object[] rowIdentifier = new Object[2];
         rowIdentifier[0] =
             jvmMemManagerIndexSupport.mapToRowIdentifier(
          new OID(rowIndex.toIntArray(), 0, 1));
         rowIdentifier[1] =
             jvmMemPoolIndexSupport.mapToRowIdentifier(
          new OID(rowIndex.toIntArray(), 1, 1));
         return rowIdentifier;
        }
      }
      ));


      ObjectName onameJvmThreading =
          new ObjectName(ManagementFactory.THREAD_MXBEAN_NAME);

      tableSupport.add(super.oidJvmThreadInstanceEntry,
          new MBeanAttributeMOTableInfo(onameJvmThreading,
          new MBeanInvokationKeyProvider(onameJvmThreading,
                                         new TypedAttribute("AllThreadIds", long.class),
                                         "getThreadInfo", true),
          new TypedAttribute[] {
          new TypedCompositeDataAttribute(new TypedAttribute("threadId", Long.class)),
          new CombinedBitsType(new TypedAttribute[] {
                               new EnumBitsType("threadState", Thread.State.class, Thread.State.values(), 3),
                               new BooleanBitsType("inNative", 1),
                               new BooleanBitsType("suspended", 2)}),
          new TypedCompositeDataAttribute(new TypedAttribute("blockedCount", Long.class)),
          new TypedCompositeDataAttribute(new TypedAttribute("blockedTime", Long.class)),
          new TypedCompositeDataAttribute(new TypedAttribute("waitedCount", Long.class)),
          new TypedCompositeDataAttribute(new TypedAttribute("waitedTime", Long.class)),
          new MBeanProxyType(server, onameJvmThreading, Long.class,
                             "getThreadUserTime",
                             new TypedCompositeDataAttribute(new TypedAttribute("threadId", long.class))) {
            public Object transformFromNative(Object nativeValue, ObjectName objectName) {
              Long result = (Long) super.transformFromNative(nativeValue, objectName);
              if ((result == null) || (result.longValue() < 0)) {
                return 0L;
              }
              return result;
            }
          },
          new TypedCompositeDataAttribute(new TypedAttribute("threadName", String.class)),
          new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerName", String.class)),
          new TypedCompositeDataAttribute(new TypedAttribute("lockOwnerId", Long.class)) {
            public Object transformFromNative(Object nativeValue, ObjectName objectName) {
              Long result = (Long)super.transformFromNative(nativeValue, objectName);
              if ((result == null) || (result.longValue() < 0)) {
                return "0.0";
              }
              OID rowPointer = new OID(JvmManagementMib.oidJvmThreadInstanceEntry);
              rowPointer.append(JvmManagementMib.colJvmThreadInstId);
              String index = Long.toHexString(result.longValue());
              OctetString os = new OctetString();
              os.fromHexString(index);
              rowPointer.append(os.toSubIndex(true));
              return rowPointer.toString();
            }
          }},
          new String[] { "ThreadId" },
          new JMXIndexSupport() {
        public ObjectName mapToRowMBean(Object rowIdentifier) {
View Full Code Here

Examples of org.snmp4j.smi.OID

    }
    Variable smiValue = (Variable) valueType.clone();
    SMIVariant smiVariant = new SMIVariant(smiValue);
    value = attribute.transformFromNative(value, null);
    smiVariant.setValue(value);
    OID oid = new OID(classID);
    if (index != null) {
      oid.append(index);
    }
    return new VariableBinding(oid, smiValue);
  }
View Full Code Here

Examples of org.snmp4j.smi.OID

  public void clear(MOTableRowFilter filter) {
    Iterator it = table.rowIdIterator(tableOID);
    List<OID> toRemove = new ArrayList<OID>();
    for (int i=0; it != null && it.hasNext(); i++) {
      Object rowID = it.next();
      OID index = table.mapToIndex(tableOID, rowID, i);
      MOTableRow row = getRow(index);
      if (filter.passesFilter(row)) {
        toRemove.add(index);
      }
    }
View Full Code Here

Examples of org.snmp4j.smi.OID

  public Object getRowIdentifier(Object nativeRowId, int nativeIndex) {
    return new JMXArrayIndexKey(nativeIndex);
  }

  public OID mapToIndex(Object rowIdentifier) {
    return new OID(new int[] { ((JMXArrayIndexKey)rowIdentifier).getIndex() });
  }
View Full Code Here

Examples of org.snmp4j.smi.OID

  public AbstractSyntheticJMXIndexSupport(int initialSize) {
    keyIndexRelation = new KeyIndexRelation(initialSize);
  }

  public OID mapToIndex(Object rowIdentifier) {
    OID index = keyIndexRelation.getKeys().get(rowIdentifier);
    if (index == null) {
      return allocateNewIndex(rowIdentifier);
    }
    return index;
  }
View Full Code Here

Examples of org.snmp4j.smi.OID

    return index;
  }

  protected OID allocateNewIndex(Object rowIdentifier) {
    int hashCode = rowIdentifier.hashCode();
    OID index = new OID(new int[] { hashCode });
    while (keyIndexRelation.getIndexes().containsKey(index)) {
      hashCode++;
      index.set(0, hashCode);
    }
    keyIndexRelation.getKeys().put(rowIdentifier, index);
    keyIndexRelation.getIndexes().put(index, rowIdentifier);
    return index;
  }
View Full Code Here

Examples of org.snmp4j.smi.OID

    if (indexSupport != null) {
      synchronized (indexSupport) {
        indexSupport.intialize(notificationObject);
        for (int i=0; i<objects.length; i++) {
          MBeanNotificationObjectInfo oinfo = objects[i];
          OID index = indexSupport.getIndex(i);
          vbs[i] = oinfo.getVariableBinding(notificationObject, index);
        }
      }
    }
    else {
View Full Code Here

Examples of org.snmp4j.smi.OID

    MBeanAttributeMOTableInfo mBeanInfo =
        (MBeanAttributeMOTableInfo) getMBeanMOInfo(tableOID);
    if (mBeanInfo != null) {
      try {
        if (mBeanInfo.getKeyProvider() == null) {
          OID maxIndex = new OID();
          Set<ObjectInstance> mBeans = mBeanInfo.getMBeanNames(server);
          for (ObjectInstance mBean : mBeans) {
            Object key = mBeanInfo.getKey(server, mBean.getObjectName());
            OID index = mBeanInfo.getIndexSupport().mapToIndex(key);
            if (index.compareTo(maxIndex) > 0) {
              maxIndex = index;
            }
          }
          return maxIndex;
        }
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.