aboutsummaryrefslogtreecommitdiffstats
path: root/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
diff options
context:
space:
mode:
authorJim Hahn <jrh3@att.com>2021-08-05 14:53:19 -0400
committerJim Hahn <jrh3@att.com>2021-08-05 15:25:14 -0400
commitda1b7d9f04453e94fb77ebe4213f456a0be63fc2 (patch)
treee59daec0050c7ce88c07f1d7f97168aa849128a7 /policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
parent1744dac574fb771301027be74c9257eb070125f7 (diff)
Use lombok in drools-pdp #2
Updated feature-session-persistence thru drools-domains. Issue-ID: POLICY-3397 Change-Id: I0b1c6da8b2301c00dd792675e8cf1f49888edb9f Signed-off-by: Jim Hahn <jrh3@att.com>
Diffstat (limited to 'policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java')
-rw-r--r--policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java42
1 files changed, 9 insertions, 33 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
index fb17b10a..1f8a61c6 100644
--- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
+++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySession.java
@@ -22,6 +22,7 @@
package org.onap.policy.drools.core;
import java.util.concurrent.ConcurrentHashMap;
+import lombok.Getter;
import org.kie.api.event.rule.AfterMatchFiredEvent;
import org.kie.api.event.rule.AgendaEventListener;
import org.kie.api.event.rule.AgendaGroupPoppedEvent;
@@ -52,11 +53,18 @@ public class PolicySession
implements AgendaEventListener, RuleRuntimeEventListener {
// get an instance of logger
private static Logger logger = LoggerFactory.getLogger(PolicySession.class);
+
+ // supports 'getCurrentSession()' method
+ private static ThreadLocal<PolicySession> policySess =
+ new ThreadLocal<>();
+
// name of the 'PolicySession' and associated 'KieSession'
+ @Getter
private String name;
// the associated 'PolicyContainer', which may have additional
// 'PolicySession' instances in addition to this one
+ @Getter
private PolicyContainer container;
// maps feature objects to per-PolicyContainer data
@@ -64,15 +72,12 @@ public class PolicySession
new ConcurrentHashMap<>();
// associated 'KieSession' instance
+ @Getter
private KieSession kieSession;
// if not 'null', this is the thread model processing the 'KieSession'
private ThreadModel threadModel = null;
- // supports 'getCurrentSession()' method
- private static ThreadLocal<PolicySession> policySess =
- new ThreadLocal<>();
-
/**
* Internal constructor - create a 'PolicySession' instance.
*
@@ -90,35 +95,6 @@ public class PolicySession
}
/**
- * Get policy container.
- *
- * @return the 'PolicyContainer' object containing this session
- */
- public PolicyContainer getPolicyContainer() {
- return container;
- }
-
- /**
- * Get Kie Session.
- *
- * @return the associated 'KieSession' instance
- */
- public KieSession getKieSession() {
- return kieSession;
- }
-
- /**
- * Get name.
- *
- * @return the local name of this session, which should either match the
- * name specified in 'kmodule.xml' file associated with this session, or the
- * name passed on the 'PolicyContainer.adoptKieSession' method.
- */
- public String getName() {
- return name;
- }
-
- /**
* Get full name.
*
* @return the 'PolicyContainer' name, followed by ':', followed by the