Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package org.opencord.dhcpl2relay.impl; |
| 18 | |
Jonathan Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 19 | import org.onosproject.store.Store; |
| 20 | import org.opencord.dhcpl2relay.DhcpL2RelayEvent; |
| 21 | import org.opencord.dhcpl2relay.DhcpL2RelayStoreDelegate; |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 22 | |
| 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 Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 27 | public interface DhcpL2RelayCountersStore extends Store<DhcpL2RelayEvent, DhcpL2RelayStoreDelegate> { |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 28 | |
| 29 | String NAME = "DHCP_L2_Relay_stats"; |
| 30 | |
| 31 | /** |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 32 | * 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 Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 37 | void incrementCounter(String counterClass, DhcpL2RelayCounterNames counterType); |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 38 | |
| 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 Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 46 | void setCounter(String counterClass, DhcpL2RelayCounterNames counterType, Long value); |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 47 | |
| 48 | /** |
Jonathan Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 49 | * Gets the current DHCP L2 relay counter values. |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 50 | * |
Jonathan Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 51 | * @return DHCP L2 relay counter values |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 52 | */ |
Jonathan Hart | 77ca315 | 2020-02-21 14:31:21 -0800 | [diff] [blame^] | 53 | DhcpL2RelayStatistics getCounters(); |
Marcos Aurelio Carrero | eaf02b8 | 2019-11-25 13:34:25 -0300 | [diff] [blame] | 54 | |
| 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 | } |