summaryrefslogtreecommitdiffstats
path: root/policy-healthcheck
diff options
context:
space:
mode:
authorRalph Straubs <rs8887@att.com>2017-04-21 04:23:55 -0500
committerRalph Straubs <rs8887@att.com>2017-04-21 05:55:16 -0500
commit5bd9ff4130799247be3be88fc02f3ce0efd014c0 (patch)
tree327ed17fae044265b08c419913290e2f9bcddcec /policy-healthcheck
parent8f7e5de17521836a96fa1c771a1651f63216675c (diff)
Batch submit -- force rebuild
[ECOMPD2TD-1126 1707] Delay the start of the election handler by one more update interval to allow updatedDate to be set and recoginized by other nodes. [ECOMPD2TD-1073 1707] Remove pessimistic locks from DB access to prevent DB deadlock [US867397-policy-management-feature-api] Split original FeatureAPI into three service interfaces. These are: - the original FeatureAPI for core - PolicyControllerFeatureAPI (additional interface methods yet to come ..) - PolicyEngineFeatureAPI (additional interface methods yet to come ..) Additional extensions will be done in the future. This is to have equivalent functionality with what it is already there. [US867397-policy-management-feature-api] Split original FeatureAPI into three service interfaces. These are: - the original FeatureAPI for core - PolicyControllerFeatureAPI (additional interface methods yet to come ..) - PolicyEngineFeatureAPI (additional interface methods yet to come ..) Additional extensions will be done in the future. This is to have equivalent functionality with what it is already there. [ECOMPD2TD-1167] Avoid redundant dependencies and remove obsolete sql scripts [ECOMPD2TD-848] Fix copied from ATT droolspdp repo -- add timestamp to metric and audit logs [ECOMPD2TD-1167] update jetty version to 9.3.14 [ECOMPD2TD-1167] pull in policy-core jar as a dependency of policy-management, instead of zip file [ECOMPD2TD-1159] Add property to ignore repository audit errors The property is called 'repository.audit.ignore.errors' -- it resides in 'IntegrityMonitor.properties', and it defaults to 'true'. When true, any errors that occur in the repository audit are logged, but not reported to integrity monitor. [US867397] additional hooks for policy engine, and support operation take over by feature bypassing further feature processing [US867397] additional hooks for policy engine, and support operation take over by feature bypassing further feature processing [US867397] fix reverse return javadoc comment [ECOMPD2TD-1192] Select correct persistent session information This is a modification to 'DroolsPdpsElectionHandler.DesignatedWaiter'. When going active, the list of persistent sessions needs to come from the most recent active DroolsPDP. The most recent active DroolsPDP is tracked in a local variable 'mostRecentPrimary', and the associated list of sessions needs to be extracted just prior to going active. The problem was that the list of sessions was extracted after the current DroolsPDP was set to 'mostRecentPrimary'. [ECOMPD2TD-1073 1707] Remove pessimistic locks from DB access to prevent DB deadlock [US860546] Add workaround for missing logger in message router [US860546] add DME2 properties to PolicyProperties [US860546] add DME2 support, pending unit testing [US860546] updated unit tests for dmaap/DME2 [US860546] removed System.out.println lines from BusConsumer and BusPublisher [US860546] modifications and additions to TopicEndpoint tests [US860546] remove block to append /events to serviceName in BusConsumer, BusPublisher [US860546] removing dmaap unit tests with ATT references [ECOMPD2TD-1167] Audit release repository by default [ECOMPD2TD-000] Cherry-pick versioning fixes from 1707.39.1 release branch [ECOMPD2TD-000] Fix policy-endpoints cambriaClient version [US865296] ECOMP Policy Logging Compliance, remove redundant timestamp from metric and audit log for logging compliance [US865296] ECOMP Policy Logging Compliance, remove TargetVirtualEntity from audit log, provide name to un-used column [US865296] ECOMP Policy Logging Compliance, remove Unused from AuditLogPattern, leave the column blank means un-used. [US000000] Cleanup and performance improvements 1) Changed 'OrderedServiceImpl' to ensure that the same service instance is used in every queue. This gets around the 'ServiceLoader' behavior that generates a new instance for each interface the service implements. 2) In 'PolicySession': add adaptive poll times within Drools sessions. Instead of always polling every 5 seconds, poll frequency increases when rules fire, and decreases when they don't. At present, the poll delay ranges from 100 milliseconds to 5 seconds, but at some point, it would be nice to make this configurable. 3) In 'PolicySession': add tests for 'logger.isDebugEnabled()' in session listener methods -- this results in a significant amount of real-time savings under load. [ECOMPD2TD-1126 1707] Changes to the election handler to deal with situations (race conditions) which can affect the site choice [ECOMPD2TD-1126 1707] Clean up of site afinity logic. Minor changes and a fix of the case where all pdpd are designated or all are hot standby. [ECOMPD2TD-1126 1707] Fixed issue with election handler and got all StandbyStateManagmentTest JUnits working. [ECOMPD2TD-1126 1707] Hopefully final changes to DroolsPdpsElectionHandler and StateManagementTest. Also removed the ResiliencyTestCases since they were redundant. [ECOMPD2TD-1126 1707] Found a minor bug in the computeMostRecentPrimary algorithm which I corrected and added a JUnit to confirm. [ECOMPD2TD-1126 1707] Removed code that was commented out of election handler to improve reability. Added an explanatory note to StandbyStateManagementTest. [US869183] Convert integrity monitor test endpoint to use HttpServletServer [US869183] add swagger-maven-plugin, update swagger annotation for IM test interface [US860371] Modified existing Dmaap and Ueb code to allow for https connectivity. HTTP/HTTPS is configurable via controller.properties file [US860520] Removed extra useHttps() method call from BusConsumer class where the consumer should be using http. Also, restored pom.xml to version at time feature branch was created. [US860520] Removed TopicEndpointTest.java. Added the ability to configure use of self-signed certificates for consumer topics. Functionality cannot be added for publisher at this time. Removed useHttps parameter field from multiple .builder methods to allow for greater ability to build source/sink objects without specifying http vs https connectivity. Other code cleanup and comments [US860520] -Deleted sys.out statements used in testing from BusConsumer/BusPublisher -Moved setProps method outside of if/else stub in BusConsumer -Could not add useHttps or selfSignedCerts to toString methods in BusConsumer -Move setProperty(contenttype, app/json) call outside of if/else branch in BusPublisher -Renamed doesAllowSelfSignedCerts method to is isAllowSelfSignedCerts and moved to BusTopicBase -Moved allowSelfSignedCerts member variable to BusTopicBase class. BusTopicBase is ancestor of SingleThreadedDmapp*/SingleThreadedUeb*/SingleThreadedBus* classes therefore, it will be inherited. -This changed resulted in cascading changes to the subclasses of BusTopicbase -Default is now set to disallow self-signed certs -Added several javadoc param annotations [US869183 1707] Changes to satisfy dependencies and correct pom syntax [ECOMPD2TD-1280] move DroolsPDPIntegrityMonitor.RestManager to its own class [ECOMPD2TD-1278] Resolve duplicate dependency issues (cherry-pick from 1707.40.1) [ECOMPD2TD-1278] revert cambriaClient back to 0.0.1 [ECOMPD2TD-1278] put dmaap version back to 0.2.12 [ECOMPD2TD-1280 1707] Fix Commons-lang3 version and common-modules version Conflicts: policy-endpoints/pom.xml policy-healthcheck/pom.xml policy-persistence/pom.xml pom.xml Change-Id: I803554bc64c55d2e82a3d6ad9120757f287144fb Signed-off-by: Ralph Straubs <rs8887@att.com>
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