X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=rulemgt%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fholmes%2Frulemgt%2Fbolt%2Fenginebolt%2FEngineService.java;h=13507d67731e6c5287b9c1e7985acd3eaa7f4b9e;hb=580d4ce637b1c09b3bd2258b0b9c8332b8789bad;hp=319347e02cb1580bff82cf078a647a7ea16613a5;hpb=d165bd9397c9de0d16c5dc580306d6e63e1e1d60;p=holmes%2Frule-management.git diff --git a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java index 319347e..13507d6 100644 --- a/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java +++ b/rulemgt/src/main/java/org/onap/holmes/rulemgt/bolt/enginebolt/EngineService.java @@ -32,24 +32,27 @@ import org.onap.holmes.common.config.MicroServiceConfig; @Service public class EngineService { - protected HttpResponse delete(String packageName) throws Exception { + private static final String PREFIX = "https://"; + private static final String PORT = ":9102"; + + protected HttpResponse delete(String packageName, String ip) throws Exception { HashMap headers = createHeaders(); - String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH + "/" + packageName; + String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH + "/" + packageName; return HttpsUtils.delete(url, headers); } - protected HttpResponse check(CorrelationCheckRule4Engine correlationCheckRule4Engine) + protected HttpResponse check(CorrelationCheckRule4Engine correlationCheckRule4Engine, String ip) throws Exception { String content = GsonUtil.beanToJson(correlationCheckRule4Engine); HashMap headers = createHeaders(); - String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH; + String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH; return HttpsUtils.post(url, headers, new HashMap<>(), new StringEntity(content)); } - protected HttpResponse deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine) throws Exception { + protected HttpResponse deploy(CorrelationDeployRule4Engine correlationDeployRule4Engine, String ip) throws Exception { String content = GsonUtil.beanToJson(correlationDeployRule4Engine); HashMap headers = createHeaders(); - String url = MicroServiceConfig.getMsbServerAddrWithHttpPrefix() + RuleMgtConstant.ENGINE_PATH; + String url = PREFIX + ip + PORT + RuleMgtConstant.ENGINE_PATH; return HttpsUtils.put(url, headers, new HashMap<>(), new StringEntity(content)); }