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.onap.policy.drools.features;
23 import java.util.Properties;
25 import org.onap.policy.drools.system.PolicyEngine;
26 import org.onap.policy.drools.utils.OrderedService;
27 import org.onap.policy.drools.utils.OrderedServiceImpl;
30 * Policy Engine Feature API.
31 * Provides Interception Points during the Policy Engine lifecycle.
33 public interface PolicyEngineFeatureAPI extends OrderedService {
36 * intercept before the Policy Engine is commanded to boot.
38 * @return true if this feature intercepts and takes ownership
39 * of the operation preventing the invocation of
40 * lower priority features. False, otherwise.
42 public default boolean beforeBoot(PolicyEngine engine, String cliArgs[]) {return false;};
45 * intercept after the Policy Engine is booted.
47 * @return true if this feature intercepts and takes ownership
48 * of the operation preventing the invocation of
49 * lower priority features. False, otherwise.
51 public default boolean afterBoot(PolicyEngine engine) {return false;};
54 * intercept before the Policy Engine is configured.
56 * @return true if this feature intercepts and takes ownership
57 * of the operation preventing the invocation of
58 * lower priority features. False, otherwise.
60 public default boolean beforeConfigure(PolicyEngine engine, Properties properties) {return false;};
63 * intercept after the Policy Engine is configured.
65 * @return true if this feature intercepts and takes ownership
66 * of the operation preventing the invocation of
67 * lower priority features. False, otherwise.
69 public default boolean afterConfigure(PolicyEngine engine) {return false;};
72 * intercept before the Policy Engine goes active.
74 * @return true if this feature intercepts and takes ownership
75 * of the operation preventing the invocation of
76 * lower priority features. False, otherwise.
78 public default boolean beforeActivate(PolicyEngine engine) {return false;};
81 * intercept after the Policy Engine goes active.
83 * @return true if this feature intercepts and takes ownership
84 * of the operation preventing the invocation of
85 * lower priority features. False, otherwise.
87 public default boolean afterActivate(PolicyEngine engine) {return false;};
90 * intercept before the Policy Engine goes standby.
92 * @return true if this feature intercepts and takes ownership
93 * of the operation preventing the invocation of
94 * lower priority features. False, otherwise.
96 public default boolean beforeDeactivate(PolicyEngine engine) {return false;};
99 * intercept after the Policy Engine goes standby.
101 * @return true if this feature intercepts and takes ownership
102 * of the operation preventing the invocation of
103 * lower priority features. False, otherwise.
105 public default boolean afterDeactivate(PolicyEngine engine) {return false;};
108 * intercept before the Policy Engine is started.
110 * @return true if this feature intercepts and takes ownership
111 * of the operation preventing the invocation of
112 * lower priority features. False, otherwise.
114 public default boolean beforeStart(PolicyEngine engine) {return false;};
117 * intercept after the Policy Engine is started.
119 * @return true if this feature intercepts and takes ownership
120 * of the operation preventing the invocation of
121 * lower priority features. False, otherwise.
123 public default boolean afterStart(PolicyEngine engine) {return false;};
126 * intercept before the Policy Engine is stopped.
128 * @return true if this feature intercepts and takes ownership
129 * of the operation preventing the invocation of
130 * lower priority features. False, otherwise..
132 public default boolean beforeStop(PolicyEngine engine) {return false;};
135 * intercept after the Policy Engine is stopped
137 * @return true if this feature intercepts and takes ownership
138 * of the operation preventing the invocation of
139 * lower priority features. False, otherwise.d.
141 public default boolean afterStop(PolicyEngine engine) {return false;};
144 * intercept before the Policy Engine is locked
146 * @return true if this feature intercepts and takes ownership
147 * of the operation preventing the invocation of
148 * lower priority features. False, otherwise.
150 public default boolean beforeLock(PolicyEngine engine) {return false;};
153 * intercept after the Policy Engine is locked
155 * @return true if this feature intercepts and takes ownership
156 * of the operation preventing the invocation of
157 * lower priority features. False, otherwise..
159 public default boolean afterLock(PolicyEngine engine) {return false;};
162 * intercept before the Policy Engine is locked
164 * @return true if this feature intercepts and takes ownership
165 * of the operation preventing the invocation of
166 * lower priority features. False, otherwise.
168 public default boolean beforeUnlock(PolicyEngine engine) {return false;};
171 * intercept after the Policy Engine is locked
173 * @return true if this feature intercepts and takes ownership
174 * of the operation preventing the invocation of
175 * lower priority features. False, otherwise.
177 public default boolean afterUnlock(PolicyEngine engine) {return false;};
180 * intercept the Policy Engine is shut down
182 * @return true if this feature intercepts and takes ownership
183 * of the operation preventing the invocation of
184 * lower priority features. False, otherwise..
186 public default boolean beforeShutdown(PolicyEngine engine){return false;};
189 * called after the Policy Engine is shut down
191 * @return true if this feature intercepts and takes ownership
192 * of the operation preventing the invocation of
193 * lower priority features. False, otherwise.
195 public default boolean afterShutdown(PolicyEngine engine) {return false;};
198 * Feature providers implementing this interface
200 public static final OrderedServiceImpl<PolicyEngineFeatureAPI> providers =
201 new OrderedServiceImpl<>(PolicyEngineFeatureAPI.class);