summaryrefslogtreecommitdiffstats
path: root/controlloop/common/feature-controlloop-trans/src/main
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-06-17 14:54:22 -0400
committerJim Hahn <jrh3@att.com>2021-06-17 15:13:19 -0400
commit2ebe1425ae8e90d5243960a5ac66dd009251b75b (patch)
tree17536efd4b37eef283a0516365c672ae5095993a /controlloop/common/feature-controlloop-trans/src/main
parent42f9de83e46be30d947de156b6174f753fc3e48d (diff)
Use lombok in drools-apps
Issue-ID: POLICY-3398 Change-Id: I2afedc900bc268dc83f689624b4daabdb64a09f9 Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'controlloop/common/feature-controlloop-trans/src/main')
-rw-r--r--controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/CacheBasedControlLoopMetricsManager.java21
-rw-r--r--controlloop/common/feature-controlloop-trans/src/main/java/org/onap/policy/drools/apps/controlloop/feature/trans/ControlLoopMetricsManager.java9
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
- }
}