@Test public void testRemoveTilesWithZ() throws Exception { final TileSpec tileSpec = new TileSpec(); tileSpec.setTileId("testTileId"); tileSpec.setZ(999.0); dao.saveTileSpec(stackId, tileSpec); final List<Double> zValuesBeforeRemove = dao.getZValues(stackId); Assert.assertNotNull("zValues null for " + stackId + " before removal", zValuesBeforeRemove); Assert.assertEquals("incorrect number of zValues for " + stackId + " before removal", 3, zValuesBeforeRemove.size()); dao.removeTilesWithZ(stackId, tileSpec.getZ()); final List<Double> zValuesAfterRemove = dao.getZValues(stackId); Assert.assertNotNull("zValues null for " + stackId + " after removal", zValuesAfterRemove); Assert.assertEquals("zValues exist for " + stackId + " after removal", 2, zValuesAfterRemove.size()); }
public void removeTilesWithZ(final StackId stackId, final Double z) throws IllegalArgumentException { MongoUtil.validateRequiredParameter("stackId", stackId); MongoUtil.validateRequiredParameter("z", z); final MongoCollection<Document> tileCollection = getTileCollection(stackId); final Document tileQuery = new Document("z", z); final DeleteResult removeResult = tileCollection.deleteMany(tileQuery); LOG.debug("removeTilesWithZ: {}.remove({}) deleted {} document(s)", MongoUtil.fullName(tileCollection), tileQuery.toJson(), removeResult.getDeletedCount()); }
RenderDao { public void removeTilesWithZ(final StackId stackId, final Double z) throws IllegalArgumentException { MongoUtil.validateRequiredParameter("stackId", stackId); MongoUtil.validateRequiredParameter("z", z); final MongoCollection<Document> tileCollection = getTileCollection(stackId); final Document tileQuery = new Document("z", z); final DeleteResult removeResult = tileCollection.deleteMany(tileQuery); LOG.debug("removeTilesWithZ: {}.remove({}) deleted {} document(s)", MongoUtil.fullName(tileCollection), tileQuery.toJson(), removeResult.getDeletedCount()); } }
RenderDao { public void removeTilesWithZ(final StackId stackId, final Double z) throws IllegalArgumentException { MongoUtil.validateRequiredParameter("stackId", stackId); MongoUtil.validateRequiredParameter("z", z); final MongoCollection<Document> tileCollection = getTileCollection(stackId); final Document tileQuery = new Document("z", z); final DeleteResult removeResult = tileCollection.deleteMany(tileQuery); LOG.debug("removeTilesWithZ: {}.remove({}) deleted {} document(s)", MongoUtil.fullName(tileCollection), tileQuery.toJson(), removeResult.getDeletedCount()); } RenderDao(final MongoClient client); }
RenderDao { public void removeTilesWithZ(final StackId stackId, final Double z) throws IllegalArgumentException { MongoUtil.validateRequiredParameter("stackId", stackId); MongoUtil.validateRequiredParameter("z", z); final MongoCollection<Document> tileCollection = getTileCollection(stackId); final Document tileQuery = new Document("z", z); final DeleteResult removeResult = tileCollection.deleteMany(tileQuery); LOG.debug("removeTilesWithZ: {}.remove({}) deleted {} document(s)", MongoUtil.fullName(tileCollection), tileQuery.toJson(), removeResult.getDeletedCount()); } RenderDao(final MongoClient client); static RenderDao build(); RenderParameters getParameters(final StackId stackId,
                                          final String groupId,
                                          final Double x,
                                          final Double y,
                                          final Double z,
                                          final Integer width,
                                          final Integer height,
                                          final Double scale); RenderParameters getParameters(final StackId stackId,
                                          final Double z,
                                          final Double scale); long getTileCount(final StackId stackId,
                             final Double x,
                             final Double y,
                             final Double z,
                             final Integer width,
                             final Integer height); TileSpec getTileSpec(final StackId stackId,
                                final String tileId,
                                final boolean resolveTransformReferences); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final Double x,
                                       final Double y,
                                       final Double z); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final List<String> tileIds); void writeCoordinatesWithTileIds(final StackId stackId,
                                            final Double z,
                                            final List<TileCoordinates> worldCoordinatesList,
                                            final OutputStream outputStream); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final Double z); ResolvedTileSpecCollection getResolvedTiles(final StackId stackId,
                                                       final Double z); ResolvedTileSpecCollection getResolvedTiles(final StackId stackId,
                                                       final Double minZ,
                                                       final Double maxZ,
                                                       final String groupId,
                                                       final Double minX,
                                                       final Double maxX,
                                                       final Double minY,
                                                       final Double maxY); void saveResolvedTiles(final StackId stackId,
                                  final ResolvedTileSpecCollection resolvedTileSpecs); TransformSpec getTransformSpec(final StackId stackId,
                                          final String transformId); List<Double> getZValues(final StackId stackId); List<Double> getZValues(final StackId stackId,
                                   final Double minZ,
                                   final Double maxZ); Double getZForSection(final StackId stackId,
                                 final String sectionId); void updateZForSection(final StackId stackId,
                                  final String sectionId,
                                  final Double z); void updateZForTiles(final StackId stackId,
                                final Double z,
                                final List<String> tileIds); List<SectionData> getSectionData(final StackId stackId,
                                            final Double minZ,
                                            final Double maxZ); List<String> getOwners(); List<String> getProjects(final String owner); List<StackMetaData> getStackMetaDataList(final String owner,
                                                    final String project); StackMetaData getStackMetaData(final StackId stackId); void saveStackMetaData(final StackMetaData stackMetaData); StackMetaData ensureIndexesAndDeriveStats(final StackMetaData stackMetaData); void removeStack(final StackId stackId,
                            final boolean includeMetaData); void removeTilesWithSectionId(final StackId stackId,
                                         final String sectionId); void removeTilesWithZ(final StackId stackId,
                                 final Double z); void removeTile(final StackId stackId,
                           final String tileId); Bounds getLayerBounds(final StackId stackId,
                                 final Double z); List<SectionData> getSectionDataForZ(final StackId stackId,
                                                final Double z); List<TileBounds> getTileBoundsForZ(final StackId stackId,
                                              final Double z); List<TileBounds> getTileBoundsForSection(final StackId stackId,
                                                    final String sectionId); void cloneStack(final StackId fromStackId,
                           final StackId toStackId,
                           final List<Double> zValues,
                           final Boolean skipTransforms); void renameStack(final StackId fromStackId,
                            final StackId toStackId); void writeLayoutFileData(final StackMetaData stackMetaData,
                                    final String stackRequestUri,
                                    final Double minZ,
                                    final Double maxZ,
                                    TileSpecLayout.Format format,
                                    final OutputStream outputStream); void writeTileIds(final StackId stackId,
                             final OutputStream outputStream); }
