a52ada3dbb093ec7eee14c227bd7a7873606efb3
[policy/drools-pdp.git] /
1 /*-
2  * ============LICENSE_START=======================================================
3  * policy-management
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  * ============LICENSE_END=========================================================
19  */
20
21 package org.openecomp.policy.drools.features;
22
23 import java.util.Properties;
24
25 import org.openecomp.policy.drools.system.PolicyController;
26 import org.openecomp.policy.drools.utils.OrderedService;
27 import org.openecomp.policy.drools.utils.OrderedServiceImpl;
28
29 public interface PolicyControllerFeatureAPI extends OrderedService {
30
31           /**
32            * called before creating a controller with name 'name' and 
33            * properties 'properties'
34            * 
35            * @param name name of the the controller
36            * @param properties configuration properties
37            * 
38            * @return a policy controller.   A take over of the creation operation
39            * is performed by returning a non-null policy controller.   
40            * 'null' indicates that no take over has taken place, and processing should
41            * continue to the next feature provider.
42            */
43           public PolicyController beforeCreate(String name, Properties properties);
44
45           /**
46            * called after creating a controller with name 'name'
47            * 
48            * @param controller controller
49            * 
50            * @return true if this feature intercepts and takes ownership
51            * of the operation preventing the invocation of 
52            * lower priority features.   False, otherwise.
53            */
54           public boolean afterCreate(PolicyController controller);
55           
56           /**
57            * Feature providers implementing this interface
58            */
59           public static final OrderedServiceImpl<PolicyControllerFeatureAPI> providers = 
60                                                                         new OrderedServiceImpl<PolicyControllerFeatureAPI>(PolicyControllerFeatureAPI.class);
61 }