summaryrefslogtreecommitdiffstats
path: root/examples/examples-onap-vcpe/src
diff options
context:
space:
mode:
Diffstat (limited to 'examples/examples-onap-vcpe/src')
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java (renamed from examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java)25
-rw-r--r--examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java (renamed from examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java)50
2 files changed, 69 insertions, 6 deletions
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java
index f6ae332a8..369e6172c 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSim.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSim.java
@@ -27,12 +27,18 @@ import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.server.ResourceConfig;
import org.onap.policy.apex.core.infrastructure.threading.ThreadUtilities;
-public class AAIAndGuardSim {
+/**
+ * The Class AaiAndGuardSim.
+ */
+public class AaiAndGuardSim {
private static final String BASE_URI = "http://localhost:54321/AAIAndGuardSim";
private HttpServer server;
- public AAIAndGuardSim() {
- final ResourceConfig rc = new ResourceConfig(AAIAndGuardSimEndpoint.class);
+ /**
+ * Instantiates a new aai and guard sim.
+ */
+ public AaiAndGuardSim() {
+ final ResourceConfig rc = new ResourceConfig(AaiAndGuardSimEndpoint.class);
server = GrizzlyHttpServerFactory.createHttpServer(URI.create(BASE_URI), rc);
while (!server.isStarted()) {
@@ -40,12 +46,23 @@ public class AAIAndGuardSim {
}
}
+ /**
+ * Tear down.
+ *
+ * @throws Exception the exception
+ */
public void tearDown() throws Exception {
server.shutdown();
}
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ * @throws Exception the exception
+ */
public static void main(final String[] args) throws Exception {
- final AAIAndGuardSim sim = new AAIAndGuardSim();
+ final AaiAndGuardSim sim = new AaiAndGuardSim();
while (true) {
try {
diff --git a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java
index 6c7f7db19..e36ef4d11 100644
--- a/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AAIAndGuardSimEndpoint.java
+++ b/examples/examples-onap-vcpe/src/test/java/org/onap/policy/apex/domains/onap/vcpe/AaiAndGuardSimEndpoint.java
@@ -34,15 +34,22 @@ import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.core.Response;
-
+/**
+ * The Class AaiAndGuardSimEndpoint.
+ */
@Path("/sim")
-public class AAIAndGuardSimEndpoint {
+public class AaiAndGuardSimEndpoint {
private static int postMessagesReceived = 0;
private static int putMessagesReceived = 0;
private static int statMessagesReceived = 0;
private static int getMessagesReceived = 0;
+ /**
+ * Service get stats.
+ *
+ * @return the response
+ */
@Path("/pdp/api/Stats")
@GET
public Response serviceGetStats() {
@@ -51,6 +58,12 @@ public class AAIAndGuardSimEndpoint {
+ ",\"POST\": " + postMessagesReceived + ",\"PUT\": " + putMessagesReceived + "}").build();
}
+ /**
+ * Service guard post request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/pdp/api/getDecision")
@POST
public Response serviceGuardPostRequest(final String jsonString) {
@@ -65,6 +78,11 @@ public class AAIAndGuardSimEndpoint {
}
}
+ /**
+ * Service get event.
+ *
+ * @return the response
+ */
@Path("/event/GetEvent")
@GET
public Response serviceGetEvent() {
@@ -83,18 +101,34 @@ public class AAIAndGuardSimEndpoint {
return Response.status(200).entity(eventString).build();
}
+ /**
+ * Service get empty event.
+ *
+ * @return the response
+ */
@Path("/event/GetEmptyEvent")
@GET
public Response serviceGetEmptyEvent() {
return Response.status(200).build();
}
+ /**
+ * Service get event bad response.
+ *
+ * @return the response
+ */
@Path("/event/GetEventBadResponse")
@GET
public Response serviceGetEventBadResponse() {
return Response.status(400).build();
}
+ /**
+ * Service post request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PostEvent")
@POST
public Response servicePostRequest(final String jsonString) {
@@ -112,12 +146,24 @@ public class AAIAndGuardSimEndpoint {
+ ",\"POST\": , " + postMessagesReceived + ",\"PUT\": " + putMessagesReceived + "}").build();
}
+ /**
+ * Service post request bad response.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PostEventBadResponse")
@POST
public Response servicePostRequestBadResponse(final String jsonString) {
return Response.status(400).build();
}
+ /**
+ * Service put request.
+ *
+ * @param jsonString the json string
+ * @return the response
+ */
@Path("/event/PutEvent")
@PUT
public Response servicePutRequest(final String jsonString) {