Package org.waveprotocol.box.server.robots

Examples of org.waveprotocol.box.server.robots.OperationContextImpl


    WaveletBasedConversation.makeWaveletConversational(wavelet);
    ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create());
    ObservableConversation conversation = conversationUtil.buildConversation(wavelet).getRoot();
    conversation.getRootThread().appendBlip();

    context = new OperationContextImpl(waveletProvider, converter, conversationUtil);
    context.putWavelet(waveletName.waveId, waveletName.waveletId,
        new RobotWaveletData(waveletData, HASH_FACTORY.createVersionZero(waveletName)));
  }
View Full Code Here


      return;
    }

    // Create an unbound context.
    ProtocolVersion version = OperationUtil.getProtocolVersion(operations);
    OperationContextImpl context = new OperationContextImpl(
        waveletProvider, converterManager.getEventDataConverter(version), conversationUtil);

    executeOperations(context, operations, participant);
    handleResults(context, resp, version);
  }
View Full Code Here

      HashedVersion hashedVersion, RobotAccountData account) {
    // The robots we support should be sending us their version in their first
    // operation
    ProtocolVersion protocolVersion = OperationUtil.getProtocolVersion(operations);

    OperationContextImpl context = new OperationContextImpl(waveletProvider,
        converterManager.getEventDataConverter(protocolVersion), conversationUtil,
        new RobotWaveletData(wavelet, hashedVersion));

    executeOperations(context, operations, account);
    handleResults(context, account);
View Full Code Here

   */
  protected SearchResult performSearch(SearchRequest searchRequest, ParticipantId user) {
    OperationQueue opQueue = new OperationQueue();
    opQueue.search(searchRequest.getQuery(), searchRequest.getIndex(),
        searchRequest.getNumResults());
    OperationContextImpl context =
        new OperationContextImpl(waveletProvider,
            converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
    LOG.fine(
        "Performing query: " + searchRequest.getQuery() + " [" + searchRequest.getIndex() + ", "
            + (searchRequest.getIndex() + searchRequest.getNumResults()) + "]");
    OperationRequest operationRequest = opQueue.getPendingOperations().get(0);
    String opId = operationRequest.getId();
    OperationUtil.executeOperation(operationRequest, operationRegistry, context, user);
    JsonRpcResponse jsonRpcResponse = context.getResponses().get(opId);
    SearchResult searchResult =
        (SearchResult) jsonRpcResponse.getData().get(ParamsProperty.SEARCH_RESULTS);
    return searchResult;
  }
View Full Code Here

  private FetchProfilesResult fetchProfilesFromService(ParticipantId user,
      List<String> addresses) {
    OperationQueue opQueue = new OperationQueue();
    FetchProfilesRequest request = new FetchProfilesRequest(addresses);
    opQueue.fetchProfiles(request);
    OperationContextImpl context =
        new OperationContextImpl(waveletProvider,
            converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
    OperationRequest operationRequest = opQueue.getPendingOperations().get(0);
    String opId = operationRequest.getId();
    OperationUtil.executeOperation(operationRequest, operationRegistry, context, user);
    JsonRpcResponse jsonRpcResponse = context.getResponses().get(opId);
    FetchProfilesResult profileResults =
        (FetchProfilesResult) jsonRpcResponse.getData().get(ParamsProperty.FETCH_PROFILES_RESULT);
    return profileResults;
  }
View Full Code Here

      return;
    }

    // Create an unbound context.
    ProtocolVersion version = OperationUtil.getProtocolVersion(operations);
    OperationContextImpl context = new OperationContextImpl(
        waveletProvider, converterManager.getEventDataConverter(version), conversationUtil);

    executeOperations(context, operations, participant);
    handleResults(context, resp, version);
  }
View Full Code Here

   */
  protected SearchResult performSearch(SearchRequest searchRequest, ParticipantId user) {
    OperationQueue opQueue = new OperationQueue();
    opQueue.search(searchRequest.getQuery(), searchRequest.getIndex(),
        searchRequest.getNumResults());
    OperationContextImpl context =
        new OperationContextImpl(waveletProvider,
            converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
    LOG.fine(
        "Performing query: " + searchRequest.getQuery() + " [" + searchRequest.getIndex() + ", "
            + (searchRequest.getIndex() + searchRequest.getNumResults()) + "]");
    OperationRequest operationRequest = opQueue.getPendingOperations().get(0);
    String opId = operationRequest.getId();
    OperationUtil.executeOperation(operationRequest, operationRegistry, context, user);
    JsonRpcResponse jsonRpcResponse = context.getResponses().get(opId);
    SearchResult searchResult =
        (SearchResult) jsonRpcResponse.getData().get(ParamsProperty.SEARCH_RESULTS);
    return searchResult;
  }
View Full Code Here

  private FetchProfilesResult fetchProfilesFromService(ParticipantId user,
      List<String> addresses) {
    OperationQueue opQueue = new OperationQueue();
    FetchProfilesRequest request = new FetchProfilesRequest(addresses);
    opQueue.fetchProfiles(request);
    OperationContextImpl context =
        new OperationContextImpl(waveletProvider,
            converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
    OperationRequest operationRequest = opQueue.getPendingOperations().get(0);
    String opId = operationRequest.getId();
    OperationUtil.executeOperation(operationRequest, operationRegistry, context, user);
    JsonRpcResponse jsonRpcResponse = context.getResponses().get(opId);
    FetchProfilesResult profileResults =
        (FetchProfilesResult) jsonRpcResponse.getData().get(ParamsProperty.FETCH_PROFILES_RESULT);
    return profileResults;
  }
View Full Code Here

      HashedVersion hashedVersion, RobotAccountData account) {
    // The robots we support should be sending us their version in their first
    // operation
    ProtocolVersion protocolVersion = OperationUtil.getProtocolVersion(operations);

    OperationContextImpl context = new OperationContextImpl(waveletProvider,
        converterManager.getEventDataConverter(protocolVersion), conversationUtil,
        new RobotWaveletData(wavelet, hashedVersion));

    executeOperations(context, operations, account);
    handleResults(context, account);
View Full Code Here

    WaveletBasedConversation.makeWaveletConversational(wavelet);
    ConversationUtil conversationUtil = new ConversationUtil(FakeIdGenerator.create());
    ObservableConversation conversation = conversationUtil.buildConversation(wavelet).getRoot();
    conversation.getRootThread().appendBlip();

    context = new OperationContextImpl(waveletProvider, converter, conversationUtil);
    context.putWavelet(waveletName.waveId, waveletName.waveletId,
        new RobotWaveletData(waveletData, HASH_FACTORY.createVersionZero(waveletName)));
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.robots.OperationContextImpl

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.