Add method to delete a Sone.
[Sone.git] / src / main / java / net / pterodactylus / sone / core / Core.java
index 6dc5040..7498356 100644 (file)
@@ -144,6 +144,7 @@ public class Core extends AbstractService {
                }
                Sone sone;
                try {
+                       logger.log(Level.FINEST, "Creating new Sone ā€œ%sā€ at %s (%s)ā€¦", new Object[] { name, requestUri, insertUri });
                        sone = new Sone(UUID.randomUUID(), name, new FreenetURI(requestUri), new FreenetURI(insertUri));
                } catch (MalformedURLException mue1) {
                        throw new SoneException(Type.INVALID_URI);
@@ -152,6 +153,16 @@ public class Core extends AbstractService {
                return sone;
        }
 
+       /**
+        * Deletes the given Sone from this plugin instance.
+        *
+        * @param sone
+        *            The sone to delete
+        */
+       public void deleteSone(Sone sone) {
+               localSones.remove(sone);
+       }
+
        //
        // SERVICE METHODS
        //