Daniele Moro | 94660a0 | 2019-12-02 12:02:07 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2019-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.bng; |
| 18 | |
| 19 | import org.onosproject.event.ListenerService; |
| 20 | import org.onosproject.net.behaviour.BngProgrammable; |
| 21 | import org.onosproject.net.pi.runtime.PiCounterCellData; |
| 22 | |
| 23 | import java.util.Map; |
| 24 | |
| 25 | /** |
| 26 | * Service to retrieve attachment statistics. |
| 27 | */ |
| 28 | public interface BngStatsService |
| 29 | extends ListenerService<BngStatsEvent, BngStatsEventListener> { |
| 30 | |
| 31 | /** |
| 32 | * Returns the statistics given an attachment Key. If the attachment is not |
| 33 | * programmed in the ASG, it returns an empty map. If one of the counter |
| 34 | * type is not supported by the ASG device, that specific counter will not |
| 35 | * be found in the map. |
| 36 | * |
| 37 | * @param bngAttachmentKey The attachment Key |
| 38 | * @return A map with the type of the counter and the associated statistics |
| 39 | * coming from the ASG device. Empty map if no BNG programmable is |
| 40 | * available. |
| 41 | */ |
| 42 | Map<BngProgrammable.BngCounterType, PiCounterCellData> getStats(String bngAttachmentKey); |
| 43 | |
| 44 | /** |
| 45 | * Returns the aggregate statistics related to attachments that are not |
| 46 | * known by this app, e.g., packets that are sent from an attachment while |
| 47 | * the attachment is negotiating the session. |
| 48 | * |
| 49 | * @return The statistics of not registered attachment. null if no BNG |
| 50 | * programmable device is available. |
| 51 | */ |
| 52 | PiCounterCellData getControlStats(); |
| 53 | |
| 54 | } |