Fixed (de)serialization issue
[openflowplugin.git] / openflowplugin-api / src / main / java / org / opendaylight / openflowplugin / api / statistics / MessageSpy.java
1 /**
2  * Copyright (c) 2013 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.statistics;
10
11
12 /**
13  * ticket spy - aimed on collecting intel about tickets 
14  * @param <M> type of watched message
15  */
16 public interface MessageSpy<M> extends Runnable {
17
18     /**
19      * @param message content of ticket
20      */
21     void spyIn(M message);
22
23     /**
24      * @param message content of ticket
25      */
26     void spyOut(M message);
27     
28     
29     // TODO: temporary solution, should be refactored and moved to managed bean
30     
31     /**
32      * statistic groups overall in OFPlugin
33      */
34     enum STATISTIC_GROUP {
35         /** message from switch, enqueued for processing */
36         FROM_SWITCH_ENQUEUED,
37         /** message from switch translated successfully - source */
38         FROM_SWITCH_TRANSLATE_IN_SUCCESS,
39         /** message from switch translated successfully - target */
40         FROM_SWITCH_TRANSLATE_OUT_SUCCESS,
41         /** message from switch where translation failed - source */
42         FROM_SWITCH_TRANSLATE_SRC_FAILURE,
43         /** message from switch finally published into MD-SAL */
44         FROM_SWITCH_PUBLISHED_SUCCESS,
45         /** message from switch - publishing into MD-SAL failed */
46         FROM_SWITCH_PUBLISHED_FAILURE,
47         
48         /** message from MD-SAL to switch via RPC enqueued */
49         TO_SWITCH_ENQUEUED_SUCCESS,
50         /** message from MD-SAL to switch via RPC NOT enqueued */
51         TO_SWITCH_ENQUEUED_FAILED,
52         /** message from MD-SAL to switch - sent to OFJava successfully */
53         TO_SWITCH_SUBMITTED_SUCCESS,
54         /** message from MD-SAL to switch - sent to OFJava but failed*/
55         TO_SWITCH_SUBMITTED_FAILURE
56     }
57     
58     /**
59      * @param message from switch or to switch - depends on statGroup
60      * @param statGroup 
61      */
62     void spyMessage(M message, STATISTIC_GROUP statGroup);
63     }