Package org.rstudio.core.client.jsonrpc

Examples of org.rstudio.core.client.jsonrpc.RequestLogEntry


      overviewPanel_.setSize(totalWidth + "px", totalHeight_ + "px");

      for (int i = 0, entriesLength = entries_.length; i < entriesLength; i++)
      {
         RequestLogEntry entry = entries_[i];
         addEntry(i, entry);
      }

      if (scrollToEnd)
      {
View Full Code Here


                        Iterator<String[]> it = reader.iterator();
                        String now = it.next()[0];
                        while (it.hasNext())
                        {
                           String[] line = it.next();
                           RequestLogEntry entry =
                                 RequestLogEntry.fromValues(line);
                           if (entry != null)
                              entries.add(entry);
                        }
                        now_ = Long.parseLong(now);
View Full Code Here

     
      // request log entry (fake up a json rpc method call to conform
      // to the data format expected by RequestLog
      String requestId = Integer.toString(Random.nextInt());
      String requestData = createRequestData();
      final RequestLogEntry logEntry = RequestLog.log(requestId, requestData);
     
      // form submit complete handler
      updateCredentialsForm.addSubmitCompleteHandler(new SubmitCompleteHandler(){

         public void onSubmitComplete(SubmitCompleteEvent event)
         {
            // parse the results
            String results = event.getResults();             
            RpcResponse response = RpcResponse.parse(event.getResults());
            if (response != null)
            {
               logEntry.logResponse(ResponseType.Normal, results);
               
               // check for error
               RpcError rpcError = response.getError();
               if (rpcError != null)
               {
                  if (rpcError.getCode() == RpcError.METHOD_NOT_FOUND)
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_UNSUPPORTED));
                  }
                  else
                  {
                     requestCallback.onError(new RemoteServerError(rpcError));
                  }
               }
               else // must be a valid response
               {
                  Bool authenticated = response.getResult();
                  if (authenticated.getValue())
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_SUCCESS));
                  }
                  else
                  {
                     requestCallback.onResponseReceived(
                                 new Integer(CREDENTIALS_UPDATE_FAILURE));
                  }
               }
            }
            else // error parsing results
           
               logEntry.logResponse(ResponseType.Error, results);
              
               // form message
               String msg = "Error parsing results: " +
                            (results != null ? results : "(null)");
              
View Full Code Here

TOP

Related Classes of org.rstudio.core.client.jsonrpc.RequestLogEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.