private void updateReadHistory ( JmxReadRequest pJmxReq , JSONObject pJson , long pTimestamp ) { ObjectName name = pJmxReq . getObjectName ( ) ; if ( name . isPattern ( ) ) { // We have a pattern and hence a value structure // of bean -> attribute_key -> attribute_value Map < String , Object > values = ( Map < String , Object > ) pJson . get ( KEY_VALUE ) ; // Can be null if used with path and no single match occurred if ( values != null ) { JSONObject history = updateHistoryForPatternRead ( pJmxReq , pTimestamp , values ) ; if ( history . size ( ) > 0 ) { pJson . put ( KEY_HISTORY , history ) ; } } } else if ( pJmxReq . isMultiAttributeMode ( ) || ! pJmxReq . hasAttribute ( ) ) { // Multiple attributes, but a single bean. // Value has the following structure: // attribute_key -> attribute_value JSONObject history = addMultipleAttributeValues ( pJmxReq , ( ( Map < String , Object > ) pJson . get ( KEY_VALUE ) ) , pJmxReq . getObjectNameAsString ( ) , pTimestamp ) ; if ( history . size ( ) > 0 ) { pJson . put ( KEY_HISTORY , history ) ; } } else { // Single attribute, single bean. Value is the attribute_value // itself. addAttributeFromSingleValue ( pJson , new HistoryKey ( pJmxReq ) , KEY_HISTORY , pJson . get ( KEY_VALUE ) , pTimestamp ) ; } }
return multiple values with a single request