Class JolokiaRequestFactory
JolokiaRequests- Since:
- Oct 29, 2009
- Author:
- roland
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends JolokiaRequest>
RcreateGetRequest(String pPathInfo, ProcessingParameters pProcessingParameters) Create a JMX request from a GET Request with a REST Url.static <R extends JolokiaRequest>
RcreatePostRequest(Map<String, ?> pRequestMap, ProcessingParameters pProcessingParams) Create a singleJolokiaRequests from a JSON map representation of a requeststatic List<JolokiaRequest>createPostRequests(List<?> pJsonRequests, ProcessingParameters pProcessingParams) Create a list ofJolokiaRequests from a JSON list representing jmx requests
-
Method Details
-
createGetRequest
public static <R extends JolokiaRequest> R createGetRequest(String pPathInfo, ProcessingParameters pProcessingParameters) Create a JMX request from a GET Request with a REST Url.The REST-Url which gets recognized has the following format:
<base_url>/<type>/<param1>/<param2>/....where
base_urlis the URL specifying the overall servlet (including the servlet context, something like "http://localhost:8080/j4p-agent"),typethe operational mode andparam1 .. paramNthe provided parameters which are dependend on thetypeThe following types are recognized so far, along with there parameters:
- Type: read (
RequestType.READ
Parameters:param1= MBean name,param2= Attribute name,param3 ... paramN= Inner Path. The inner path is optional and specifies a path into complex MBean attributes like collections or maps. If within collections/arrays/tabular data,paramXshould specify a numeric index, in maps/composite dataparamXis a used as a string key. . If the attribute name contains "," it is interpreted as a list of attributes.
which should be returned.
- Type: write (
RequestType.WRITE
Parameters:param1= MBean name,param2= Attribute name,param3= value,param4 ... paramN= Inner Path. The value must be URL encoded (with UTF-8 as charset), and must be convertible into a data structure - Type: exec (
RequestType.EXEC
Parameters:param1= MBean name,param2= operation name,param4 ... paramN= arguments for the operation. The arguments must be URL encoded (with UTF-8 as charset), and must be convertable into a data structure - Type: version (
RequestType.VERSION
Parameters: none - Type: search (
RequestType.SEARCH
Parameters:param1= MBean name pattern
- Parameters:
pPathInfo- path info of HTTP requestpProcessingParameters- processing parameters. Must not be null/- Returns:
- a newly created
JolokiaRequest
- Type: read (
-
createPostRequest
public static <R extends JolokiaRequest> R createPostRequest(Map<String, ?> pRequestMap, ProcessingParameters pProcessingParams) Create a singleJolokiaRequests from a JSON map representation of a request- Parameters:
pRequestMap- JSON representation of aJolokiaRequestpProcessingParams- additional map of operational parameters. Must not be null.- Returns:
- the created
JolokiaRequest
-
createPostRequests
public static List<JolokiaRequest> createPostRequests(List<?> pJsonRequests, ProcessingParameters pProcessingParams) Create a list ofJolokiaRequests from a JSON list representing jmx requests- Parameters:
pJsonRequests- JSON representation of a list ofJolokiaRequestpProcessingParams- processing options. Must not be null.- Returns:
- list with one or more
JolokiaRequest
-