/** * Submits the given operation. * * @param opQueue the operation queue with operation to be submitted. * @param rpcServerUrl the active gateway to send the operations to. * @return the data of response. * @throws IllegalStateException if this method is called prior to setting the * proper consumer key, secret, and handler URL. * @throws IOException if there is a problem submitting the operations, or error response. */ private Map<ParamsProperty, Object> makeSingleOperationRpc(OperationQueue opQueue, String rpcServerUrl) throws IOException { JsonRpcResponse response = makeRpc(opQueue, rpcServerUrl).get(0); if (response.isError()) { throw new IOException(response.getErrorMessage()); } return response.getData(); }
/** * Submits the pending operations associated with this {@link Wavelet}. * * @param wavelet the bundle that contains the operations to be submitted. * @param rpcServerUrl the active gateway to send the operations to. * @return a list of {@link JsonRpcResponse} that represents the responses * from the server for all operations that were submitted. * * @throws IllegalStateException if this method is called prior to setting the * proper consumer key, secret, and handler URL. * @throws IOException if there is a problem submitting the operations. */ public List<JsonRpcResponse> submit(Wavelet wavelet, String rpcServerUrl) throws IOException { List<JsonRpcResponse> responses = makeRpc(wavelet.getOperationQueue(), rpcServerUrl); wavelet.getOperationQueue().clear(); return responses; }