@Override @SuppressWarnings("unchecked") public Map<String, Object> getLinkInfo(String sender, String receiver) throws XmlRpcException { return (Map<String, Object>) client.execute("getLinkInfo", new Object[]{sender, receiver}); }
private Object call(String command, Object... args) throws Exception { Object[] vector; if (token != null) { vector = new Object[args.length + 1]; vector[0] = token; System.arraycopy(args, 0, vector, 1, args.length); } else { vector = args; } return client.execute("jira1." + command, vector); }
@Override @SuppressWarnings("unchecked") public List<Map<String, Object>> getLinks(String address, int flags) throws XmlRpcException { Object[] rval = (Object[]) client.execute("getLinks", new Object[]{address, flags}); List<Map<String, Object>> l = new ArrayList<>(); for (Object o: rval) { l.add((Map<String, Object>)o); } return l; }
/** Performs a request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(String pMethodName, List pParams) throws XmlRpcException { return execute(getClientConfig(), pMethodName, pParams); }
/** Performs a request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcClientConfig pConfig, String pMethodName, List pParams) throws XmlRpcException { return execute(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams)); }
/** Performs a request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcClientConfig pConfig, String pMethodName, List pParams) throws XmlRpcException { return execute(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams)); }
@Override @SuppressWarnings("unchecked") public DeviceDescription getDeviceDescription(String address) throws XmlRpcException { Object o = client.execute("getDeviceDescription", new Object[]{address}); return new DeviceDescriptionXmlRpc((Map<String, Object>) o); }
@Override @SuppressWarnings("unchecked") public XmlRpcStruct rssiInfo() throws XmlRpcException { return new MapXmlRpcStruct((Map<String, Object>)client.execute("rssiInfo", new Object[]{})); }
/** Performs a request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcClientConfig pConfig, String pMethodName, Object[] pParams) throws XmlRpcException { return execute(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams)); }
/** Performs a request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(String pMethodName, Object[] pParams) throws XmlRpcException { return execute(getClientConfig(), pMethodName, pParams); }
/** Performs a request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(String pMethodName, Object[] pParams) throws XmlRpcException { return execute(getClientConfig(), pMethodName, pParams); }
/** Performs a request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(String pMethodName, List pParams) throws XmlRpcException { return execute(getClientConfig(), pMethodName, pParams); }
/** Performs a request with the given configuration. * @param pConfig The request configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(XmlRpcClientConfig pConfig, String pMethodName, List pParams) throws XmlRpcException { return execute(new XmlRpcClientRequestImpl(pConfig, pMethodName, pParams)); }
/** Performs a request with the clients default configuration. * @param pMethodName The method being performed. * @param pParams The parameters. * @return The result object. * @throws XmlRpcException Performing the request failed. */ public Object execute(String pMethodName, Object[] pParams) throws XmlRpcException { return execute(getClientConfig(), pMethodName, pParams); }
@Override @SuppressWarnings("unchecked") public List<DeviceDescription> listDevices() throws XmlRpcException { Object[] a = (Object[]) client.execute("listDevices", new Object[]{}); List<DeviceDescription> rval = new ArrayList<>(a.length); for (Object o: a) { rval.add(new DeviceDescriptionXmlRpc((Map<String, Object>) o)); } return rval; }
@Override @SuppressWarnings("unchecked") public XmlRpcStruct getParamset(String address, String paramset_key) throws XmlRpcException { return new MapXmlRpcStruct((Map<String, Object>)client.execute("getParamset", new Object[]{address, paramset_key})); }
private boolean runCommand(String method, Object... params) { try { getRpcClient().execute(method, params); return true; } catch (XmlRpcException e) { throw new IllegalStateException(e); } }
void deleteEntry(final String id) throws BlogClientException { try { getXmlRpcClient().execute("blogger.deletePost", new Object[] { appkey, id, userName, password, Boolean.FALSE }); } catch (final Exception e) { throw new BlogClientException("ERROR: XML-RPC error getting entry", e); } }
public Object execute(String exec, Object[] param) throws CommandException { Object reply = null; try { reply = (Boolean) this.client.execute(exec, param); } catch (XmlRpcException e) { throw new CommandException(e.getMessage()); } return reply; }
/** * Test Xml Rpc by java class call with a Object List * @throws Exception */ public void testXmlRpcRequest() throws Exception { XmlRpcClient client = this.getRpcClient(url, "admin", "ofbiz"); Object[] params = new Object[] { 55.00, "message from xml-rpc client" }; Map<String, Object> result = UtilGenerics.cast(client.execute("testScv", params)); assertEquals("XML-RPC Service result success", "service done", result.get("resp")); }