Skip to content
Snippets Groups Projects
Commit d5d30efd authored by Ryan Izard's avatar Ryan Izard
Browse files

Remove stale SFP code

parent dd2a33be
No related branches found
No related tags found
No related merge requests found
/**
* 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\"}";
}
}
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment