Package org.waveprotocol.wave.federation.Proto

Examples of org.waveprotocol.wave.federation.Proto.ProtocolHashedVersion


      }

      // Optionally submit any received last committed notice.
      Element commitNoticeElement = waveletUpdate.element("commit-notice");
      if (commitNoticeElement != null) {
        ProtocolHashedVersion version = ProtocolHashedVersion.newBuilder()
            .setHistoryHash(Base64Util.decode(commitNoticeElement.attributeValue("history-hash")))
            .setVersion(Long.parseLong(commitNoticeElement.attributeValue("version"))).build();
        callbackCount.incrementAndGet(); // Increment required callbacks.
        listener.waveletCommitUpdate(waveletName, version, callback);
      }
View Full Code Here


      }
    } else {
      listener.onFailure(FederationErrors.badRequest("Bad response packet: " + historyResponse));
    }

    final ProtocolHashedVersion lastCommitted;
    if (lastCommittedVersion > -1) {
      // TODO(thorogood): fedone doesn't send a history hash, and it's arguable
      // that it's even sane to include it.
      // Can't set it to null - NPE
      lastCommitted =
View Full Code Here

      }
    }

    Set<String> remoteDomainsToNotify = Sets.difference(domainsToNotify, localDomains);
    if (!remoteDomainsToNotify.isEmpty()) {
      ProtocolHashedVersion serializedVersion = CoreWaveletOperationSerializer.serialize(version);
      for (String domain : remoteDomainsToNotify) {
        federationHosts.get(domain).waveletCommitUpdate(
            waveletName, serializedVersion, federationCallback("commit notice"));
      }
    }
View Full Code Here

            || historyDelta.attribute("wavelet-name") == null) {
      responseCallback.error(FederationErrors.badRequest("Malformed history request"));
      return;
    }

    final ProtocolHashedVersion startVersion;
    try {
      startVersion = parseFromUnsafe(historyDelta.attributeValue("start-version"),
          historyDelta.attributeValue("start-version-hash"));
    } catch (IllegalArgumentException e) {
      responseCallback.error(FederationErrors.badRequest("Invalid format of start version"));
      return;
    }

    final ProtocolHashedVersion endVersion;
    try {
      endVersion = parseFromUnsafe(historyDelta.attributeValue("end-version"),
          historyDelta.attributeValue("end-version-hash"));
    } catch (IllegalArgumentException e) {
      responseCallback.error(FederationErrors.badRequest("Invalid format of end version"));
View Full Code Here

    } catch (IllegalArgumentException e) {
      responseCallback.error(FederationErrors.badRequest("Malformed signer ID"));
      return;
    }

    final ProtocolHashedVersion deltaEndVersion;
    try {
      deltaEndVersion = parseFromUnsafe(signerRequest.attributeValue("version"),
          signerRequest.attributeValue("history-hash"));
    } catch (IllegalArgumentException e) {
      responseCallback.error(FederationErrors.badRequest("Invalid hashed version"));
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.federation.Proto.ProtocolHashedVersion

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.