Package org.yaac.shared.egql

Examples of org.yaac.shared.egql.Result


  /**
   * @param statementKey
   * @return
   */
  public static Result newResult(String statementKey) {
    Result obj = abf.statementResult().as();
    obj.setStatementKey(statementKey);
    return obj;
  }
View Full Code Here


   
    // step 3 : convert data from propertyInfo to result cell
    List<List<ResultCell>> resultCellResult = processResult(context, propertyInfoResult);
   
    // step 4 : serialize and send result
    Result stmtResult = AutoBeanUtil.newResult(KeyFactory.keyToString(context.getPipelineKey()));
    stmtResult.setResult(resultCellResult);
    stmtResult.setStatus(context.getStatus());
    sendMsg(context.getClientId(), AutoBeanUtil.encode(Result.class, stmtResult));
   
    // nothing to return
    return null;
  }
View Full Code Here

      logger.info("Empty msg is ignored");
    }
   
    if (msg.length() > EGQLConstant.MAX_RESULT_MSG_SIZE) {
      // split msg and send again
      Result allInOne = AutoBeanUtil.decode(Result.class, msg);
     
      int allInOneSize = allInOne.getResult().size();
      if (allInOneSize == 1) {  // can not send even one result
        // TODO : notify client
        logger.info("message too big even for single record, discarded. Size = " + msg.length());
        return;
      } else {
View Full Code Here

  }
 
  private List<Result> splitResult(Result allInOneResult, int splitSize) {
    List<Result> results = new LinkedList<Result>();
   
    Result curr = null;
   
    int idx = 0;
    for (List<ResultCell> row : allInOneResult.getResult()) {
      if ((idx ++) % splitSize == 0) {
        curr = AutoBeanUtil.newResult(allInOneResult.getStatementKey());
        curr.setStatus(allInOneResult.getStatus());
        curr.setTimestamp(allInOneResult.getTimestamp());
        curr.setResult(new ArrayList<List<ResultCell>>(splitSize));
       
        results.add(curr);
      }
     
      curr.getResult().add(row);
    }
   
    return results;
  }
View Full Code Here

  /* (non-Javadoc)
   * @see org.yaac.client.ui.EGQLView#onMessage(java.lang.String)
   */
  @Override
  public void onMessage(String msg) {   
    Result result = AutoBeanUtil.decode(Result.class, msg);

    EGQLResultPanel resultPanel = resultPanelMap.get(result.getStatementKey());
   
    if (resultPanel == null) {
      System.out.println("Ignored unexpected message from server side: ");
      System.out.println(msg);
      return;
    }
   
    resultPanel.appendData(result.getResult());
    resultPanel.status(result.getStatus());
  }
View Full Code Here

TOP

Related Classes of org.yaac.shared.egql.Result

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.