blob: c89eee003ba9e014ac030296eb5c15efcc6d97f9 [file] [log] [blame]
Umesh Krishnaswamy345ee992012-12-13 20:29:48 -08001package net.floodlightcontroller.counter;
2
3import java.util.List;
4import java.util.Map;
5
6import org.openflow.protocol.OFMessage;
7
8import net.floodlightcontroller.core.IOFSwitch;
9import net.floodlightcontroller.core.module.IFloodlightService;
10import net.floodlightcontroller.counter.CounterStore.NetworkLayer;
11import net.floodlightcontroller.packet.Ethernet;
12
13public interface ICounterStoreService extends IFloodlightService {
14
15 public final static String CONTROLLER_NAME = "controller";
16 public final static String TitleDelimitor = "__";
17
18 /** Broadcast and multicast */
19 public final static String BROADCAST = "broadcast";
20 public final static String MULTICAST = "multicast";
21 public final static String UNICAST = "unicast";
22
23 /** L2 EtherType subCategories */
24 public final static String L3ET_IPV4 = "L3_IPv4";
25
26 /**
27 * Update packetIn counters
28 *
29 * @param sw
30 * @param m
31 * @param eth
32 */
33 public void updatePacketInCounters(IOFSwitch sw, OFMessage m, Ethernet eth);
34
35 /**
36 * This method can only be used to update packetOut and flowmod counters
37 *
38 * @param sw
39 * @param ofMsg
40 */
41 public void updatePktOutFMCounterStore(IOFSwitch sw, OFMessage ofMsg);
42
43 /**
44 * Retrieve a list of subCategories by counterName.
45 * null if nothing.
46 */
47 public List<String> getAllCategories(String counterName,
48 NetworkLayer layer);
49
50 /**
51 * Create a new ICounter and set the title. Note that the title must be
52 * unique, otherwise this will throw an IllegalArgumentException.
53 *
54 * @param key
55 * @param type
56 * @return
57 */
58 public ICounter createCounter(String key, CounterValue.CounterType type);
59
60 /**
61 * Retrieves a counter with the given title, or null if none can be found.
62 */
63 public ICounter getCounter(String key);
64
65 /**
66 * Returns an immutable map of title:counter with all of the counters in the store.
67 *
68 * (Note - this method may be slow - primarily for debugging/UI)
69 */
70 public Map<String, ICounter> getAll();
71}