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 | |
| 19 | import java.util.Map; |
| 20 | import java.util.concurrent.atomic.AtomicLong; |
| 21 | |
| 22 | /** |
| 23 | * Represents a stored DHCP Relay Counters. A counter entry is defined by the pair <counterClass, counterType>, |
| 24 | * where counterClass can be maybe global or subscriber ID and counterType is the DHCP message type. |
| 25 | */ |
| 26 | public interface DhcpL2RelayCountersStore { |
| 27 | |
| 28 | String NAME = "DHCP_L2_Relay_stats"; |
| 29 | |
| 30 | /** |
| 31 | * Init counter values for a given counter class. |
| 32 | * |
| 33 | * @param counterClass class of counters (global, per subscriber). |
| 34 | */ |
| 35 | void initCounters(String counterClass); |
| 36 | |
| 37 | /** |
| 38 | * Creates or updates DHCP L2 Relay counter. |
| 39 | * |
| 40 | * @param counterClass class of counters (global, per subscriber). |
| 41 | * @param counterType name of counter |
| 42 | */ |
| 43 | void incrementCounter(String counterClass, DhcpL2RelayCounters counterType); |
| 44 | |
| 45 | /** |
| 46 | * Sets the value of a DHCP L2 Relay counter. |
| 47 | * |
| 48 | * @param counterClass class of counters (global, per subscriber). |
| 49 | * @param counterType name of counter |
| 50 | * @param value The value of the counter |
| 51 | */ |
| 52 | void setCounter(String counterClass, DhcpL2RelayCounters counterType, Long value); |
| 53 | |
| 54 | /** |
| 55 | * Gets the DHCP L2 Relay counters map. |
| 56 | * |
| 57 | * @return the DHCP counter map |
| 58 | */ |
| 59 | public Map<DhcpL2RelayCountersIdentifier, AtomicLong> getCountersMap(); |
| 60 | |
| 61 | /** |
| 62 | * Resets counter values for a given counter class. |
| 63 | * |
| 64 | * @param counterClass class of counters (global, per subscriber). |
| 65 | */ |
| 66 | void resetCounters(String counterClass); |
| 67 | } |