blob: a8d20cefaaa1f443370c9daf0d2833d2d9eece55 [file] [log] [blame]
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -03001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
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 */
16
17package org.opencord.dhcpl2relay.impl;
18
Jonathan Hart77ca3152020-02-21 14:31:21 -080019import org.onosproject.store.Store;
20import org.opencord.dhcpl2relay.DhcpL2RelayEvent;
21import org.opencord.dhcpl2relay.DhcpL2RelayStoreDelegate;
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030022
23/**
24 * Represents a stored DHCP Relay Counters. A counter entry is defined by the pair <counterClass, counterType>,
25 * where counterClass can be maybe global or subscriber ID and counterType is the DHCP message type.
26 */
Jonathan Hart77ca3152020-02-21 14:31:21 -080027public interface DhcpL2RelayCountersStore extends Store<DhcpL2RelayEvent, DhcpL2RelayStoreDelegate> {
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030028
29 String NAME = "DHCP_L2_Relay_stats";
30
31 /**
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030032 * Creates or updates DHCP L2 Relay counter.
33 *
34 * @param counterClass class of counters (global, per subscriber).
35 * @param counterType name of counter
36 */
Jonathan Hart77ca3152020-02-21 14:31:21 -080037 void incrementCounter(String counterClass, DhcpL2RelayCounterNames counterType);
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030038
39 /**
40 * Sets the value of a DHCP L2 Relay counter.
41 *
42 * @param counterClass class of counters (global, per subscriber).
43 * @param counterType name of counter
44 * @param value The value of the counter
45 */
Jonathan Hart77ca3152020-02-21 14:31:21 -080046 void setCounter(String counterClass, DhcpL2RelayCounterNames counterType, Long value);
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030047
48 /**
Jonathan Hart77ca3152020-02-21 14:31:21 -080049 * Gets the current DHCP L2 relay counter values.
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030050 *
Jonathan Hart77ca3152020-02-21 14:31:21 -080051 * @return DHCP L2 relay counter values
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030052 */
Jonathan Hart77ca3152020-02-21 14:31:21 -080053 DhcpL2RelayStatistics getCounters();
Marcos Aurelio Carreroeaf02b82019-11-25 13:34:25 -030054
55 /**
56 * Resets counter values for a given counter class.
57 *
58 * @param counterClass class of counters (global, per subscriber).
59 */
60 void resetCounters(String counterClass);
61}