3418d0677b1cefc7f5c5ef97e309f474ba8684cb
[policy/drools-pdp.git] /
1 package org.openecomp.policy.drools.features;
2
3 import java.util.Properties;
4
5 import org.openecomp.policy.drools.system.PolicyController;
6 import org.openecomp.policy.drools.utils.OrderedService;
7 import org.openecomp.policy.drools.utils.OrderedServiceImpl;
8
9 public interface PolicyControllerFeatureAPI extends OrderedService {
10
11           /**
12            * called before creating a controller with name 'name' and 
13            * properties 'properties'
14            * 
15            * @param name name of the the controller
16            * @param properties configuration properties
17            * 
18            * @return a policy controller.   A take over of the creation operation
19            * is performed by returning a non-null policy controller.   
20            * 'null' indicates that no take over has taken place, and processing should
21            * continue to the next feature provider.
22            */
23           public PolicyController beforeCreate(String name, Properties properties);
24
25           /**
26            * called after creating a controller with name 'name'
27            * 
28            * @param controller controller
29            * 
30            * @return true if this feature intercepts and takes ownership
31            * of the operation preventing the invocation of 
32            * lower priority features.   False, otherwise.
33            */
34           public boolean afterCreate(PolicyController controller);
35           
36           /**
37            * Feature providers implementing this interface
38            */
39           public static final OrderedServiceImpl<PolicyControllerFeatureAPI> providers = 
40                                                                         new OrderedServiceImpl<PolicyControllerFeatureAPI>(PolicyControllerFeatureAPI.class);
41 }