GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
JMX::Jmx4Perl::Response(3) User Contributed Perl Documentation JMX::Jmx4Perl::Response(3)

JMX::Jmx4Perl::Response - A jmx4perl response

 my $jmx_response = $jmx_agent->request($jmx_request);
 my $value = $jmx_response->value();

A JMX::Jmx4Perl::Response is the result of an JMX request and encapsulates the answer as returned by a JMX::Jmx4Perl backend. Depending on the "status" it either contains the result of a valid request or a error message. The status is modelled after HTTP response codes (see <http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>). For now, only the codes 200 and "400 .. 599" codes are used to specified successful request and errors respectively.

$response = JMX::Jmx4Perl::Response->new($status,$request,$value,$error,$stacktrace)
Internal constructor for creating a response which is use withing requesting the backend. $error and $stacktrace are optional and should only provided when "$status != 200".
$status = $response->status()
Return the status code of this response. Status codes are modelled after HTTP return codes. 200 is the code for a suceeded request. Any code in the range 500 - 599 specifies an error.
$timestamp = $response->timestamp()
Get the timestamp (i.e. epoch seconds) when the request was executed on the serverside.
$history = $response->history()
Get the history if history tracking is switched on. History tracking is switchen on by executing a certain JMX operation on the "jolokia:type=Config" MBean. See the alias "JMX4PERL_HISTORY_MAX_ATTRIBUTE" and "HISTORY TRACKING" in jmx4perl for details.

The returned arrayref (if any) contains hashes with two values: "value" contains the historical value and "timestamp" the timestamp when this value was recorded.

$ok = $response->is_ok()
Return true if this object contains a valid response (i.e. the status code is equal 200)
$fault = $response->is_error()
Opposite of "is_ok", i.e. return true if the status code is not equal to 200
$error = $response->error_text()
Return the error text. Set only if "is_error" is "true"
$error = $response->stacktrace()
Returns the stacktrace of an Java error if any. This is only set when "is_error" is "true" and and Java exception occured on the Java agent's side.
$content = $response->value()
Return the content of this response, which is a represents the JSON response as returned by the Java agent as a hash reference value. This is set only when "is_ok" is true.
$request = $response->request()
Return the JMX::Jmx4Perl::Request which lead to this response

This file is part of jmx4perl.

Jmx4perl is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.

jmx4perl is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with jmx4perl. If not, see <http://www.gnu.org/licenses/>.

A commercial license is available as well. Please contact roland@cpan.org for further details.

roland@cpan.org
2022-04-12 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.