Bug 5692 - Statistics ON/OFF
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / openflow / statistics / ofpspecific / MessageSpy.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.openflowplugin.api.openflow.statistics.ofpspecific;
10
11 /**
12  * Created by Martin Bobak <mbobak@cisco.com> on 20.4.2015.
13  */
14 public interface MessageSpy extends Runnable {
15
16     /**
17      * statistic groups overall in OFPlugin
18      */
19     enum STATISTIC_GROUP {
20         /**
21          * message from switch
22          */
23         FROM_SWITCH,
24         /**
25          * message from switch translated successfully - source
26          */
27         FROM_SWITCH_TRANSLATE_IN_SUCCESS,
28         /**
29          * message from switch translated successfully - target
30          */
31         FROM_SWITCH_TRANSLATE_OUT_SUCCESS,
32         /**
33          * message from switch where translation failed - source
34          */
35         FROM_SWITCH_TRANSLATE_SRC_FAILURE,
36         /**
37          * packetIn from switch reached processing limit and got dropped
38          */
39         FROM_SWITCH_PACKET_IN_LIMIT_REACHED_AND_DROPPED,
40         /**
41          * message from switch to MD-SAL  - notification service rejected notfication
42          */
43         FROM_SWITCH_NOTIFICATION_REJECTED,
44         /**
45          * message from switch finally published into MD-SAL
46          */
47         FROM_SWITCH_PUBLISHED_SUCCESS,
48         /**
49          * message from switch - publishing into MD-SAL failed
50          */
51         FROM_SWITCH_PUBLISHED_FAILURE,
52
53         /**
54          * message from MD-SAL entered service - first point of encounter
55          */
56         TO_SWITCH_ENTERED,
57         /**
58          * message from MD-SAL was disregarded (e.g. outstanding requests limit reached).
59          */
60         TO_SWITCH_DISREGARDED,
61         /**
62          * message from MD-SAL to switch - asked for XID reservation in queue, but rejected
63          */
64         TO_SWITCH_RESERVATION_REJECTED,
65         /**
66          * message from MD-SAL to switch - ready to sent to OFJava (might be one-to-multiple ration between entered and sent)
67          */
68         TO_SWITCH_READY_FOR_SUBMIT,
69         /**
70          * message from MD-SAL to switch - sent to OFJava successfully
71          */
72         TO_SWITCH_SUBMIT_SUCCESS,
73         /**
74          * message from MD-SAL to switch - sent to OFJava successfully, no response expected
75          */
76         TO_SWITCH_SUBMIT_SUCCESS_NO_RESPONSE,
77         /**
78          * message from MD-SAL to switch - sent to OFJava but failed
79          */
80         TO_SWITCH_SUBMIT_FAILURE,
81         /**
82          * message from MD-SAL to switch - sent to OFJava but failed with exception
83          */
84         TO_SWITCH_SUBMIT_ERROR,
85         /**
86          * TEMPORARY STATISTIC VALUE
87          */
88         REQUEST_STACK_FREED,
89         /**
90          * stop receiving data from device - turned on
91          */
92         OFJ_BACKPRESSURE_ON,
93         /**
94          * stop receiving data from device - turned off
95          */
96         OFJ_BACKPRESSURE_OFF
97
98
99     }
100
101     /**
102      * @param message   from switch or to switch - depends on statGroup
103      * @param statGroup
104      */
105     void spyMessage(Class<?> message, STATISTIC_GROUP statGroup);
106
107 }