Package com.google.nigori.common.NigoriMessages

Examples of com.google.nigori.common.NigoriMessages.GetResponse


    // TODO(drt24) add index
    List<RevisionValue> protoRevisions = new ArrayList<RevisionValue>(revisions.size());
    for (RevValue rv : revisions){
      protoRevisions.add(RevisionValue.newBuilder().setRevision(ByteString.copyFrom(rv.getRevision().getBytes())).setValue(ByteString.copyFrom(rv.getValue())).build());
    }
    GetResponse resp = GetResponse.newBuilder()
        .addAllRevisions(protoRevisions)
        .build();

    return resp;
  }
View Full Code Here


    public void handle(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
        IOException, JsonConversionException, NotFoundException, UnauthorisedException {

      String json = getJsonAsString(req, maxJsonQueryLength);
      GetRequest request = MessageLibrary.getRequestFromJson(json);
      GetResponse response = protocol.get(request);

      String jsonresponse = MessageLibrary.toJson(response);
      resp.setContentType(MessageLibrary.MIMETYPE_JSON);
      resp.setCharacterEncoding(MessageLibrary.CHARSET);
      resp.setStatus(HttpServletResponse.SC_OK);
View Full Code Here

        encRevision = keyManager.encryptDeterministically(encKey, revision.getBytes());
      }
    }

    try {
      GetResponse getResponse =
          protocol.get(MessageLibrary.getRequestAsProtobuf(keyManager.getServerName(),
              keyManager.signer(), encIndex, encRevision));
      if (getResponse == null) {
        return null;
      }
      List<RevisionValue> revisions = getResponse.getRevisionsList();
      List<RevValue> answer = new ArrayList<RevValue>(revisions.size());
      for (RevisionValue revisionValue : revisions) {
        byte[] revisionciphertext = revisionValue.getRevision().toByteArray();
        byte[] valueciphertext = revisionValue.getValue().toByteArray();
        if (encKey == null) {
View Full Code Here

    out.flush();

    runReplayVerifyWithDoPost(out);

    String jsonResponse = new String(result.getValue(), 0, size.getValue(), MessageLibrary.CHARSET);
    GetResponse getResponse = MessageLibrary.getResponseFromJson(jsonResponse);

    List<RevisionValue> revs = getResponse.getRevisionsList();
    assertEquals(1, revs.size());
    for (RevisionValue rev : revs) {
      assertArrayEquals(revision, rev.getRevision().toByteArray());
      assertArrayEquals(value, rev.getValue().toByteArray());
    }
View Full Code Here

TOP

Related Classes of com.google.nigori.common.NigoriMessages.GetResponse

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.