summaryrefslogtreecommitdiffstats
path: root/feature-state-management/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'feature-state-management/src/main')
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java2
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java41
-rw-r--r--feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java10
3 files changed, 33 insertions, 20 deletions
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
index 2252a0f4..08c8e3a5 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/DroolsPdpIntegrityMonitor.java
@@ -355,7 +355,7 @@ public class DroolsPdpIntegrityMonitor extends IntegrityMonitor {
* @param persistenceProperties Used for DB access
* @throws Exception passed in by the audit
*/
- abstract void invoke(Properties persistenceProperties) throws Exception;
+ abstract void invoke(Properties persistenceProperties) throws IntegrityMonitorException;
}
public static class IntegrityMonitorRestServer implements Startable {
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
index 8f33f929..438b6ec8 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/RepositoryAudit.java
@@ -37,6 +37,7 @@ import java.util.TreeSet;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.onap.policy.common.im.IntegrityMonitorException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -106,7 +107,7 @@ public class RepositoryAudit extends DroolsPdpIntegrityMonitor.AuditBase {
* @param properties properties to be passed to the audit
*/
@Override
- public void invoke(Properties properties) throws IOException, InterruptedException {
+ public void invoke(Properties properties) throws IntegrityMonitorException {
logger.debug("Running 'RepositoryAudit.invoke'");
InvokeData data = new InvokeData();
@@ -121,25 +122,35 @@ public class RepositoryAudit extends DroolsPdpIntegrityMonitor.AuditBase {
return;
}
- // Run audit for first nexus repository
- logger.debug("Running read-only audit on first nexus repository: repository");
- runAudit(data);
+ try {
+ // Run audit for first nexus repository
+ logger.debug("Running read-only audit on first nexus repository: repository");
+ runAudit(data);
- // set of indices for supported nexus repos (ex: repository2 -> 2)
- // TreeSet is used to maintain order so repos can be audited in numerical order
- TreeSet<Integer> repoIndices = countAdditionalNexusRepos();
- logger.debug("Additional nexus repositories: {}", repoIndices);
+ // set of indices for supported nexus repos (ex: repository2 -> 2)
+ // TreeSet is used to maintain order so repos can be audited in numerical
+ // order
+ TreeSet<Integer> repoIndices = countAdditionalNexusRepos();
+ logger.debug("Additional nexus repositories: {}", repoIndices);
- // Run audit for remaining 'numNexusRepos' repositories
- for (int index : repoIndices) {
- logger.debug("Running read-only audit on nexus repository = repository{}", index);
+ // Run audit for remaining 'numNexusRepos' repositories
+ for (int index : repoIndices) {
+ logger.debug("Running read-only audit on nexus repository = repository{}", index);
- data = new InvokeData(index);
- data.initIsActive();
+ data = new InvokeData(index);
+ data.initIsActive();
- if (data.isActive) {
- runAudit(data);
+ if (data.isActive) {
+ runAudit(data);
+ }
}
+
+ } catch (IOException e) {
+ throw new IntegrityMonitorException(e);
+
+ } catch (InterruptedException e) {
+ Thread.currentThread().interrupt();
+ throw new IntegrityMonitorException(e);
}
}
diff --git a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
index 75233376..3dbb8d3e 100644
--- a/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
+++ b/feature-state-management/src/main/java/org/onap/policy/drools/statemanagement/StateManagementFeature.java
@@ -23,8 +23,10 @@ package org.onap.policy.drools.statemanagement;
import java.io.IOException;
import java.util.Properties;
import org.onap.policy.common.im.AllSeemsWellException;
+import org.onap.policy.common.im.IntegrityMonitorException;
import org.onap.policy.common.im.StateChangeNotifier;
import org.onap.policy.common.im.StateManagement;
+import org.onap.policy.common.im.StateManagementException;
import org.onap.policy.drools.core.PolicySessionFeatureApi;
import org.onap.policy.drools.features.PolicyEngineFeatureApi;
import org.onap.policy.drools.utils.PropertyUtil;
@@ -146,7 +148,7 @@ public class StateManagementFeature implements StateManagementFeatureApi,
* {@inheritDoc}.
*/
@Override
- public void disableFailed(String resourceName) throws Exception {
+ public void disableFailed(String resourceName) throws StateManagementException {
stateManagement.disableFailed(resourceName);
}
@@ -155,7 +157,7 @@ public class StateManagementFeature implements StateManagementFeatureApi,
* {@inheritDoc}.
*/
@Override
- public void disableFailed() throws Exception {
+ public void disableFailed() throws StateManagementException {
stateManagement.disableFailed();
}
@@ -163,7 +165,7 @@ public class StateManagementFeature implements StateManagementFeatureApi,
* {@inheritDoc}.
*/
@Override
- public void promote() throws Exception {
+ public void promote() throws IntegrityMonitorException {
stateManagement.promote();
}
@@ -171,7 +173,7 @@ public class StateManagementFeature implements StateManagementFeatureApi,
* {@inheritDoc}.
*/
@Override
- public void demote() throws Exception {
+ public void demote() throws StateManagementException {
stateManagement.demote();
}