Add log for debugging
author6092002067 <wu.youbo@zte.com.cn>
Mon, 13 Mar 2017 11:22:08 +0000 (19:22 +0800)
committer6092002067 <wu.youbo@zte.com.cn>
Mon, 13 Mar 2017 11:36:44 +0000 (19:36 +0800)
Issue-ID: HOLMES-50

Change-Id: I3a481f36be640c7b6e067c3663d422d39aae588c
Signed-off-by: youbowu <wu.youbo@zte.com.cn>
rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineService.java
rulemgt/src/main/java/org/openo/holmes/rulemgt/bolt/enginebolt/EngineWrapper.java

index e792fbf..ac381d1 100644 (file)
@@ -26,7 +26,6 @@ import javax.ws.rs.core.Response;
 import lombok.extern.slf4j.Slf4j;\r
 import org.glassfish.jersey.client.ClientConfig;\r
 import org.jvnet.hk2.annotations.Service;\r
-import org.openo.holmes.common.config.MicroServiceConfig;\r
 import org.openo.holmes.rulemgt.bean.request.CorrelationCheckRule4Engine;\r
 import org.openo.holmes.rulemgt.bean.request.CorrelationDeployRule4Engine;\r
 import org.openo.holmes.rulemgt.constant.RuleMgtConstant;\r
@@ -35,10 +34,11 @@ import org.openo.holmes.rulemgt.constant.RuleMgtConstant;
 @Service\r
 public class EngineService {\r
 \r
+    String url = "http://10.250.0.3:9102";\r
+\r
     protected Response delete(String packageName) throws IOException {\r
         Client client = createClient();\r
-        WebTarget webTarget = client\r
-                .target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH + "/" + packageName);\r
+        WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH + "/" + packageName);\r
         return webTarget.request(MediaType.APPLICATION_JSON).delete();\r
     }\r
 \r
@@ -52,7 +52,7 @@ public class EngineService {
         Client client = createClient();\r
         ObjectMapper mapper = new ObjectMapper();\r
         String content = mapper.writeValueAsString(correlationCheckRule4Engine);\r
-        WebTarget webTarget = client.target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH);\r
+        WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH);\r
         return webTarget.request(MediaType.APPLICATION_JSON).post(Entity.entity(content, MediaType.APPLICATION_JSON));\r
     }\r
 \r
@@ -60,7 +60,7 @@ public class EngineService {
         Client client = createClient();\r
         ObjectMapper mapper = new ObjectMapper();\r
         String content = mapper.writeValueAsString(correlationDeployRule4Engine);\r
-        WebTarget webTarget = client.target(MicroServiceConfig.getMsbServerAddr() + RuleMgtConstant.ENGINE_PATH);\r
+        WebTarget webTarget = client.target(url + RuleMgtConstant.ENGINE_PATH);\r
         return webTarget.request(MediaType.APPLICATION_JSON).put(Entity.entity(content, MediaType.APPLICATION_JSON));\r
     }\r
 }\r
index c568723..cdae89e 100644 (file)
@@ -81,6 +81,7 @@ public class EngineWrapper {
             log.info("Call check rule rest interface in engine successfully.");\r
             return true;\r
         } else {\r
+            log.info(response.getStatus() + " " + response.getStatusInfo() + " " + response.getEntity());\r
             throw new CorrelationException(I18nProxy.RULE_MANAGEMENT_CHECK_NO_PASS);\r
         }\r
     }\r