summaryrefslogtreecommitdiffstats
path: root/engine-d/src/main/java/org/onap
diff options
context:
space:
mode:
authorShiwei Tian <tian.shiwei@zte.com.cn>2018-03-06 10:01:38 +0800
committerShiwei Tian <tian.shiwei@zte.com.cn>2018-03-06 10:01:38 +0800
commit5b3f8b279725c337de6988e703cca418b3e53826 (patch)
tree42fe75020eb407a6cc20c7b04447506345687184 /engine-d/src/main/java/org/onap
parent3b822dd0c43d656cf4cb9b3f37633300b963e120 (diff)
Change HTTP Requests into HTTPS Ones
Issue-ID: HOLMES-104 Change-Id: I535050f7dcacc2caa75d9a8941d93000fd91c361 Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
Diffstat (limited to 'engine-d/src/main/java/org/onap')
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java1
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java1
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java4
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java8
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java4
-rw-r--r--engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java2
6 files changed, 7 insertions, 13 deletions
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java
index 4f5593c..0e7acac 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/EngineDActiveApp.java
@@ -62,6 +62,7 @@ public class EngineDActiveApp extends IOCApplication<EngineDAppConfig> {
msinfo.setUrl("/api/holmes-engine-mgmt/v1");
msinfo.setProtocol("REST");
msinfo.setVisualRange("0|1");
+ msinfo.setEnable_ssl(true);
Set<Node> nodes = new HashSet<>();
Node node = new Node();
node.setIp(serviceAddrInfo[0]);
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java b/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java
index 6e0da48..8af9778 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/request/CompileRuleRequest.java
@@ -24,7 +24,6 @@ import lombok.Setter;
@Setter
public class CompileRuleRequest {
- @JsonProperty(value = "content")
@NotNull
private String content;
} \ No newline at end of file
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java b/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java
index 74ddf67..f2ef369 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/request/DeployRuleRequest.java
@@ -15,7 +15,6 @@
*/
package org.onap.holmes.engine.request;
-import com.fasterxml.jackson.annotation.JsonProperty;
import javax.validation.constraints.NotNull;
import lombok.Getter;
import lombok.Setter;
@@ -24,14 +23,11 @@ import lombok.Setter;
@Setter
public class DeployRuleRequest {
- @JsonProperty(value = "content")
@NotNull
private String content;
- @JsonProperty(value = "engineid")
private String engineId;
- @JsonProperty(value = "loopcontrolname")
@NotNull
private String loopControlName;
}
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java b/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java
index 99567b8..548b9b2 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/resources/DmaapConfigurationService.java
@@ -50,7 +50,7 @@ public class DmaapConfigurationService {
+ " and <b>url</b>. Both fields are required.") DmaapConfigRequest config,
@Context HttpServletRequest request){
String url = config.getUrl();
- if (url.startsWith("http://")) {
+ if (url.startsWith("http://") || url.startsWith("https://")) {
Subscriber subscriber = new Subscriber();
subscriber.setTopic(config.getName());
subscriber.setUrl(url);
@@ -64,7 +64,7 @@ public class DmaapConfigurationService {
return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}";
}
- return "{\"message\": \"Only the HTTP protocol is supported!\"}";
+ return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}";
}
@DELETE
@@ -92,7 +92,7 @@ public class DmaapConfigurationService {
+ " and <b>url</b>. Both fields are required.") DmaapConfigRequest config,
@Context HttpServletRequest request){
String url = config.getUrl();
- if (url.startsWith("http://")) {
+ if (url.startsWith("http://") || url.startsWith("https://")) {
SecurityInfo securityInfo = new SecurityInfo();
SecurityInfo.DmaapInfo dmaapInfo = new SecurityInfo().new DmaapInfo();
dmaapInfo.setTopicUrl(config.getUrl());
@@ -100,6 +100,6 @@ public class DmaapConfigurationService {
DcaeConfigurationsCache.addPubSecInfo(config.getName(), securityInfo);
return "{\"message\": \"Succeeded!\", \"topic\": \"" + config.getName() + "\"}";
}
- return "{\"message\": \"Only the HTTP protocol is supported!\"}";
+ return "{\"message\": \"Only the HTTP or HTTPS protocol is supported!\"}";
}
}
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java b/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java
index b4cb0b1..b9875da 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/resources/EngineResources.java
@@ -61,8 +61,8 @@ public class EngineResources {
@Timed
public CorrelationRuleResponse deployRule(
@ApiParam(value = "The request entity of the HTTP call, which comprises three "
- + "fields: \"content\" , \"loopcontrolname\" and \"engineid\". "
- + "The \"content\" should be a valid Drools rule string and the \"engineid\" "
+ + "fields: \"content\" , \"loopControlName\" and \"engineId\". "
+ + "The \"content\" should be a valid Drools rule string and the \"engineId\" "
+ "has to be \"engine-d\" in the Amsterdam release.", required = true) DeployRuleRequest deployRuleRequest,
@Context HttpServletRequest httpRequest) {
diff --git a/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java b/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java
index b234f91..306bd7f 100644
--- a/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java
+++ b/engine-d/src/main/java/org/onap/holmes/engine/response/CorrelationRuleResponse.java
@@ -15,7 +15,6 @@
*/
package org.onap.holmes.engine.response;
-import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;
import lombok.Setter;
@@ -23,6 +22,5 @@ import lombok.Setter;
@Setter
public class CorrelationRuleResponse {
- @JsonProperty(value = "package")
private String packageName;
}