summaryrefslogtreecommitdiffstats
path: root/policy-management/src/main
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-09-13 14:48:05 -0500
committerJorge Hernandez <jh1730@att.com>2017-09-14 01:18:09 -0500
commit1f2fff6c740695cb2ae430af16684ebc13bc57d5 (patch)
treede7f031d4efb4b9cd1216acbb77a5e54319a12a8 /policy-management/src/main
parent009582f2e2a4bd3b09da3721a8b6587d5ac89723 (diff)
added "fetch timeout" backoff for UEB endpoints
this prevents high frequency fruitless attempts to connect to an unreachable (perhaps temporarily) UEB server. added additional management apis for noop endpoints. bump versions of jackson parsers so through snakeyaml library throughtransitive dependencies is bump up from 1.15 as it is resolved in the classpath at runtime to > 1.17 otherwise causes incompatibilities with the one used in controlloops under their own classloaders, as they expect 1.17. Change-Id: I936348c4b93a2c409c22568868c44ed330dc18f7 Issue-ID: POLICY-119 Signed-off-by: Jorge Hernandez <jh1730@att.com>
Diffstat (limited to 'policy-management/src/main')
-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.java2
2 files changed, 33 insertions, 2 deletions
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..a6f79374 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,