Package com.google.wave.api

Examples of com.google.wave.api.OperationQueue


  /**
   * Performs search using Data API.
   */
  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);
View Full Code Here


  /**
   * Fetches multiple profiles using Data API.
   */
  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);
View Full Code Here

    if (jsonObj.has(RPC_SERVER_URL_TAG)) {
      rpcServerUrl = jsonObj.get(RPC_SERVER_URL_TAG).getAsString();
    }
    EventMessageBundle result = new EventMessageBundle(robotAddress, rpcServerUrl);

    OperationQueue operationQueue;
    if (jsonObj.has(PROXYING_FOR_TAG)) {
      result.setProxyingFor(jsonObj.get(PROXYING_FOR_TAG).getAsString());
      operationQueue = new OperationQueue(new ArrayList<OperationRequest>(),
          result.getProxyingFor());
    } else {
      operationQueue = new OperationQueue();
    }

    // Deserialize wavelet.
    WaveletData waveletData = context.deserialize(jsonObj.get(WAVELET_TAG), WaveletData.class);
    result.setWaveletData(waveletData);
View Full Code Here

    if (jsonObj.has(RPC_SERVER_URL_TAG)) {
      rpcServerUrl = jsonObj.get(RPC_SERVER_URL_TAG).getAsString();
    }
    EventMessageBundle result = new EventMessageBundle(robotAddress, rpcServerUrl);

    OperationQueue operationQueue;
    if (jsonObj.has(PROXYING_FOR_TAG)) {
      result.setProxyingFor(jsonObj.get(PROXYING_FOR_TAG).getAsString());
      operationQueue = new OperationQueue(new ArrayList<OperationRequest>(),
          result.getProxyingFor());
    } else {
      operationQueue = new OperationQueue();
    }

    // Deserialize wavelet.
    WaveletData waveletData = context.deserialize(jsonObj.get(WAVELET_TAG), WaveletData.class);
    result.setWaveletData(waveletData);
View Full Code Here

    // what the state of the wavelet is (it might have changed on the server).
    // This means we have to be careful.
    JsonObject json = new JsonParser().parse(e.getMessage()).getAsJsonObject();
    WaveletData waveletData = SERIALIZER.fromJson(json.get("wavelet"), WaveletData.class);
    BlipData blipData = SERIALIZER.fromJson(json.get("blip"), BlipData.class);
    OperationQueue operationQueue = new OperationQueue();

    Map<String, Blip> blips = new HashMap<String, Blip>();
    Wavelet originalWavelet = Wavelet.deserialize(operationQueue, blips, waveletData);

    Blip rootBlip = Blip.deserialize(operationQueue, originalWavelet, blipData);
View Full Code Here

  /**
   * Performs search using Data API.
   */
  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);
View Full Code Here

    if (jsonObj.has(RPC_SERVER_URL_TAG)) {
      rpcServerUrl = jsonObj.get(RPC_SERVER_URL_TAG).getAsString();
    }
    EventMessageBundle result = new EventMessageBundle(robotAddress, rpcServerUrl);

    OperationQueue operationQueue;
    if (jsonObj.has(PROXYING_FOR_TAG)) {
      result.setProxyingFor(jsonObj.get(PROXYING_FOR_TAG).getAsString());
      operationQueue = new OperationQueue(new ArrayList<OperationRequest>(),
          result.getProxyingFor());
    } else {
      operationQueue = new OperationQueue();
    }

    // Deserialize wavelet.
    WaveletData waveletData = context.deserialize(jsonObj.get(WAVELET_TAG), WaveletData.class);
    result.setWaveletData(waveletData);
View Full Code Here

  /**
   * Fetches multiple profiles using Data API.
   */
  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);
View Full Code Here

TOP

Related Classes of com.google.wave.api.OperationQueue

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.