Add delete rest operation for intents

Change-Id: I0197169c018318a2661e3fb418863df563a25f0a
diff --git a/src/main/java/net/onrc/onos/datagrid/web/IntentResource.java b/src/main/java/net/onrc/onos/datagrid/web/IntentResource.java
index 48e5e15..c625f3f 100755
--- a/src/main/java/net/onrc/onos/datagrid/web/IntentResource.java
+++ b/src/main/java/net/onrc/onos/datagrid/web/IntentResource.java
@@ -27,6 +27,7 @@
 import java.util.Map;
 import org.codehaus.jackson.node.ArrayNode;
 import org.codehaus.jackson.node.ObjectNode;
+import org.restlet.resource.Delete;
 import org.restlet.resource.Get;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -70,12 +71,6 @@
     
     @Post("json")
     public String store(String jsonIntent) throws IOException {
-	IDatagridService datagridService = (IDatagridService) getContext()
-		.getAttributes().get(IDatagridService.class.getCanonicalName());
-	if (datagridService == null) {
-	    log.debug("FlowIntentResource ONOS Datagrid Service not found");
-	    return "";
-	}
         IPathCalcRuntimeService pathRuntime = (IPathCalcRuntimeService)getContext()
                 .getAttributes().get(IPathCalcRuntimeService.class.getCanonicalName());
         if (pathRuntime == null) {
@@ -100,6 +95,16 @@
 	}
         return reply;
     }
+    
+    @Delete("json")
+    public String store() {
+        IPathCalcRuntimeService pathRuntime = (IPathCalcRuntimeService)getContext().
+                getAttributes().get(IPathCalcRuntimeService.class.getCanonicalName());
+        pathRuntime.purgeIntents();
+        // TODO no reply yet from the purge intents call
+        return "";
+        
+    }
 
     @Get("json")
     public String retrieve() throws IOException {