Allocate Rule
[holmes/rule-management.git] / rulemgt / src / main / java / org / onap / holmes / rulemgt / bolt / enginebolt / EngineService.java
index 319347e..13507d6 100644 (file)
@@ -32,24 +32,27 @@ import org.onap.holmes.common.config.MicroServiceConfig;
 @Service\r
 public class EngineService {\r
 \r
-    protected HttpResponse delete(String packageName) throws Exception {\r
+    private static final String PREFIX = "https://";\r
+    private static final String PORT = ":9102";\r
+\r
+    protected HttpResponse delete(String packageName, String ip) throws Exception {\r
         HashMap headers = createHeaders();\r
-        String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH + "/" + packageName;\r
+        String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH + "/" + packageName;\r
         return HttpsUtils.delete(url, headers);\r
     }\r
 \r
-    protected HttpResponse check(CorrelationCheckRule4Engine correlationCheckRule4Engine)\r
+    protected HttpResponse check(CorrelationCheckRule4Engine correlationCheckRule4Engine, String ip)\r
             throws Exception {\r
         String content = GsonUtil.beanToJson(correlationCheckRule4Engine);\r
         HashMap headers = createHeaders();\r
-        String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH;\r
+        String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH;\r
         return HttpsUtils.post(url, headers, new HashMap<>(), new StringEntity(content));\r
     }\r
 \r
-    protected HttpResponse deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine) throws Exception {\r
+    protected HttpResponse deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine, String ip) throws Exception {\r
         String content = GsonUtil.beanToJson(correlationDeployRule4Engine);\r
         HashMap headers = createHeaders();\r
-        String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH;\r
+        String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH;\r
         return HttpsUtils.put(url, headers, new HashMap<>(), new StringEntity(content));\r
     }\r
 \r