2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.policy.pypdp.jmx;
23 import java.util.concurrent.atomic.AtomicLong;
25 public class PyPdpMonitor implements PyPdpMonitorMBean {
27 public static PyPdpMonitor singleton = new PyPdpMonitor();
29 private final AtomicLong configCounter;
30 private final AtomicLong eventCounter;
31 private final AtomicLong configPolicyNameCounter;
33 private PyPdpMonitor() {
34 this.configCounter = new AtomicLong();
35 this.eventCounter = new AtomicLong();
36 this.configPolicyNameCounter = new AtomicLong();
40 * @return the configCounter
42 public AtomicLong getAtomicConfigCounter() {
47 * @return the eventCounter
49 public AtomicLong getAtomicEventCounter() {
54 * @return the configPolicyNameCounter
56 public AtomicLong getAtomicConfigPolicyNameCounter() {
57 return configPolicyNameCounter;
60 * @return the configCounter
63 public long getConfigCounter() {
64 return configCounter.longValue();
68 * @return the eventCounter
71 public long getEventCounter() {
72 return eventCounter.longValue();
76 * @return the configPolicyNameCounter
79 public long getConfigPolicyNameCounter() {
80 return configPolicyNameCounter.longValue();
84 public synchronized void resetCounters() {
85 this.configCounter.set(0);
86 this.eventCounter.set(0);
87 this.configPolicyNameCounter.set(0);