Kalhee Kim | d94ceea | 2017-11-29 19:03:02 +0000 | [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.onosproject.dhcprelay.store; |
| 18 | |
| 19 | |
| 20 | import java.util.Optional; |
| 21 | import java.util.Map; |
| 22 | import java.util.Set; |
| 23 | |
| 24 | /** |
| 25 | * Stores DHCP Relay Counters records. |
| 26 | */ |
| 27 | public interface DhcpRelayCountersStore { |
| 28 | |
| 29 | /** |
| 30 | * Creates or updates DHCP record for specific host id (mac + vlan). |
| 31 | * |
| 32 | * @param counterClass class of counters (direct, indirect, global) |
| 33 | * @param counterName name of counter |
| 34 | */ |
| 35 | void incrementCounter(String counterClass, String counterName); |
| 36 | |
| 37 | /** |
| 38 | * Gets the DHCP counter record for a given counter class. |
| 39 | * |
| 40 | * @param counterClass the class of counters (direct, indirect, global) |
| 41 | * @return the DHCP counter record for a given counter class; empty if record not exists |
| 42 | */ |
| 43 | Optional<DhcpRelayCounters> getCounters(String counterClass); |
| 44 | |
| 45 | /** |
| 46 | * Gets all classes of DHCP counters record from store. |
| 47 | * |
| 48 | * @return all classes of DHCP counters records from store |
| 49 | */ |
| 50 | Set<Map.Entry<String, DhcpRelayCounters>> getAllCounters(); |
| 51 | |
| 52 | /** |
| 53 | * Resets counter value for a given counter class. |
| 54 | * |
| 55 | * @param counterClass the class of counters (direct, indirect, global) |
| 56 | */ |
| 57 | void resetCounters(String counterClass); |
| 58 | |
| 59 | /** |
| 60 | * Resets counter value for a all counter classes. |
| 61 | * |
| 62 | */ |
| 63 | void resetAllCounters(); |
| 64 | |
| 65 | } |