2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
21 package org.openecomp.policy.drools.features;
23 import java.util.Properties;
25 import org.openecomp.policy.drools.system.PolicyController;
26 import org.openecomp.policy.drools.utils.OrderedService;
27 import org.openecomp.policy.drools.utils.OrderedServiceImpl;
29 public interface PolicyControllerFeatureAPI extends OrderedService {
32 * called before creating a controller with name 'name' and
33 * properties 'properties'
35 * @param name name of the the controller
36 * @param properties configuration properties
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.
43 public PolicyController beforeCreate(String name, Properties properties);
46 * called after creating a controller with name 'name'
48 * @param controller controller
50 * @return true if this feature intercepts and takes ownership
51 * of the operation preventing the invocation of
52 * lower priority features. False, otherwise.
54 public boolean afterCreate(PolicyController controller);
57 * Feature providers implementing this interface
59 public static final OrderedServiceImpl<PolicyControllerFeatureAPI> providers =
60 new OrderedServiceImpl<PolicyControllerFeatureAPI>(PolicyControllerFeatureAPI.class);