Skip to content
Snippets Groups Projects
Commit 12f3b160 authored by Kanzhe Jiang's avatar Kanzhe Jiang
Browse files

fix counterStore API as a service

parent 23d72fbc
No related branches found
No related tags found
No related merge requests found
......@@ -55,15 +55,9 @@ import net.floodlightcontroller.core.IOFSwitchListener;
import net.floodlightcontroller.core.internal.OFChannelState.HandshakeState;
import net.floodlightcontroller.core.util.ListenerDispatcher;
import net.floodlightcontroller.core.web.CoreWebRoutable;
import net.floodlightcontroller.core.web.JacksonCustomConverter;
import net.floodlightcontroller.core.web.RestletRoutable;
import net.floodlightcontroller.counter.CounterStore;
import net.floodlightcontroller.devicemanager.IDeviceManagerAware;
import net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl;
import net.floodlightcontroller.forwarding.Forwarding;
import net.floodlightcontroller.counter.ICounterStoreService;
import net.floodlightcontroller.jython.Server;
import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.packet.IPv4;
import net.floodlightcontroller.perfmon.IPktInProcessingTimeService;
import net.floodlightcontroller.restserver.IRestApiService;
import net.floodlightcontroller.storage.IResultSet;
......
......@@ -47,7 +47,7 @@ public class SwitchCounterResource extends CounterResourceBase {
Long[] switchDpids;
if (switchID.equalsIgnoreCase("all")) {
switchDpids = floodlightProvider.getSwitches().keySet().toArray(new Long[0]);
getOneSwitchCounterJson(model, CounterStore.CONTROLLER_NAME, counterName);
getOneSwitchCounterJson(model, ICounterStoreService.CONTROLLER_NAME, counterName);
for (Long dpid : switchDpids) {
switchID = HexString.toHexString(dpid);
......
......@@ -31,11 +31,9 @@ import java.util.concurrent.TimeUnit;
import javax.annotation.PostConstruct;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.internal.Controller;
import net.floodlightcontroller.counter.CounterValue.CounterType;
import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.packet.IPv4;
import net.floodlightcontroller.routing.ForwardingBase;
import org.openflow.protocol.OFMessage;
import org.openflow.protocol.OFPacketIn;
......@@ -48,13 +46,7 @@ import org.slf4j.LoggerFactory;
*
*/
public class CounterStore implements ICounterStoreService {
public static final String CONTROLLER_NAME = "controller";
protected static Logger log = LoggerFactory.getLogger(CounterStore.class);
public final static String TitleDelimitor = "__";
/** L2 EtherType subCategories */
public final static String L3ET_IPV4 = "L3_IPv4";
public enum NetworkLayer {
L3, L4
......
......@@ -3,15 +3,37 @@ package net.floodlightcontroller.counter;
import java.util.List;
import java.util.Map;
import org.openflow.protocol.OFMessage;
import net.floodlightcontroller.core.IOFSwitch;
import net.floodlightcontroller.core.module.IFloodlightService;
import net.floodlightcontroller.counter.CounterStore.NetworkLayer;
import net.floodlightcontroller.packet.Ethernet;
public interface ICounterStoreService extends IFloodlightService {
public final static String CONTROLLER_NAME = "controller";
public final static String TitleDelimitor = "__";
/** L2 EtherType subCategories */
public final static String L3ET_IPV4 = "L3_IPv4";
/**
* Update packetIn counters
*
* @param sw
* @param m
* @param eth
*/
public void updatePacketInCounters(IOFSwitch sw, OFMessage m, Ethernet eth);
/**
* This method can only be used to update packetOut and flowmod counters
*
* @param sw
* @param ofMsg
*/
public void updatePktOutFMCounterStore(IOFSwitch sw, OFMessage ofMsg);
/**
* Retrieve a list of subCategories by counterName.
* null if nothing.
......
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