@Test(expected = InvalidCollectionException.class) public void replaceThrowsAnInvalidCollectionExceptionWhenTheCollectionIsUnknown() throws Exception { JsonCrudService instance = createInstanceWithoutKnownCollections(); instance.replace("unknown_collection", null, null, null); }
public void replace(String collectionName, UUID id, ObjectNode data, User user) throws InvalidCollectionException, IOException, NotFoundException, AlreadyUpdatedException, PermissionFetchingException { final Collection collection = mappings.getCollection(collectionName) .orElseThrow(() -> new InvalidCollectionException(collectionName)); if (collection.isRelationCollection()) { replaceRelation(collection, id, data, user); } else { replaceEntity(collection, id, data, user); } }
JsonCrudService { public void replace(String collectionName, UUID id, ObjectNode data, User user) throws InvalidCollectionException, IOException, NotFoundException, AlreadyUpdatedException, PermissionFetchingException { final Collection collection = mappings.getCollection(collectionName) .orElseThrow(() -> new InvalidCollectionException(collectionName)); if (collection.isRelationCollection()) { replaceRelation(collection, id, data, user); } else { replaceEntity(collection, id, data, user); } } }
JsonCrudService { public void replace(String collectionName, UUID id, ObjectNode data, User user) throws InvalidCollectionException, IOException, NotFoundException, AlreadyUpdatedException, PermissionFetchingException { final Collection collection = mappings.getCollection(collectionName) .orElseThrow(() -> new InvalidCollectionException(collectionName)); if (collection.isRelationCollection()) { replaceRelation(collection, id, data, user); } else { replaceEntity(collection, id, data, user); } } JsonCrudService(Vres mappings, UserValidator userValidator, UrlGenerator relationUrlFor,
                         TimbuctooActions timDbAccess); }
JsonCrudService { public void replace(String collectionName, UUID id, ObjectNode data, User user) throws InvalidCollectionException, IOException, NotFoundException, AlreadyUpdatedException, PermissionFetchingException { final Collection collection = mappings.getCollection(collectionName) .orElseThrow(() -> new InvalidCollectionException(collectionName)); if (collection.isRelationCollection()) { replaceRelation(collection, id, data, user); } else { replaceEntity(collection, id, data, user); } } JsonCrudService(Vres mappings, UserValidator userValidator, UrlGenerator relationUrlFor,
                         TimbuctooActions timDbAccess); UUID create(String collectionName, ObjectNode input, User user); JsonNode get(String collectionName, UUID id); JsonNode get(String collectionName, UUID id, Integer rev); List<ObjectNode> getCollection(String collectionName, int rows, int start, boolean withRelations); void replace(String collectionName, UUID id, ObjectNode data, User user); void delete(String collectionName, UUID id, User user); void addTypeToEntity(UUID id, String typeToAdd); void moveEdges(int fromVertex, int toVertex); }
JsonCrudService { public void replace(String collectionName, UUID id, ObjectNode data, User user) throws InvalidCollectionException, IOException, NotFoundException, AlreadyUpdatedException, PermissionFetchingException { final Collection collection = mappings.getCollection(collectionName) .orElseThrow(() -> new InvalidCollectionException(collectionName)); if (collection.isRelationCollection()) { replaceRelation(collection, id, data, user); } else { replaceEntity(collection, id, data, user); } } JsonCrudService(Vres mappings, UserValidator userValidator, UrlGenerator relationUrlFor,
                         TimbuctooActions timDbAccess); UUID create(String collectionName, ObjectNode input, User user); JsonNode get(String collectionName, UUID id); JsonNode get(String collectionName, UUID id, Integer rev); List<ObjectNode> getCollection(String collectionName, int rows, int start, boolean withRelations); void replace(String collectionName, UUID id, ObjectNode data, User user); void delete(String collectionName, UUID id, User user); void addTypeToEntity(UUID id, String typeToAdd); void moveEdges(int fromVertex, int toVertex);  }