/** * 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; }
opQueue.clear(); WaveletData waveletData = (WaveletData) response.get(ParamsProperty.WAVELET_DATA); Map<String, Blip> blips = new HashMap<String, Blip>();
/** * Processes the incoming HTTP request that contains the event bundle. * * @param req the HTTP request. * @param resp the HTTP response. */ private void processRpc(HttpServletRequest req, HttpServletResponse resp) { // Deserialize and process the incoming events. EventMessageBundle events = null; try { events = deserializeEvents(req); } catch (IOException e) { resp.setStatus(HttpURLConnection.HTTP_INTERNAL_ERROR); return; } // Append robot.notifyCapabilitiesHash operation before processing the // events. OperationQueue operationQueue = events.getWavelet().getOperationQueue(); operationQueue.notifyRobotInformation(WaveService.PROTOCOL_VERSION, version); // Call the robot event handlers. processEvents(events); // Serialize the operations. serializeOperations(operationQueue.getPendingOperations(), resp); operationQueue.clear(); }