Package org.teiid.client

Examples of org.teiid.client.RequestMessage


  private ResultsMessage exampleResultsMsg3() {
    return exampleMessage(new List[0], new String[] { "IntNum", "StringNum" }, new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.STRING }); //$NON-NLS-1$ //$NON-NLS-2$
  }
 
  private static ResultsMessage exampleResultsMsg4(int begin, int length, int fetchSize, boolean lastBatch) {
    RequestMessage request = new RequestMessage();
    request.setExecutionId(REQUEST_ID);
    ResultsMessage resultsMsg = new ResultsMessage(request);
    List[] results = exampleResults1(length, begin);
    resultsMsg.setResults(results);
    resultsMsg.setColumnNames(new String[] { "IntKey" }); //$NON-NLS-1$
    resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.INTEGER });
View Full Code Here


      assertEquals("The cursor is not on a valid row.", e.getMessage()); //$NON-NLS-1$
    }
  }
 
  @Test public void testDateType() throws SQLException {
    RequestMessage request = new RequestMessage();
    request.setExecutionId(REQUEST_ID);
    ResultsMessage resultsMsg = new ResultsMessage(request);
    resultsMsg.setResults(new List[] {Arrays.asList(new Timestamp(0))});
    resultsMsg.setColumnNames(new String[] { "TS" }); //$NON-NLS-1$
    resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.TIMESTAMP });
    resultsMsg.setFirstRow(1);
View Full Code Here

  }
 
  public void testGetOutputParameter() throws Exception {
    CallableStatementImpl mmcs = getCallableStatement();
   
    RequestMessage request = new RequestMessage();
    request.setExecutionId(1);
    ResultsMessage resultsMsg = new ResultsMessage(request);
    List[] results = new List[] {Arrays.asList(null, null, null), Arrays.asList(null, 1, 2)};
    resultsMsg.setResults(results);
    resultsMsg.setColumnNames(new String[] { "IntNum", "Out1", "Out2" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    resultsMsg.setDataTypes(new String[] { JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER, JDBCSQLTypeInfo.INTEGER });
View Full Code Here

  private AtomicRequestMessage createRequest(Object processorId,
      Command command, String modelName, String connectorBindingId, int nodeID)
      throws TeiidProcessingException, TeiidComponentException {
    RequestWorkItem workItem = requestMgr.getRequestWorkItem((RequestID)processorId);
   
      RequestMessage request = workItem.requestMsg;
    // build the atomic request based on original request + context info
        AtomicRequestMessage aqr = new AtomicRequestMessage(request, workItem.getDqpWorkContext(), nodeID);
        aqr.setCommand(command);
        aqr.setModelName(modelName);
        aqr.setMaxResultRows(requestMgr.getMaxSourceRows());
        aqr.setExceptionOnMaxRows(requestMgr.isExceptionOnMaxSourceRows());
        aqr.setPartialResults(request.supportsPartialResults());
        aqr.setSerial(requestMgr.getUserRequestSourceConcurrency() == 1);
        if (nodeID >= 0) {
          aqr.setTransactionContext(workItem.getTransactionContext());
        }
        aqr.setFetchSize(this.bufferService.getBufferManager().getConnectorBatchSize());
View Full Code Here

    }
   
    @Override
    protected RequestMessage createRequestMessage(String[] commands,
        boolean isBatchedCommand, ResultsMode resultsMode) {
      RequestMessage message = super.createRequestMessage(commands, false, resultsMode);
      message.setStatementType(StatementType.PREPARED);
      message.setParameterValues(isBatchedCommand?getParameterValuesList(): getParameterValues());
      message.setBatchedUpdate(isBatchedCommand);
      return message;
    }
View Full Code Here

    void logMMCommand(RequestWorkItem workItem, Event status, Integer rowCount) {
      if (!LogManager.isMessageToBeRecorded(LogConstants.CTX_COMMANDLOGGING, MessageLevel.DETAIL)) {
        return;
      }
     
        RequestMessage msg = workItem.requestMsg;
        DQPWorkContext workContext = DQPWorkContext.getWorkContext();
        RequestID rID = new RequestID(workContext.getSessionId(), msg.getExecutionId());
      String txnID = null;
    TransactionContext tc = workItem.getTransactionContext();
    if (tc != null && tc.getTransactionType() != Scope.NONE) {
      txnID = tc.getTransactionId();
    }
      String appName = workContext.getAppName();
        // Log to request log
        CommandLogMessage message = null;
        if (status == Event.NEW) {
            message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), appName, workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), msg.getCommandString());
        } else {
            message = new CommandLogMessage(System.currentTimeMillis(), rID.toString(), txnID, workContext.getSessionId(), workContext.getUserName(), workContext.getVdbName(), workContext.getVdbVersion(), rowCount, status);
        }
        LogManager.log(MessageLevel.DETAIL, LogConstants.CTX_COMMANDLOGGING, message);
    }
View Full Code Here

TOP

Related Classes of org.teiid.client.RequestMessage

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.