2 * Copyright 2015 Open Networking Laboratory
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 package org.onosproject.pcep.controller.impl;
18 import org.onosproject.pcep.controller.PcepPacketStats;
21 * The implementation for PCEP packet statistics.
23 public class PcepPacketStatsImpl implements PcepPacketStats {
25 private int inPacketCount;
26 private int outPacketCount;
27 private int wrongPacketCount;
31 * Default constructor.
33 public PcepPacketStatsImpl() {
34 this.inPacketCount = 0;
35 this.outPacketCount = 0;
36 this.wrongPacketCount = 0;
41 public int outPacketCount() {
42 return outPacketCount;
46 public int inPacketCount() {
51 public int wrongPacketCount() {
52 return wrongPacketCount;
56 * Increments the received packet counter.
58 public void addInPacket() {
63 * Increments the sent packet counter.
65 public void addOutPacket() {
66 this.outPacketCount++;
70 * Increments the sent packet counter by specified value.
72 * @param value of no of packets sent
74 public void addOutPacket(int value) {
75 this.outPacketCount = this.outPacketCount + value;
79 * Increments the wrong packet counter.
81 public void addWrongPacket() {
82 this.wrongPacketCount++;
86 * Resets wrong packet count.
88 public void resetWrongPacket() {
89 this.wrongPacketCount = 0;
93 public long getTime() {
98 * Sets the time value.
100 * @param time long value of time
102 public void setTime(long time) {