public class MBeanAttributeKeyProvider extends MBeanAttributeMOInfo
MBeanAttributeKeyProvider provides the row keys of a
conceptual table from a MBean attribute. The keys are returned in the same
order as provided by the MBean attribute by default. If the
keysNeedSorting is set, keys are returned always in their
natural order.attribute| Constructor and Description |
|---|
MBeanAttributeKeyProvider(ObjectName name,
TypedAttribute attribute)
Creates a key provider with a MBean name and a attribute description.
|
MBeanAttributeKeyProvider(ObjectName name,
TypedAttribute attribute,
boolean keysNeedSorting)
Creates a key provider with a MBean name and an attribute description.
|
MBeanAttributeKeyProvider(ObjectName name,
TypedAttribute attribute,
boolean keysNeedSorting,
MBeanAttributeKeyProvider subKeyProvider,
String[] keyAttributes)
Creates a key provider with a MBean name and an attribute description.
|
| Modifier and Type | Method and Description |
|---|---|
static List<Integer> |
asList(int[] a) |
static List<Long> |
asList(long[] a) |
protected Object |
combineKeys(Object key,
Object subKey) |
protected Iterator |
createTailIterator(Iterator it,
int indexPos) |
protected Object |
getKey(MBeanServerConnection server,
ObjectName row) |
int |
getKeyCount(MBeanServerConnection server)
Returns the number of row keys available.
|
protected List |
getKeys(MBeanServerConnection server,
ObjectName keyProviderInstance) |
Object |
getRowValues(MBeanServerConnection server,
Object indexObject) |
protected ObjectName |
getSubKeyProviderObjectName(Object key)
Determine the object name for the MBean instance that provides sub key
elements through the subKeyProvider.
|
Iterator |
keyIterator(MBeanServerConnection server)
Returns an iterator on the keys provided by this MBean attribute.
|
Iterator |
keyTailIterator(MBeanServerConnection server,
Object firstRowId)
Returns an iterator on the keys provided by this MBean attribute starting
from the supplied row key.
|
getAttribute, getAttribute, getAttribute, getAttributeName, getAttributeType, setAttribute, setAttributegetMBeanNames, getObjectNamepublic MBeanAttributeKeyProvider(ObjectName name, TypedAttribute attribute)
name - a MBean's ObjectName.attribute - the description of an attribute of the MBean identified by
name.public MBeanAttributeKeyProvider(ObjectName name, TypedAttribute attribute, boolean keysNeedSorting)
name - a MBean's ObjectName.attribute - the description of an attribute of the MBean identified by
name.keysNeedSorting - if true keys will be sorted by their natural order.public MBeanAttributeKeyProvider(ObjectName name, TypedAttribute attribute, boolean keysNeedSorting, MBeanAttributeKeyProvider subKeyProvider, String[] keyAttributes)
name - a MBean's ObjectName.attribute - the description of an attribute of the MBean identified by
name.keysNeedSorting - if true keys will be sorted by their natural order.subKeyProvider - if not null, this key provider is called per key provided
by this provider in order to form a combined key.keyAttributes - if attribute is null this parameter has to
be specified to identify the key attributes that build the key object
for the MBean instances under name.public Iterator keyIterator(MBeanServerConnection server) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
server - the MBeanServerConnection to be used to access the MBean.IOExceptionMBeanExceptionAttributeNotFoundExceptionInstanceNotFoundExceptionReflectionExceptionprotected ObjectName getSubKeyProviderObjectName(Object key) throws MalformedObjectNameException
key - ObjectMalformedObjectNameExceptionpublic Iterator keyTailIterator(MBeanServerConnection server, Object firstRowId) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
server - the MBeanServerConnection to be used to access the MBean.firstRowId - the lower bound (including) row key for the iterator.IOExceptionMBeanExceptionAttributeNotFoundExceptionInstanceNotFoundExceptionReflectionExceptionpublic int getKeyCount(MBeanServerConnection server) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
server - the MBeanServerConnection to be used to access the MBean.IOExceptionMBeanExceptionAttributeNotFoundExceptionInstanceNotFoundExceptionReflectionExceptionpublic Object getRowValues(MBeanServerConnection server, Object indexObject) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
protected List getKeys(MBeanServerConnection server, ObjectName keyProviderInstance) throws IOException, MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException
protected Object getKey(MBeanServerConnection server, ObjectName row) throws IOException, ReflectionException, InstanceNotFoundException
Copyright © 2015 SNMP4J.org. All rights reserved.