/** * Send async. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> void call(final URI url, final String method, final ObjectNode params) throws IOException { caller.call(url, method, params); }
/** * Send sync, expecting a response. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param clazz * the clazz * @return response * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> T callSync(final URI url, final String method, final ObjectNode params, final Class<T> clazz) throws IOException { return caller.callSync(url, method, params, clazz); }
/** * Send async for usage in proxies. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param callback * the callback * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> void call(final URI url, final Method method, final Object[] params, final AsyncCallback<T> callback) throws IOException { caller.call(url, method, params, callback); }
/** * Call sync. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param type * the type * @return the t * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> T callSync(final URI url, final String method, final ObjectNode params, final TypeUtil<T> type) throws IOException { return caller.callSync(url, method, params, type); }
/** * Send async. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param callback * the callback * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> void call(final URI url, final String method, final ObjectNode params, final AsyncCallback<T> callback) throws IOException { caller.call(url, method, params, callback); }
/** * Call sync. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param type * the type * @return the t * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> T callSync(final URI url, final String method, final ObjectNode params, final Type type) throws IOException { return caller.callSync(url, method, params, type); }
/** * Gets the all leafs. * * @return the all leafs * @throws IOException * IOException */ public List<URI> getAllLeafs() throws IOException { result.clear(); resCount[0] = children.size(); if (children.size() > 0) { for (URI child : children) { caller.call(child, "requestLeafs", null); } } synchronized (result) { try { result.wait(); } catch (InterruptedException e) {} } return result; } }
/** * Call sync. * * @param <T> * the generic type * @param url * the url * @param method * the method * @param params * the params * @param type * the type * @return the t * @throws IOException * Signals that an I/O exception has occurred. */ protected <T> T callSync(final URI url, final String method, final ObjectNode params, final JavaType type) throws IOException { return caller.callSync(url, method, params, type); }
/** * Request leafs. * * @throws IOException * Signals that an I/O exception has occurred. */ public void requestLeafs() throws IOException { synchronized (result) { result.clear(); } getState().get("key", String.class); resCount[0] = children.size(); if (children.size() > 0) { for (URI child : children) { caller.call(child, "requestLeafs", null); } } else { synchronized (result) { result.add(getUrls().get(0)); } ObjectNode params = JOM.createObjectNode(); params.set("leafs", JOM.getInstance().valueToTree(result)); caller.call(parent, "putLeafs", params); } }
/** * Put leafs. * * @param res * the res * @throws IOException * Signals that an I/O exception has occurred. */ public void putLeafs(@Name("leafs") List<URI> res) throws IOException { synchronized (result) { result.addAll(res); } synchronized (resCount) { resCount[0]--; if (resCount[0] <= 0) { if (parent != null) { ObjectNode params = JOM.createObjectNode(); params.set("leafs", JOM.getInstance().valueToTree(result)); caller.call(parent, "putLeafs", params); } synchronized (result) { result.notifyAll(); } } } }