diff options
Diffstat (limited to 'appc-event-listener/appc-event-listener-bundle/src/main/java/org')
2 files changed, 18 insertions, 44 deletions
diff --git a/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/impl/ProviderOperations.java b/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/impl/ProviderOperations.java index 85de6bd66..f51be2859 100644 --- a/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/impl/ProviderOperations.java +++ b/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/impl/ProviderOperations.java @@ -89,7 +89,7 @@ public class ProviderOperations { } //String body = buildReqest(msg.getId(), msg.getUrl(), msg.getIdentityUrl()); - String body = buildReqest(msg.getHeader().getRequestID(), msg.getPayload().getGenericVnfId(), msg.getPayload().getPgStreams()); + String body = buildReqest(msg.getHeader().getRequestID(), msg.getPayload().getGenericVnfId(), msg.getPayload().getStreams()); StringEntity entity = new StringEntity(body); entity.setContentType("application/json"); post.setEntity(new StringEntity(body)); diff --git a/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/model/CommonMessage.java b/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/model/CommonMessage.java index 45b99a9f6..e0dbbab67 100644 --- a/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/model/CommonMessage.java +++ b/appc-event-listener/appc-event-listener-bundle/src/main/java/org/onap/appc/listener/demo/model/CommonMessage.java @@ -268,25 +268,16 @@ public class CommonMessage implements Serializable { this.genericVnfId = genericVnfId; } - @JsonProperty("pg-streams") - private pgStreams pgStreams; + @JsonProperty("streams") + private Streams streams; /** * @return the TenantID */ - public String getPgStreams() { - String r = "{\\\"pg-streams\\\": {\\\"pg-stream\\\":["; - boolean first = true; - for(pgStream p : this.pgStreams.streams){ - String n = "{\\\"id\\\":\\\""+p.getId()+"\\\", \\\"is-enabled\\\":\\\""+p.getIsEnabled()+"\\\"}"; - if(!first){ - r = r.concat(","); - } - first = false; - r = r.concat(n); - } - r= r.concat("]}}"); + public String getStreams() { + String r = "{\\\"streams\\\": {\\\"active-streams\\\": " + streams.getActiveStreams() + + "}}"; return r; } @@ -294,8 +285,8 @@ public class CommonMessage implements Serializable { * @param TenantID * the TenantID to set */ - public void setPgStreams(pgStreams pgStreams) { - this.pgStreams = pgStreams; + public void setStreams(Streams streams) { + this.streams = streams; } @@ -304,36 +295,19 @@ public class CommonMessage implements Serializable { }; @JsonIgnoreProperties(ignoreUnknown = true) - public static class pgStreams { - @JsonProperty("pg-stream") - private Collection<pgStream> streams; - - public Collection<pgStream> getStreams() { - return streams; + public static class Streams { + + @JsonProperty("active-streams") + private int activeStreams; + + public int getActiveStreams() { + return this.activeStreams; } - public void setStreams(Collection<pgStream> streams) { - this.streams = streams; + public void setActiveStreams(int activeStreams) { + this.activeStreams = activeStreams; } + }; - @JsonIgnoreProperties(ignoreUnknown = true) - public static class pgStream{ - public String getId() { - return id; - } - public void setId(String id) { - this.id = id; - } - public String getIsEnabled() { - return isEnabled; - } - public void setIsEnabled(String isEnabled) { - this.isEnabled = isEnabled; - } - @JsonProperty("id") - private String id; - @JsonProperty("is-enabled") - private String isEnabled; - }; } |