diff --git a/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryDeleteResource.java b/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryDeleteResource.java deleted file mode 100644 index d64b97103c24fdcfa385adf0f52195426a3632db..0000000000000000000000000000000000000000 --- a/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryDeleteResource.java +++ /dev/null @@ -1,66 +0,0 @@ -/** -* Copyright 2011, Big Switch Networks, Inc. -* Originally created by David Erickson, Stanford University -* -* Licensed under the Apache License, Version 2.0 (the "License"); you may -* not use this file except in compliance with the License. You may obtain -* a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -* License for the specific language governing permissions and limitations -* under the License. -**/ - -package net.floodlightcontroller.staticflowentry.web; - -import java.io.IOException; - -import org.restlet.resource.Post; -import org.restlet.resource.ServerResource; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import net.floodlightcontroller.staticflowentry.StaticFlowEntries; -import net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher; -import net.floodlightcontroller.storage.IStorageSourceService; - -/** - * Deletes a static flow entry to the storage source - * @author alexreimers - * - * @author Henrique Rodrigues <hsr@cs.ucsd.edu> - * Contributed with splitting StaticFlowEntryPusherResource into - * two, to make Floodlight's StaticFlowEntryPusher restlet resource - * REST compliant. - * - */ -public class StaticFlowEntryDeleteResource extends ServerResource { - protected static Logger log = LoggerFactory.getLogger(StaticFlowEntryDeleteResource.class); - - @Post - public String del(String fmJson) { - IStorageSourceService storageSource = - (IStorageSourceService)getContext().getAttributes(). - get(IStorageSourceService.class.getCanonicalName()); - String fmName = null; - if (fmJson == null) { - return "{\"status\" : \"Error! No data posted.\"}"; - } - try { - fmName = StaticFlowEntries.getEntryNameFromJson(fmJson); - if (fmName == null) { - return "{\"status\" : \"Error deleting entry, no name provided\"}"; - } - } catch (IOException e) { - log.error("Error deleting flow mod request: " + fmJson, e); - return "{\"status\" : \"Error deleting entry, see log for details\"}"; - } - - storageSource.deleteRowAsync(StaticFlowEntryPusher.TABLE_NAME, fmName); - return "{\"status\" : \"Entry " + fmName + " deleted\"}"; - } -} diff --git a/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryWebRoutable.java b/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryWebRoutable.java index 9bc1497cedcece542f30bb762a1ed8b51879ae81..0951c703dbbcc5f5d7df701827015d7ea606d135 100644 --- a/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryWebRoutable.java +++ b/src/main/java/net/floodlightcontroller/staticflowentry/web/StaticFlowEntryWebRoutable.java @@ -30,8 +30,6 @@ public class StaticFlowEntryWebRoutable implements RestletRoutable { public Restlet getRestlet(Context context) { Router router = new Router(context); router.attach("/json", StaticFlowEntryPusherResource.class); - router.attach("/json/store", StaticFlowEntryPusherResource.class); - router.attach("/json/delete", StaticFlowEntryDeleteResource.class); router.attach("/clear/{switch}/json", ClearStaticFlowEntriesResource.class); router.attach("/list/{switch}/json", ListStaticFlowEntriesResource.class); return router;