Return local Sones from core and web interface.
[Sone.git] / src / main / java / net / pterodactylus / sone / database / SoneProvider.java
index 993804f..fd35d7b 100644 (file)
@@ -19,17 +19,24 @@ package net.pterodactylus.sone.database;
 
 import java.util.Collection;
 
+import net.pterodactylus.sone.core.Core;
+import net.pterodactylus.sone.data.LocalSone;
 import net.pterodactylus.sone.data.Sone;
 
+import com.google.common.base.Function;
 import com.google.common.base.Optional;
+import com.google.inject.ImplementedBy;
 
 /**
  * Interface for objects that can provide {@link Sone}s by their ID.
  *
  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
  */
+@ImplementedBy(Core.class)
 public interface SoneProvider {
 
+       Function<String, Optional<Sone>> soneLoader();
+
        /**
         * Returns the Sone with the given ID, or {@link Optional#absent()} if it
         * does not exist.
@@ -52,7 +59,7 @@ public interface SoneProvider {
         *
         * @return All local Sones
         */
-       public Collection<Sone> getLocalSones();
+       public Collection<LocalSone> getLocalSones();
 
        /**
         * Returns all remote Sones.