diff options
author | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-10 07:48:14 -0500 |
---|---|---|
committer | Straubs, Ralph (rs8887) <rs8887@att.com> | 2019-10-15 06:17:37 -0500 |
commit | 33ec206449c190cb6fbd5e9ae186b04c15a5576c (patch) | |
tree | 8ca5b79c7d304687ee3694452fc0be02fc0c5518 /policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java | |
parent | 464b0e5f62167900d6cf60f058628dc273cedbf0 (diff) |
Add 'PolicySession.insertDrools' method
This change includes feature hooks, so a "smart insert" could forward
the object to a remote host, and do the insert there. The methods 'insert'
and 'insertAll' in 'PolicyContainer' now make use of this smart insert.
Change-Id: I69f0e874b6fda09d1f457e4353e4b30d63696210
Issue-ID: POLICY-2160
Signed-off-by: Straubs, Ralph (rs8887) <rs8887@att.com>
Diffstat (limited to 'policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java')
-rw-r--r-- | policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java index dd9ec154..331cebe8 100644 --- a/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java +++ b/policy-core/src/main/java/org/onap/policy/drools/core/PolicySessionFeatureApi.java @@ -78,6 +78,21 @@ public interface PolicySessionFeatureApi extends OrderedService { } /** + * This method is called when 'PolicySession.insertDrools' is called. + * In a distributed host environment, features have the ability to send + * the object do a different host, and do the insert. + * + * @param policySession the 'PolicySession' object associated with the + * Drools session + * @param object the object to insert in Drools memory + * @return 'true' if this feature is handling the operation, + * and 'false' if not. + */ + public default boolean insertDrools(PolicySession session, Object object) { + return false; + } + + /** * This method is called after 'KieSession.dispose()' is called. * * @param policySession the 'PolicySession' object that wrapped the |