Package org.waveprotocol.wave.communication

Examples of org.waveprotocol.wave.communication.Blob


  /**
   * Serializes a {@link HashedVersion} POJO to a {@link ProtocolHashedVersion}.
   */
  public static ProtocolHashedVersion serialize(HashedVersion hashedVersion) {
    Blob b64Hash = new Blob(Codec.encode(hashedVersion.getHistoryHash()));
    ProtocolHashedVersion version = ProtocolHashedVersionJsoImpl.create();
    version.setVersion(hashedVersion.getVersion());
    version.setHistoryHash(b64Hash);
    return version;
  }
View Full Code Here


    super.copyFrom((ProtocolSignedDeltaJsoImpl) message);
  }

  @Override
  public Blob getDelta() {
    return hasProperty(this, keyDelta) ? new Blob(getPropertyAsString(this, keyDelta)) : null;
  }
View Full Code Here

      public Blob getCertificate(int n) {
    initArray(this, keyCertificate);
    JsArrayString array = getPropertyAsObject(this, keyCertificate).cast();
    if (n < 0) throw new IllegalArgumentException("index " + n + " < 0");
    if (array.length() <= n) throw new IllegalArgumentException("index " + n + ">= array length " + array.length());
    return new Blob(array.get(n));
  }
View Full Code Here

    setPropertyAsDouble(this, keyVersion, value);
  }

  @Override
  public Blob getHistoryHash() {
    return hasProperty(this, keyHistoryHash) ? new Blob(getPropertyAsString(this, keyHistoryHash)) : null;
  }
View Full Code Here

    super.copyFrom((ProtocolSignatureJsoImpl) message);
  }

  @Override
  public Blob getSignatureBytes() {
    return hasProperty(this, keySignatureBytes) ? new Blob(getPropertyAsString(this, keySignatureBytes)) : null;
  }
View Full Code Here

    setPropertyAsString(this, keySignatureBytes, blob.getData());
  }

  @Override
  public Blob getSignerId() {
    return hasProperty(this, keySignerId) ? new Blob(getPropertyAsString(this, keySignerId)) : null;
  }
View Full Code Here

      setDomain(jsonObject.get("2").getAsString());
    }
    if (jsonObject.has("3")) {
      JsonArray array = jsonObject.get("3").getAsJsonArray();
      for (int i = 0; i < array.size(); i++) {
        addCertificate(new Blob(array.get(i).getAsString()));
      }
    }
  }
View Full Code Here

    reset();
    JsonObject jsonObject = json.getAsJsonObject();
    // NOTE: always check with has(...) as the json might not have all required
    // fields set.
    if (jsonObject.has("1")) {
      setSignatureBytes(new Blob(jsonObject.get("1").getAsString()));
    }
    if (jsonObject.has("2")) {
      setSignerId(new Blob(jsonObject.get("2").getAsString()));
    }
    if (jsonObject.has("3")) {
      setSignatureAlgorithm(ProtoEnums.valOf(jsonObject.get("3").getAsInt(), SignatureAlgorithm.values()));
    }
  }
View Full Code Here

    // fields set.
    if (jsonObject.has("1")) {
      setVersion(jsonObject.get("1").getAsDouble());
    }
    if (jsonObject.has("2")) {
      setHistoryHash(new Blob(jsonObject.get("2").getAsString()));
    }
  }
View Full Code Here

    reset();
    JsonObject jsonObject = json.getAsJsonObject();
    // NOTE: always check with has(...) as the json might not have all required
    // fields set.
    if (jsonObject.has("1")) {
      setDelta(new Blob(jsonObject.get("1").getAsString()));
    }
    if (jsonObject.has("2")) {
      JsonArray array = jsonObject.get("2").getAsJsonArray();
      for (int i = 0; i < array.size(); i++) {
        ProtocolSignatureGsonImpl payload = new ProtocolSignatureGsonImpl();
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.communication.Blob

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.