Search in sources :

Example 1 with ReadHandler

use of fish.payara.monitoring.rest.app.handler.ReadHandler in project Payara by payara.

the class MBeanBulkReadResource method handleRequest.

private Optional<JsonObject> handleRequest(final JsonObject jsonObject) {
    // ignore non-read requests
    String type = jsonObject.getString("type", "");
    if (!"read".equalsIgnoreCase(type)) {
        return Optional.empty();
    }
    String mbean = jsonObject.getString("mbean", "");
    JsonValue attributes = jsonObject.getOrDefault("attribute", JsonValue.NULL);
    ReadHandler handler = getReadHandler(mbean, attributes);
    return Optional.of(handler.getResource());
}
Also used : MBeanAttributesReadHandler(fish.payara.monitoring.rest.app.handler.MBeanAttributesReadHandler) MBeanReadHandler(fish.payara.monitoring.rest.app.handler.MBeanReadHandler) MBeanAttributeReadHandler(fish.payara.monitoring.rest.app.handler.MBeanAttributeReadHandler) ReadHandler(fish.payara.monitoring.rest.app.handler.ReadHandler) JsonValue(javax.json.JsonValue) JsonString(javax.json.JsonString)

Aggregations

MBeanAttributeReadHandler (fish.payara.monitoring.rest.app.handler.MBeanAttributeReadHandler)1 MBeanAttributesReadHandler (fish.payara.monitoring.rest.app.handler.MBeanAttributesReadHandler)1 MBeanReadHandler (fish.payara.monitoring.rest.app.handler.MBeanReadHandler)1 ReadHandler (fish.payara.monitoring.rest.app.handler.ReadHandler)1 JsonString (javax.json.JsonString)1 JsonValue (javax.json.JsonValue)1