Package com.google.nigori.common

Examples of com.google.nigori.common.NotFoundException


      Response response =
          postResponse(MessageLibrary.REQUEST_GET_REVISIONS, MessageLibrary.toJson(request));

      if (response.notFound()) {
        // request was successful, but no data key by that name was found.
        throw new NotFoundException(response.jsonResponse);
      }

      if (!success(response.resp)) {
        failure(response);
      }
View Full Code Here


    if (request.hasRevision()) {
     
      value = new ArrayList<RevValue>(1);
      RevValue revVal = database.getRevision(user, index, revision);
      if (revVal == null) {
        throw new NotFoundException("Cannot find requested index with revision");
      }
      value.add(revVal);
    } else {
      value = database.getRecord(user, index);
    }
    if (value == null) {
      throw new NotFoundException("No value for that index");
    }
    return MessageLibrary.getResponseAsProtobuf(value);
  }
View Full Code Here

    User user = authenticateUser(auth,MessageLibrary.REQUEST_GET_INDICES);

    Collection<byte[]> value = database.getIndices(user);

    if (value == null) {
      throw new NotFoundException("Cannot find indices");
    }
    return MessageLibrary.getIndicesResponseAsProtobuf(value);
  }
View Full Code Here

    User user = authenticateUser(auth,MessageLibrary.REQUEST_GET_REVISIONS,index);

    Collection<byte[]> value = database.getRevisions(user, index);

    if (value == null) {
      throw new NotFoundException("Cannot find requested key");
    }
    return MessageLibrary.getRevisionsResponseAsProtobuf(value);
  }
View Full Code Here

    byte[] index = request.getKey().toByteArray();
    User user = authenticateUser(auth,MessageLibrary.REQUEST_DELETE,index);

    boolean exists = database.getRecord(user, index) != null;
    if (!exists) {
      throw new NotFoundException("No such index: "
          + Base64.encodeBase64(request.getKey().toByteArray()));
    }

    return database.deleteRecord(user, index);
  }
View Full Code Here

TOP

Related Classes of com.google.nigori.common.NotFoundException

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.