X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=zte%2Fsfc-driver%2Fsfc-driver%2Fsrc%2Fmain%2Fjava%2Forg%2Fonap%2Fsfc%2Futils%2FSfcDriverUtil.java;h=1658c03b820f157abfa9eb7aab436ebdc9e1b86f;hb=b4407b084b5f3da5a991c4e4374ab327156057ba;hp=30cc766e4fbb36ed7ea9d497d415f77bf4cb0576;hpb=d70c6ad9da81011b3c8fdc4a177f0094ff5967f8;p=vfc%2Fnfvo%2Fdriver%2Fsfc.git diff --git a/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java b/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java index 30cc766..1658c03 100644 --- a/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java +++ b/zte/sfc-driver/sfc-driver/src/main/java/org/onap/sfc/utils/SfcDriverUtil.java @@ -20,7 +20,7 @@ import org.onap.sfc.entity.ChainParameter; import org.onap.sfc.entity.MsbRegisterEntity; import org.onap.sfc.entity.NodeEntity; import org.onap.sfc.entity.portpair.ServiceFunctionParameter; - +import org.onap.sfc.service.ConfigInfo; import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; @@ -32,7 +32,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; public class SfcDriverUtil { - public static Log log = LogFactory.getLog(SfcDriverUtil.class); + private static final Log log = LogFactory.getLog(SfcDriverUtil.class); public static String generateUuid() { return UUID.randomUUID().toString(); @@ -69,8 +69,8 @@ public class SfcDriverUtil { public static String generateAuthorization() { String userName = "admin"; - String password = "admin"; - String usernameAndPassword = userName + ":" + password; + String authCred = "admin"; //Password string: Sonar will raise concern + String usernameAndPassword = userName + ":" + authCred; // String headName = "Authorization"; return "Basic " + javax.xml.bind.DatatypeConverter.printBase64Binary(usernameAndPassword.getBytes()); } @@ -85,7 +85,7 @@ public class SfcDriverUtil { entity.setVisualRange("1"); ArrayList nodes = new ArrayList(); NodeEntity node = new NodeEntity(); - node.setIp(getLocalIp()); + node.setIp(ConfigInfo.getConfig().getServiceIp()); node.setPort("8411"); node.setTtl("1"); nodes.add(node);