summaryrefslogtreecommitdiffstats
path: root/policy-healthcheck
diff options
context:
space:
mode:
Diffstat (limited to 'policy-healthcheck')
-rw-r--r--policy-healthcheck/pom.xml50
-rw-r--r--policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java146
-rw-r--r--policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI (renamed from policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI)0
3 files changed, 111 insertions, 85 deletions
diff --git a/policy-healthcheck/pom.xml b/policy-healthcheck/pom.xml
index 3b45c916..5a409d4a 100644
--- a/policy-healthcheck/pom.xml
+++ b/policy-healthcheck/pom.xml
@@ -83,52 +83,7 @@
<addParentPoms>false</addParentPoms>
<copyPom>false</copyPom>
<excludeGroupIds>org.opendaylight,com.brocade.odl</excludeGroupIds>
- <scope>provided</scope>
- </configuration>
- </execution>
- </executions>
- </plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <version>2.6</version>
- <executions>
- <execution>
- <id>copy-version</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/versions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/versions</directory>
- <includes>
- <include>version.properties</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
- </configuration>
- </execution>
- <execution>
- <id>copy-resources</id>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <phase>validate</phase>
- <configuration>
- <outputDirectory>${basedir}/target/etc/bvc-extensions</outputDirectory>
- <resources>
- <resource>
- <directory>src/main/resources/etc/bvc-extensions</directory>
- <includes>
- <include>feature_config_template.cfg</include>
- <include>feature_custom.install</include>
- </includes>
- <filtering>true</filtering>
- </resource>
- </resources>
+ <excludeScope>provided</excludeScope>
</configuration>
</execution>
</executions>
@@ -141,16 +96,19 @@
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-core</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-endpoints</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
<dependency>
<groupId>org.openecomp.policy.drools-pdp</groupId>
<artifactId>policy-management</artifactId>
<version>${project.version}</version>
+ <scope>provided</scope>
</dependency>
</dependencies>
diff --git a/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java b/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
index ce1dd90b..321d1e73 100644
--- a/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
+++ b/policy-healthcheck/src/main/java/org/openecomp/policy/drools/healthcheck/HealthCheckFeature.java
@@ -2,90 +2,158 @@ package org.openecomp.policy.drools.healthcheck;
import java.util.Properties;
-import org.kie.api.runtime.KieSession;
-import org.openecomp.policy.drools.core.FeatureAPI;
-import org.openecomp.policy.drools.core.PolicyContainer;
-import org.openecomp.policy.drools.core.PolicySession;
+import org.openecomp.policy.drools.features.PolicyEngineFeatureAPI;
+import org.openecomp.policy.drools.system.PolicyEngine;
-public class HealthCheckFeature implements FeatureAPI {
+public class HealthCheckFeature implements PolicyEngineFeatureAPI {
public static final String CONFIGURATION_PROPERTIES_NAME = "policy-healthcheck";
+ /**
+ * {@inheritDoc}
+ */
@Override
public int getSequenceNumber() {
- return 2;
+ return 1000;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void globalInit(String[] args, String configDir) {
- return;
+ public boolean beforeStart(PolicyEngine engine) throws IllegalStateException {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public KieSession activatePolicySession(PolicyContainer policyContainer, String name, String kieBaseName) {
- return null;
+ public boolean afterStart(PolicyEngine engine) {
+ try {
+ HealthCheck.monitor.start();
+ } catch (IllegalStateException e) {
+ e.printStackTrace();
+ }
+
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void disposeKieSession(PolicySession policySession) {
- return;
+ public boolean beforeShutdown(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void destroyKieSession(PolicySession policySession) {
- return;
+ public boolean afterShutdown(PolicyEngine engine) {
+ try {
+ HealthCheck.monitor.stop();
+ } catch (IllegalStateException e) {
+ e.printStackTrace();
+ }
+
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeStartEngine() throws IllegalStateException {
- return;
+ public boolean beforeConfigure(PolicyEngine engine, Properties properties) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterStartEngine() {
- try {
- HealthCheck.monitor.start();
- } catch (IllegalStateException e) {
- e.printStackTrace();
- }
+ public boolean afterConfigure(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeActivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeShutdownEngine() {
- return;
+ public boolean afterActivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterShutdownEngine() {
- try {
- HealthCheck.monitor.stop();
- } catch (IllegalStateException e) {
- e.printStackTrace();
- }
+ public boolean beforeDeactivate(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean afterDeactivate(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeCreateController(String name, Properties properties) {
- return;
+ public boolean beforeStop(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterCreateController(String name) {
- return;
+ public boolean afterStop(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void beforeStartController(String name) {
- return;
+ public boolean beforeLock(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public void afterStartController(String name) {
- return;
+ public boolean afterLock(PolicyEngine engine) {
+ return false;
+ }
+
+ /**
+ * {@inheritDoc}
+ */
+ @Override
+ public boolean beforeUnlock(PolicyEngine engine) {
+ return false;
}
+ /**
+ * {@inheritDoc}
+ */
@Override
- public boolean isPersistenceEnabled() {
+ public boolean afterUnlock(PolicyEngine engine) {
return false;
}
diff --git a/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI b/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI
index 7e307d08..7e307d08 100644
--- a/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.core.FeatureAPI
+++ b/policy-healthcheck/src/main/resources/META-INF/services/org.openecomp.policy.drools.features.PolicyEngineFeatureAPI