public final class J4pReadResponse extends J4pResponse<J4pReadRequest>
J4pType.READ
request. Since a single
READ request can result in multiple values returned, this response object
allows for obtaining iteration of those values in case the MBean name given for the request
was a pattern of when multiple attributes were requested.Modifier and Type | Method and Description |
---|---|
Collection<String> |
getAttributes()
Get all attributes obtained.
|
Collection<String> |
getAttributes(ObjectName pObjectName)
Get the name of all attributes fetched for a certain MBean name.
|
Collection<ObjectName> |
getObjectNames()
Get all MBean names for which the request fetched values.
|
<V> V |
getValue(ObjectName pObjectName,
String pAttribute)
Get the value for a certain MBean and a given attribute.
|
<V> V |
getValue(String pAttribute)
Get the value for a single attribute.
|
asJSONObject, getRequest, getRequestDate, getType, getValue
public Collection<ObjectName> getObjectNames() throws MalformedObjectNameException
MalformedObjectNameException
- if the returned MBean names could not be converted to
ObjectName
s. Shouldnt occur, though.public Collection<String> getAttributes(ObjectName pObjectName)
null
is given as argument, then this method
will return all attributes for the single MBean given in the requestpObjectName
- MBean for which to get the attribute names,public Collection<String> getAttributes()
public <V> V getValue(ObjectName pObjectName, String pAttribute)
V
- the object type of the return value (String
,Map
or List
)pObjectName
- name of the Mbean or null
if the request was only for a single
Mbeans in which case this single MBean is taken from the requestpAttribute
- the attribute or null
if the request was for a single
attribute in which case the attribute name is taken from the requestIllegalArgumentException
- if there was no value for the given parameters or if null
was given for given for one or both arguments and the request was for multiple MBeans
or attributes.public <V> V getValue(String pAttribute)
null
argument, then it will return the value if the request was for
a single attribute, otherwise it will raise an IllegalArgumentException
V
- value typepAttribute
- attribute for which to get the valueIllegalArgumentException
- if the attribute could not be found in the return value or if this method
is called with a null
argument, but the request leads to multiple attribute return values.Copyright © 2021. All rights reserved.