summaryrefslogtreecommitdiffstats
path: root/policy-management
diff options
context:
space:
mode:
Diffstat (limited to 'policy-management')
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java2
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java33
-rw-r--r--policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java3
3 files changed, 35 insertions, 3 deletions
diff --git a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
index 5ac17253..e217ee7d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/persistence/FileSystemPersistence.java
@@ -164,7 +164,7 @@ public class FileSystemPersistence implements SystemPersistence {
this.backupController(controllerName);
}
} catch (final Exception e) {
- logger.info("{}: no existing {} properties", this, controllerName);
+ logger.info("{}: no existing {} properties {}", this, controllerName, e);
// continue
}
}
diff --git a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
index ffcb35cd..48eedfa5 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/server/restful/RestManager.java
@@ -49,6 +49,7 @@ import org.onap.policy.drools.event.comm.TopicSink;
import org.onap.policy.drools.event.comm.TopicSource;
import org.onap.policy.drools.event.comm.bus.DmaapTopicSink;
import org.onap.policy.drools.event.comm.bus.DmaapTopicSource;
+import org.onap.policy.drools.event.comm.bus.NoopTopicSink;
import org.onap.policy.drools.event.comm.bus.UebTopicSink;
import org.onap.policy.drools.event.comm.bus.UebTopicSource;
import org.onap.policy.drools.features.PolicyControllerFeatureAPI;
@@ -1645,7 +1646,7 @@ public class RestManager {
@Path("engine/topics/sinks/ueb")
@ApiOperation(value = "Retrieves the UEB managed topic sinks",
notes = "UEB Topic Sinks Agregation", responseContainer = "List",
- response = UebTopicSource.class)
+ response = UebTopicSink.class)
public Response uebSinks() {
return Response.status(Response.Status.OK).entity(TopicEndpoint.manager.getUebTopicSinks())
.build();
@@ -1763,6 +1764,36 @@ public class RestManager {
}
@GET
+ @Path("engine/topics/sinks/noop")
+ @ApiOperation(value = "Retrieves the NOOP managed topic sinks",
+ notes = "NOOP Topic Sinks Agregation", responseContainer = "List",
+ response = NoopTopicSink.class)
+ public Response noopSinks() {
+ return Response.status(Response.Status.OK).entity(TopicEndpoint.manager.getNoopTopicSinks())
+ .build();
+ }
+
+ @GET
+ @Path("engine/topics/sinks/noop/{topic}")
+ @ApiOperation(value = "Retrieves a NOOP managed topic sink",
+ notes = "NOOP is an dev/null Network Communicaton Sink", response = NoopTopicSink.class)
+ public Response noopSinkTopic(
+ @ApiParam(value = "Topic Name", required = true) @PathParam("topic") String topic) {
+ return Response.status(Response.Status.OK).entity(TopicEndpoint.manager.getNoopTopicSink(topic))
+ .build();
+ }
+
+ @GET
+ @Path("engine/topics/sinks/noop/{topic}/events")
+ @ApiOperation(value = "Retrieves the latest events send through a NOOP topic",
+ notes = "NOOP is an dev/null Network Communicaton Sink", responseContainer = "List")
+ public Response noopSinkEvents(@PathParam("topic") String topic) {
+ return Response.status(Status.OK)
+ .entity(Arrays.asList(TopicEndpoint.manager.getNoopTopicSink(topic).getRecentEvents()))
+ .build();
+ }
+
+ @GET
@Path("engine/topics/sources/ueb/{topic}/switches")
@ApiOperation(value = "UEB Topic Control Switches",
notes = "List of the UEB Topic Control Switches", responseContainer = "List")
diff --git a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
index a262352b..b2b2df6d 100644
--- a/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
+++ b/policy-management/src/main/java/org/onap/policy/drools/system/PolicyEngine.java
@@ -760,7 +760,7 @@ class PolicyEngineManager implements PolicyEngine {
for (final HttpServletServer httpServer : this.httpServers) {
try {
- if (!httpServer.waitedStart(5 * 1000L))
+ if (!httpServer.waitedStart(10 * 1000L))
success = false;
} catch (final Exception e) {
logger.error("{}: cannot start http-server {} because of {}", this, httpServer,
@@ -998,6 +998,7 @@ class PolicyEngineManager implements PolicyEngine {
Thread.sleep(5000L);
} catch (final InterruptedException e) {
logger.warn("{}: interrupted-exception while shutting down management server: ", this);
+ Thread.currentThread().interrupt();
}
System.exit(0);