RenderDao { public void removeTilesWithZ(final StackId stackId, final Double z) throws IllegalArgumentException { MongoUtil.validateRequiredParameter("stackId", stackId); MongoUtil.validateRequiredParameter("z", z); final MongoCollection<Document> tileCollection = getTileCollection(stackId); final Document tileQuery = new Document("z", z); final DeleteResult removeResult = tileCollection.deleteMany(tileQuery); LOG.debug("removeTilesWithZ: {}.remove({}) deleted {} document(s)", MongoUtil.fullName(tileCollection), tileQuery.toJson(), removeResult.getDeletedCount()); } RenderDao(final MongoClient client); static RenderDao build(); RenderParameters getParameters(final StackId stackId,
                                          final String groupId,
                                          final Double x,
                                          final Double y,
                                          final Double z,
                                          final Integer width,
                                          final Integer height,
                                          final Double scale); RenderParameters getParameters(final StackId stackId,
                                          final Double z,
                                          final Double scale); long getTileCount(final StackId stackId,
                             final Double x,
                             final Double y,
                             final Double z,
                             final Integer width,
                             final Integer height); TileSpec getTileSpec(final StackId stackId,
                                final String tileId,
                                final boolean resolveTransformReferences); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final Double x,
                                       final Double y,
                                       final Double z); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final List<String> tileIds); void writeCoordinatesWithTileIds(final StackId stackId,
                                            final Double z,
                                            final List<TileCoordinates> worldCoordinatesList,
                                            final OutputStream outputStream); List<TileSpec> getTileSpecs(final StackId stackId,
                                       final Double z); ResolvedTileSpecCollection getResolvedTiles(final StackId stackId,
                                                       final Double z); ResolvedTileSpecCollection getResolvedTiles(final StackId stackId,
                                                       final Double minZ,
                                                       final Double maxZ,
                                                       final String groupId,
                                                       final Double minX,
                                                       final Double maxX,
                                                       final Double minY,
                                                       final Double maxY); void saveResolvedTiles(final StackId stackId,
                                  final ResolvedTileSpecCollection resolvedTileSpecs); TransformSpec getTransformSpec(final StackId stackId,
                                          final String transformId); List<Double> getZValues(final StackId stackId); List<Double> getZValues(final StackId stackId,
                                   final Double minZ,
                                   final Double maxZ); Double getZForSection(final StackId stackId,
                                 final String sectionId); void updateZForSection(final StackId stackId,
                                  final String sectionId,
                                  final Double z); void updateZForTiles(final StackId stackId,
                                final Double z,
                                final List<String> tileIds); List<SectionData> getSectionData(final StackId stackId,
                                            final Double minZ,
                                            final Double maxZ); List<String> getOwners(); List<String> getProjects(final String owner); List<StackMetaData> getStackMetaDataList(final String owner,
                                                    final String project); StackMetaData getStackMetaData(final StackId stackId); void saveStackMetaData(final StackMetaData stackMetaData); StackMetaData ensureIndexesAndDeriveStats(final StackMetaData stackMetaData); void removeStack(final StackId stackId,
                            final boolean includeMetaData); void removeTilesWithSectionId(final StackId stackId,
                                         final String sectionId); void removeTilesWithZ(final StackId stackId,
                                 final Double z); void removeTile(final StackId stackId,
                           final String tileId); Bounds getLayerBounds(final StackId stackId,
                                 final Double z); List<SectionData> getSectionDataForZ(final StackId stackId,
                                                final Double z); List<TileBounds> getTileBoundsForZ(final StackId stackId,
                                              final Double z); List<TileBounds> getTileBoundsForSection(final StackId stackId,
                                                    final String sectionId); void cloneStack(final StackId fromStackId,
                           final StackId toStackId,
                           final List<Double> zValues,
                           final Boolean skipTransforms); void renameStack(final StackId fromStackId,
                            final StackId toStackId); void writeLayoutFileData(final StackMetaData stackMetaData,
                                    final String stackRequestUri,
                                    final Double minZ,
                                    final Double maxZ,
                                    TileSpecLayout.Format format,
                                    final OutputStream outputStream); void writeTileIds(final StackId stackId,
                             final OutputStream outputStream); static final String RENDER_DB_NAME; static final String STACK_META_DATA_COLLECTION_NAME; }