blob: 5d623457a2562a77b55a25439f06c04f74972848 [file] [log] [blame]
Jian Li93a13832016-02-09 11:21:47 -08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Jian Li93a13832016-02-09 11:21:47 -08003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.cpman;
17
Jian Li72b9b122016-02-11 15:58:51 -080018import org.onosproject.net.DeviceId;
19
Jian Li93a13832016-02-09 11:21:47 -080020/**
21 * Abstraction of control message.
22 */
23public interface ControlMessage {
24
25 enum Type {
Jian Li01a61672016-02-11 14:59:43 -080026 INBOUND_PACKET, OUTBOUND_PACKET, FLOW_MOD_PACKET,
Jian Li93a13832016-02-09 11:21:47 -080027 FLOW_REMOVED_PACKET, REQUEST_PACKET, REPLY_PACKET
28 }
29
30 /**
31 * Returns the control message type.
32 *
33 * @return control message type
34 */
35 Type type();
36
37 /**
Jian Li72b9b122016-02-11 15:58:51 -080038 * Returns the device identification.
39 *
40 * @return device identification
41 */
42 DeviceId deviceId();
43
44 /**
Jian Li93a13832016-02-09 11:21:47 -080045 * Returns the latest control message load.
46 *
47 * @return control message load
48 */
49 long load();
50
51 /**
52 * Returns the latest control message rate.
53 *
54 * @return control message rate
55 */
56 long rate();
57
58 /**
59 * Returns the latest control message packet count.
60 *
61 * @return packet count
62 */
63 long count();
64
65 /**
66 * Returns the time that this control message stats collected.
67 *
Jian Li72b9b122016-02-11 15:58:51 -080068 * @return time stamp.
Jian Li93a13832016-02-09 11:21:47 -080069 */
Jian Li72b9b122016-02-11 15:58:51 -080070 long timestamp();
Jian Li93a13832016-02-09 11:21:47 -080071}