|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.almende.eve.rpc.jsonrpc.JSONRPC
public class JSONRPC
Constructor Summary | |
---|---|
JSONRPC()
|
Method Summary | |
---|---|
static JSONRequest |
createRequest(Method method,
Object[] args)
Create a JSONRequest from a java method and arguments |
static List<Object> |
describe(Class<?> c,
RequestParams requestParams,
Boolean asJSON)
Describe all JSON-RPC methods of given class |
static JSONResponse |
invoke(Object object,
JSONRequest request)
Invoke a method on an object |
static JSONResponse |
invoke(Object object,
JSONRequest request,
RequestParams requestParams)
Invoke a method on an object |
static String |
invoke(Object object,
String request)
Invoke a method on an object |
static String |
invoke(Object object,
String request,
RequestParams requestParams)
Invoke a method on an object |
static List<String> |
validate(Class<?> c,
RequestParams requestParams)
Validate whether the given class contains valid JSON-RPC methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONRPC()
Method Detail |
---|
public static String invoke(Object object, String request) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
obj
- Request will be invoked on the given objectrequest
- A request in JSON-RPC format
IOException
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonGenerationException
public static String invoke(Object object, String request, RequestParams requestParams) throws com.fasterxml.jackson.core.JsonGenerationException, com.fasterxml.jackson.databind.JsonMappingException, IOException
obj
- Request will be invoked on the given objectrequest
- A request in JSON-RPC formatrequestParams
- Optional request parameters
IOException
com.fasterxml.jackson.databind.JsonMappingException
com.fasterxml.jackson.core.JsonGenerationException
public static JSONResponse invoke(Object object, JSONRequest request)
sender
- Sender urlobj
- will be invoked on the given object
public static JSONResponse invoke(Object object, JSONRequest request, RequestParams requestParams)
obj
- Request will be invoked on the given objectrequest
- A request in JSON-RPC formatrequestParams
- Optional request parameters
public static List<String> validate(Class<?> c, RequestParams requestParams)
c
- The class to be verifiedrequestParams
- optional request parameters
public static List<Object> describe(Class<?> c, RequestParams requestParams, Boolean asJSON)
c
- The class to be describedrequestParams
- Optional request parameters.asJSON
- If true, the described methods will be in an easy
to parse JSON structure. If false, the returned
description will be in human readable format.
public static JSONRequest createRequest(Method method, Object[] args)
method
- args
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |