diff options
Diffstat (limited to 'controlloop/common/feature-controlloop-trans/src/main')
2 files changed, 10 insertions, 20 deletions
diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java index 64fe2467e..d0b79125b 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java @@ -32,6 +32,8 @@ import java.util.Map; import java.util.Objects; import java.util.UUID; import java.util.concurrent.TimeUnit; +import lombok.Getter; +import lombok.Setter; import org.apache.commons.collections4.CollectionUtils; import org.onap.policy.controlloop.ControlLoopNotificationType; import org.onap.policy.controlloop.ControlLoopOperation; @@ -53,8 +55,12 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics { private static final Logger logger = LoggerFactory.getLogger(CacheBasedControlLoopMetricsManager.class); private LoadingCache<UUID, VirtualControlLoopNotification> cache; + + @Getter private long cacheSize = ControlLoopMetricsFeature.CL_CACHE_TRANS_SIZE_DEFAULT; + @Getter + @Setter private long transactionTimeout = ControlLoopMetricsFeature.CL_CACHE_TRANS_TIMEOUT_SECONDS_DEFAULT; /** @@ -248,26 +254,11 @@ class CacheBasedControlLoopMetricsManager implements ControlLoopMetrics { } @Override - public long getCacheSize() { - return this.cacheSize; - } - - @Override public void setMaxCacheSize(long cacheSize) { this.cacheSize = cacheSize; } @Override - public long getTransactionTimeout() { - return this.transactionTimeout; - } - - @Override - public void setTransactionTimeout(long transactionTimeout) { - this.transactionTimeout = transactionTimeout; - } - - @Override public long getCacheOccupancy() { return this.cache.size(); } diff --git a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsManager.java b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsManager.java index c4ae11bdf..59442a226 100644 --- a/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsManager.java +++ b/controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsManager.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,11 +20,14 @@ package org.onap.policy.drools.apps.controlloop.feature.trans; +import lombok.AccessLevel; import lombok.Getter; +import lombok.NoArgsConstructor; /** * Control Loop Metrics Tracker. */ +@NoArgsConstructor(access = AccessLevel.PRIVATE) public class ControlLoopMetricsManager { /** @@ -32,8 +35,4 @@ public class ControlLoopMetricsManager { */ @Getter private static final ControlLoopMetrics manager = new CacheBasedControlLoopMetricsManager(); - - private ControlLoopMetricsManager() { - // do nothing - } } |