@PublicAPI(stability=PRIVATE) public final class MonitorData extends Object implements Iterable<Attribute>
Note:
Creating monitor entries may become a lot easier once we've migrated to the SDK Entry class:
Entry entry = ...; entry.addAttribute("stringStat", "aString") .addAttribute("integerStat", 12345) .addAttribute("dnStat", DN.valueOf("dc=aDN");We could also envisage an annotation based approach where we determine the monitor content from annotated fields/methods in an object.
Constructor and Description |
---|
MonitorData()
Builds a MonitorData object by using the server's schema.
|
MonitorData(Schema schema)
Builds a MonitorData object by using the provided schema.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String attrName,
Object attrValue)
Adds an attribute with the provided name and value.
|
void |
addAll(String attrName,
Collection<?> attrValues)
Adds an attribute with the provided name and values.
|
void |
addBean(Object bean,
String attributesPrefix)
Adds all the properties from the provided bean as attributes, prepending the provided prefix.
|
Iterator<Attribute> |
iterator() |
Entry |
toEntry()
Returns this MonitorData as an entry.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
forEach, spliterator
public MonitorData()
public MonitorData(Schema schema)
schema
- the schema to use when building the monitor datapublic void add(String attrName, Object attrValue)
attrName
- the attribute nameattrValue
- the attribute valuepublic void addAll(String attrName, Collection<?> attrValues)
attrName
- the attribute nameattrValues
- the attribute valuespublic void addBean(Object bean, String attributesPrefix) throws ReflectiveOperationException
bean
- the bean from which to read the propertiesattributesPrefix
- the prefix to prepend to the attributes read from the beanReflectiveOperationException
- if a problem occurs while reading the properties of the beanpublic Entry toEntry()
Copyright 2010-2020 ForgeRock AS.