From: David ‘Bombe’ Roden Date: Wed, 16 Oct 2013 05:30:09 +0000 (+0200) Subject: Remove ImageBuilderFactory, move ImageStore and ImageProvider into ImageDatabase. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=1cea3bcf46c0297ea5a4adbdc42ed8259ceb00cb;p=Sone.git Remove ImageBuilderFactory, move ImageStore and ImageProvider into ImageDatabase. --- diff --git a/src/main/java/net/pterodactylus/sone/database/ImageBuilderFactory.java b/src/main/java/net/pterodactylus/sone/database/ImageBuilderFactory.java deleted file mode 100644 index 29b605b..0000000 --- a/src/main/java/net/pterodactylus/sone/database/ImageBuilderFactory.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Sone - ImageBuilderFactory.java - Copyright © 2013 David Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.database; - -/** - * Factory for {@link ImageBuilder}s. - * - * @author David Roden - */ -public interface ImageBuilderFactory { - - ImageBuilder newImageBuilder(); - -} diff --git a/src/main/java/net/pterodactylus/sone/database/ImageDatabase.java b/src/main/java/net/pterodactylus/sone/database/ImageDatabase.java index ad1518b..e5142ba 100644 --- a/src/main/java/net/pterodactylus/sone/database/ImageDatabase.java +++ b/src/main/java/net/pterodactylus/sone/database/ImageDatabase.java @@ -17,17 +17,26 @@ package net.pterodactylus.sone.database; +import java.util.List; + +import net.pterodactylus.sone.data.Album; import net.pterodactylus.sone.data.Image; +import com.google.common.base.Optional; + /** - * Combines an {@link ImageProvider}, an {@link ImageBuilderFactory}, and an - * {@link ImageStore} into an image database. + * Database for handling {@link Image}s. * * @author David ‘Bombe’ Roden */ -public interface ImageDatabase extends ImageProvider, ImageStore { +public interface ImageDatabase { + + Optional getImage(String imageId); + List getImages(Album parent); void moveUp(Image image); void moveDown(Image image); + void storeImage(Image image); + void removeImage(Image image); } diff --git a/src/main/java/net/pterodactylus/sone/database/ImageProvider.java b/src/main/java/net/pterodactylus/sone/database/ImageProvider.java deleted file mode 100644 index dcfdc92..0000000 --- a/src/main/java/net/pterodactylus/sone/database/ImageProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Sone - ImageProvider.java - Copyright © 2013 David Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.database; - -import java.util.List; - -import net.pterodactylus.sone.data.Album; -import net.pterodactylus.sone.data.Image; - -import com.google.common.base.Optional; - -/** - * Provides {@link Image}. - * - * @author David Roden - */ -public interface ImageProvider { - - Optional getImage(String imageId); - - List getImages(Album parent); - -} diff --git a/src/main/java/net/pterodactylus/sone/database/ImageStore.java b/src/main/java/net/pterodactylus/sone/database/ImageStore.java deleted file mode 100644 index f09eff0..0000000 --- a/src/main/java/net/pterodactylus/sone/database/ImageStore.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Sone - ImageStore.java - Copyright © 2013 David Roden - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package net.pterodactylus.sone.database; - -import net.pterodactylus.sone.data.Image; - -/** - * Manages {@link Image} storage. - * - * @author David Roden - */ -public interface ImageStore { - - void storeImage(Image image); - - void removeImage(Image image); - -}