diff options
Diffstat (limited to 'policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java')
-rw-r--r-- | policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java b/policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java index abf524e4..bb11bb64 100644 --- a/policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java +++ b/policy-management/src/main/java/org/onap/policy/drools/features/DroolsControllerFeatureApi.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP * ================================================================================ - * Copyright (C) 2018-2019 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2018-2020 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,9 +20,12 @@ package org.onap.policy.drools.features; +import java.util.List; +import java.util.Properties; import org.onap.policy.common.endpoints.event.comm.TopicSink; import org.onap.policy.common.utils.services.OrderedService; import org.onap.policy.drools.controller.DroolsController; +import org.onap.policy.drools.protocol.coders.TopicCoderFilterConfiguration; /** * Drools Controller Feature API. Hooks into the Drools Controller operations. @@ -30,6 +33,38 @@ import org.onap.policy.drools.controller.DroolsController; public interface DroolsControllerFeatureApi extends OrderedService { /** + * intercepts the instantiation of a DroolsController. + * + * @param properties controller properties + * @param groupId group id coordinate + * @param artifactId artifact id coordinate + * @param version version coordinate + * @param decoderConfigurations decoder configurations + * @param encoderConfigurations encoder configurations + * + * @return a Drools Controller or 'null' for no intercept + */ + default DroolsController beforeInstance(Properties properties, + String groupId, String artifactId, String version, + List<TopicCoderFilterConfiguration> decoderConfigurations, + List<TopicCoderFilterConfiguration> encoderConfigurations) { + return null; + } + + /** + * called after a DroolsController is instantiated. + * + * @param droolsController drools controller + * @param properties controller properties + * + * @return True if this feature intercepts and takes ownership of the operation + * preventing the invocation of lower priority features. False, otherwise + */ + default boolean afterInstance(DroolsController droolsController, Properties properties) { + return false; + } + + /** * intercepts before the Drools Controller gives the Policy Container a fact to * insert into its Policy Sessions. * |