1 22 package org.snmp4j.agent.mo.jmx; 23 24 import javax.management.ObjectName ; 25 26 import org.snmp4j.smi.OID; 27 import org.snmp4j.agent.mo.jmx.util.JMXArrayIndexKey; 28 29 41 public class JMXSimpleArrayIndexSupport implements JMXIndexSupport { 42 43 public JMXSimpleArrayIndexSupport() { 44 } 45 46 public Object getRowIdentifier(Object nativeRowId, int nativeIndex) { 47 return new JMXArrayIndexKey(nativeIndex); 48 } 49 50 public OID mapToIndex(Object rowIdentifier) { 51 return new OID(new int[] { ((JMXArrayIndexKey)rowIdentifier).getIndex() }); 52 } 53 54 public ObjectName mapToRowMBean(Object rowIdentifier) { 55 return null; 56 } 57 58 public Object mapToRowIdentifier(OID rowIndex) { 59 if (rowIndex == null) { 60 return new JMXArrayIndexKey(0); 61 } 62 return new JMXArrayIndexKey(rowIndex.get(0)); 63 } 64 65 } 66 | Popular Tags |